tradingview 周期问题以及监听时间周期切换

邬良才
2023-12-01

1.关于头部周期不显示

 disabled_features: [
          "use_localstorage_for_settings",
          "left_toolbar", //隐藏左边工具栏l
          "header_saveload",
          "header_symbol_search", //隐藏搜索框
          "header_interval_dialog_button", //隐藏设置周期按钮
          "timeframes_toolbar", //隐藏底部刻度栏
          "header_undo_redo", //隐藏撤销重做按钮
          "header_compare", //隐藏比较/增加商品按钮
          "header_screenshot", //隐藏截屏按钮
          // "header_resolutions", //!!!!!隐藏头部周期 记得打开
          "edit_buttons_in_legend",
          "pane_context_menu",
          "legend_context_menu",
          "adaptive_logo",
          "display_market_status",
          "volume_force_overlay",
          "study_templates", //模板
        ], //禁用功能列表

2.监听切换时间事件

 self.tvWidget.subscribe("time_interval", (res) => {
 //res返回的是你要的东西
        self.klineData = [];
        self.initInterval(res);
        self.initData();
      });

完工

 类似资料: