vue中使用TradingView --7 自定义初始化指标线,设置颜色,自定义是否显示

vue中使用TradingView --7 自定义初始化指标线,设置颜色,自定义是否显示

添加折线

_this.MALine5 = _this.chart.chart().createStudy('Moving Average', false, false, [5], null, {'Plot.color': '#642d92'});
_this.MALine10 = _this.chart.chart().createStudy('Moving Average', false, false, [10], null, {'Plot.color': '#5278a3'});
_this.MALine30 = _this.chart.chart().createStudy('Moving Average', false, false, [30], null, {'Plot.color': '#238031'});
_this.MALine60 = _this.chart.chart().createStudy('Moving Average', false, false, [60], null, {'Plot.color': '#850058'});

隐藏折线

_this.chart.chart().getStudyById(_this.MALine5).setVisible(false);
_this.chart.chart().getStudyById(_this.MALine10).setVisible(false);
_this.chart.chart().getStudyById(_this.MALine30).setVisible(false);
_this.chart.chart().getStudyById(_this.MALine60).setVisible(false);

需要注意的是以上方法均在 onchartready里面执行

相关文章:

  • 2021-08-10
  • 2022-12-23
  • 2021-07-26
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
猜你喜欢
  • 2021-08-31
  • 2021-10-21
  • 2022-12-23
  • 2021-09-04
  • 2022-01-28
  • 2021-05-30
相关资源
相似解决方案