以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  定位离场位  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=149226)

--  作者:系统使用者
--  发布时间:2017/3/17 1:08:16
--  定位离场位
if holding<0 and l<maxhl then begin //创新低后,重新定位离场位,以实现浮动止损
 maxhl:=l;
 zs:=gbg;
end
 
if holding>0 and h>maxhl then begin //创新高后,重新定位离场位,以实现浮动止损
 zs:=gbd;
 maxhl:=h;
end

正确的事这样吧

if holding<0 and l<maxhl then begin //创新低后,重新定位离场位,以实现浮动止损
 maxhl:=l;
 zs:=gbg;
end
 
if holding>0 and h>maxhl then begin //创新高后,重新定位离场位,以实现浮动止损
 maxhl:=h;
 zs:=gbd;
end

--  作者:jinzhe
--  发布时间:2017/3/17 8:43:55
--  
上下两段代码有什么不同点吗