Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/451.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 交易视图图表集成的数据格式_Javascript_Php_Charts_Tradingview Api - Fatal编程技术网

Javascript 交易视图图表集成的数据格式

Javascript 交易视图图表集成的数据格式,javascript,php,charts,tradingview-api,Javascript,Php,Charts,Tradingview Api,我正在尝试克隆交易视图图表api。我检查了他们提供的github示例,发现了以下代码: var _datafeed = new Datafeeds.UDFCompatibleDatafeed("http://yourhost/tradingview", 10000); var _widget = window.tvWidget = new TradingView.widget({ symbol: 'AAPL', fullscreen:t

我正在尝试克隆交易视图图表api。我检查了他们提供的github示例,发现了以下代码:

  var _datafeed = new Datafeeds.UDFCompatibleDatafeed("http://yourhost/tradingview", 10000);
        var _widget = window.tvWidget = new TradingView.widget({
          symbol: 'AAPL',
          fullscreen:true,
          interval: '15',
          container_id: "tv_chart_container",
          datafeed: _datafeed,
          library_path: "/charting_library/",
          locale: getParameterByName('lang') || "en",
          disabled_features: ["use_localstorage_for_settings", "header_symbol_search", "symbol_search_hot_key"],
          debug: false,
          overrides: {
            "paneProperties.background": "#222222",
            "paneProperties.vertGridProperties.color": "#454545",
            "paneProperties.horzGridProperties.color": "#454545",
            "symbolWatermarkProperties.transparency": 90,
            "scalesProperties.textColor": "#AAA"
          }
        });

我知道提供的数据是从url“”提供的。有人能帮我找到从该url提供的数据格式吗。提前感谢

在component.ts中使用此代码

customFormatters: {
    dateFormatter: {
      format: function (date) {
        var days = ["شنبه", "یکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه"],
          year = date.getUTCFullYear(),
          month = date.getUTCMonth() + 1,
          day = date.getUTCDate(),
          result = day + "-" + month + "-" + year;
        return days[date.getUTCDay() - 1] + " " + result;
      }
    }
  }

也可以在component.ts中为persiandate使用plugin.js

customFormatters: {
    dateFormatter: {
      format: function (date) {
        var days = ["شنبه", "یکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه"],
          year = date.getUTCFullYear(),
          month = date.getUTCMonth() + 1,
          day = date.getUTCDate(),
          result = day + "-" + month + "-" + year;
        return days[date.getUTCDay() - 1] + " " + result;
      }
    }
  }

还可以使用plugin.js for persiandate

尝试使用get方法通过postman点击所有这些url。它将为您提供正确数据格式的响应。 1. 2. 3. 4. 5. 6. ;


替换为:

尝试使用get方法通过postman点击所有这些url。它将为您提供正确数据格式的响应。 1. 2. 3. 4. 5. 6. ;


替换为:

Tradingview不为库提供数据(样本数据除外),因此它们打算让您构建自己的数据传输层。这可以是UDF更新的格式,也可以通过JSAPI。Tradingview不为库提供数据(样本数据之外),因此它们打算让您构建自己的数据传输层。这可以是UDF更新的格式,也可以通过JSAPI。您知道如何将自己的符号和数据传递给交易视图图表吗?@Afsanefda您应该编写自己的UDF数据馈送API包装器。我是用Python编写的。你知道我如何将自己的符号和数据传递给交易视图图表吗?@Afsanefda你应该编写自己的UDF数据提要API包装器。我已经用Python编写了它。