行为冻结物理拆分;保留 initTradingView/dispose 对外 API;无打包器。node --check 全绿。 Co-authored-by: Cursor <cursoragent@cursor.com>
27 lines
684 B
JavaScript
27 lines
684 B
JavaScript
/* chart_tv.js — facade: initTradingView orchestrates split modules */
|
|
|
|
function initTradingView(symbol, timeframe) {
|
|
try {
|
|
disposeTradingViewCharts();
|
|
console.log('初始化TradingView图表:', symbol, timeframe);
|
|
|
|
var ctx = {
|
|
symbol: symbol,
|
|
timeframe: timeframe
|
|
};
|
|
|
|
chartTvBuildShell(ctx);
|
|
if (!ctx.mainChart) {
|
|
return;
|
|
}
|
|
chartTvRenderIndicators(ctx);
|
|
chartTvRenderChan(ctx);
|
|
chartTvRenderOverlays(ctx);
|
|
chartTvFinalize(ctx);
|
|
|
|
console.log('图表初始化完成');
|
|
} catch (e) {
|
|
console.error('图表初始化错误:', e);
|
|
}
|
|
}
|