设置均线
//均线
_this.MALine5 = widget
.chart()
.createStudy("Moving Average", false, false, [5, "close", 0], null, {
"Plot.color": "green",
"Plot.linewidth": 0,
});
_this.MALine10 = widget
.chart()
.createStudy("Moving Average", false, false, [10, "close", 0], null, {
"Plot.color": "red",
"Plot.linewidth": 0,
});
_this.MALine20 = widget
.chart()
.createStudy("Moving Average", false, false, [20, "close", 0], null, {
"Plot.color": "#409EFF",
"Plot.linewidth": 0,
});
位置截图:
在onChartReady里面 和自定义周期同级
隐藏均线
在设置的下面.setVisible(false)即可
//均线
_this.MALine5 = widget
.chart()
.createStudy("Moving Average", false, false, [5, "close", 0], null, {
"Plot.color": "green",
"Plot.linewidth": 0,
});
_this.MALine10 = widget
.chart()
.createStudy("Moving Average", false, false, [10, "close", 0], null, {
"Plot.color": "red",
"Plot.linewidth": 0,
});
_this.MALine20 = widget
.chart()
.createStudy("Moving Average", false, false, [20, "close", 0], null, {
"Plot.color": "#409EFF",
"Plot.linewidth": 0,
});
widget.chart().getStudyById(_this.MALine5).setVisible(false);
widget.chart().getStudyById(_this.MALine10).setVisible(false);
widget.chart().getStudyById(_this.MALine20).setVisible(false);
vue TradingView k线地址 : https://blog.csdn.net/pxhing/article/details/106997657.
vue TradingView为k线做标记: https://blog.csdn.net/pxhing/article/details/118584281.