- 精华
- 0
- 在线时间
- 37 小时
- UID
- 271012
- 积分
- 8
- 帖子
- 6
- 阅读权限
- 10
- 注册时间
- 2018-10-9
- 最后登录
- 2020-11-29
- 精华
- 0
- UID
- 271012
- 积分
- 8
- 帖子
- 6
- 主题
- 1
- 阅读权限
- 10
- 注册时间
- 2018-10-9
- 最后登录
- 2020-11-29
|
我的模型是晚上21:00开盘到21:25分间,产生5根5分钟K线,取这5根5分钟K线中的最高点及最低点分别为区间的上轨及下轨,分别用水平线画出来,当价格穿越上下轨时发出警告信号,代码如下:
Params
Numeric Hanstime(0.2125);
Numeric Extime(0.2300);
Vars
NumericSeries UpBand;
NumericSeries DnBand;
Begin
if(0.2100<= CurrentTime && CurrentTime<=0.2125)
{
UpBand = Highest(H,5);
DnBand = Lowest(L,5);
PlotNumeric("UpBand",UpBand,0,yellow,0);
PlotNumeric("DnBand",DnBand,0,yellow,0);
}
if (AlertEnabled && CrossOver(UpBand,DnBand))
{
Alert("Do Alert Now");
}
End
请大神指教! |
|