交易视图集成槽网络套接字



我正在尝试将交易视图图表库实施到我的角度项目中,并使用来自加密比较槽网络套接字的数据。

我浏览了文档,发现它有点令人困惑。

是否需要创建自己的自定义数据馈送对象?如果是,那么如何?

一般来说,如果有人有一个如何做到这一点的例子,那就太好了。

提前啰嗦!!

编辑

我正在添加我的小部件配置对象,我想了解我应该更改什么才能从 CryptoCompare 获取数据:

const widgetOptions: ChartingLibraryWidgetOptions = {
symbol: this._symbol,
datafeed: new (window as any).Datafeeds.UDFCompatibleDatafeed(this._datafeedUrl),
interval: this._interval,
container_id: this._containerId,
library_path: this._libraryPath,
locale: 'en',
disabled_features: ['use_localstorage_for_settings'],
enabled_features: ['study_templates'],
charts_storage_url: this._chartsStorageUrl,
charts_storage_api_version: this._chartsStorageApiVersion,
client_id: this._clientId,
user_id: this._userId,
fullscreen: this._fullscreen,
autosize: this._autosize,
};

我应该更改哪些参数才能访问加密比较数据?

嘟嘟

使用 JS API tradingview,在 subscribeBars 中,您可以使用 onRealtimeCallback 实现 websocket

this.subscribeBars = function (symbolInfo, resolution, onRealtimeCallback, subscribeUID, onResetCacheNeededCallback) {
$scope.$on('handleBroadcastDfn', function () {
if (symbolInfo.id === dfnData.message.symbol) {
onRealtimeCallback(
{
time: lastData.time,
close: dfnData.message.ask,
open: lastData.open,
low: lastData.low,
high: lastData.high, volume: 0
});
}
});
}

最新更新