How to construct datafeed.js for TradingView Charts for react native?

问题描述 投票:0回答:0

我已经在使用 F2Charts,想切换到 TradingView Charts。在 F2Chart 中,我通过 chart.source 提供所有呈现的图形数据,我知道必须以何种方式构建数组才能正确显示结果,但在 TradingView Charts 中,我无法弄清楚如何通过数据馈送传递数据。有人可以帮忙吗?

import DATAFEED from './datafeed';

function initOnReady(symbol, interval, data) {
     var widget = window.tvWidget = new TradingView.widget({
        // debug: true, // uncomment this line to see Library errors and warnings in the

        fullscreen: true,
        symbol: symbol,
        interval: interval,
        container_id: "tv_chart_container",

        //  BEWARE: no trailing slash is expected in feed URL

        datafeed: DATAFEED, // ---> here I have array how to construct it compatible to tradingview
        library_path: "charting_library/",
        locale: getParameterByName('lang') || "en",

        disabled_features: ["use_localstorage_for_settings"],

        enabled_features: ["study_templates"],
        charts_storage_url: '',
        charts_storage_url: 'http://{$smarty.server.HTTP_HOST}',
        charts_storage_api_version: "1.1",
        client_id: '',
        user_id: 'public_user_id',

javascript reactjs react-native tradingview-api f2-chart