相关标签:
模型策略源码:
原创]信号持续时间及信号成立后价格变化的写法
variable:a1:=0;
variable:a2:=0;
variable:c1:=1;
if cond and c1>0 then
begin
a1:=time0;
a2:=c;
c1:=-1;
end
if not(cond) then
begin
a1:=time0;
a2:=c;
c1:=1;
end
cxsj:=time0-a1;{信号持续成立的时间,等于0表示没有信号}
jgbh:=c-a2;{信号成立后价格变化,如果是用c判断,等于0表示没有信号}
自己调试一下。
使用时用固定轮询,最好是高频扫描。
{别忘了将本网告诉您身边的朋友,向朋友传达有用资料,也是一种人情,你朋友会感谢你的。}