使用 DrawLine函数绘制垂线
以BOLL指标为例参考:
Params
Numeric Length(26);
Numeric Offset(26);
Numeric P(2);
Vars
Numeric UpLine; //上轨
Numeric DownLine; //下轨
NumericSeries MidLine; //中间线
NumericSeries TMP2;
Begin
MidLine = Ma(Close, Length);//求Length个周期的收盘价均线,称为布林通道中轨
TMP2 = Std(Close, Offset); //求Offset个周期内的收盘价的标准差
UpLine = MidLine + P * TMP2;//布林通道上轨
DownLine = MidLine - P * TMP2; //布林通道下轨
PlotNumeric("UpLine", UpLine);
PlotNumeric("DownLine", DownLine);
PlotNumeric("MidLine", MidLine);
DrawLine(1,UpLine,1,DownLine,RGB(255,0,0),Linethick1);
End
N是指距离最新一根K线N周期吗?
如果是这样的思路需要通过未来函数结合DrawLine函数实现
MQ软件是不支持未来函数的,如果您是编写指标看盘使用可以通过WH6实现,您考虑一下
wh6官网:http://www.wenhua.com.cn/
