【问题标题】:Data format of trading view chart integration交易视图图表整合的数据格式
【发布时间】:2018-02-14 11:34:56
【问题描述】:

我正在尝试克隆交易视图图表 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“http://yourhost/tradingview”。谁能帮我找到从该 url 提供的数据格式。提前致谢

【问题讨论】:

标签: javascript php charts tradingview-api


【解决方案1】:
【解决方案2】:

在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;
      }
    }
  }

并且还使用 plugin.js for persiandate

【讨论】:

  • 您知道如何将自己的交易品种和数据传递到交易视图图表吗?
  • @Afsanefda 您应该编写自己的 UDF 数据提要 API 包装器。我是用 Python 写的。
  • 萨拉姆·凯文·阿齐兹;您知道如何在不编程的情况下从 tradingView 站点(或使用 tradingView 的站点)中抓取历史数据吗? (来自铬)
  • 嗨@Mohammad_Hosein,不幸的是我不知道如何从TradingView 站点获取数据,因为我们仅将TradingView 工具用于德黑兰证券交易所,但我听说您可以从其他站点和其中一些站点获取全球股票数据有用于获取数据的 API。我听说雅虎为此操作提供了一些免费的 Api,但它是免费的并且有一些限制
  • @Mohammad_Hosein,请看这个链接polygon.io/…
猜你喜欢
  • 2019-02-07
  • 1970-01-01
  • 2021-12-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-02-17
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多