feat: 更新 @riwa/api-types 依赖版本至 0.0.135;优化 TradingView 数据源和 WebSocket 错误处理逻辑

This commit is contained in:
2026-01-13 23:43:08 +07:00
parent f1f99ad587
commit c49350da0d
4 changed files with 15 additions and 7 deletions

View File

@@ -212,6 +212,7 @@ export class RWADatafeed extends Datafeeds.UDFCompatibleDatafeed {
channels: [{
name: "bar",
symbol: symbolInfo.name,
resolution,
}],
});

View File

@@ -7,6 +7,13 @@ export class TradeWebSocket {
if (!this.socket) {
this.socket = client.api.market_data.streaming.subscribe();
}
this.socket.on("error", () => {
this.socket = null;
this.socket = client.api.market_data.streaming.subscribe();
});
this.socket.on("open", () => {
console.log("TradeWebSocket connected");
});
}
public getSocket(): MarketDataStreaming {