以文本方式查看主题

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

--  作者:qqxc50
--  发布时间:2015/2/13 15:20:44
--  求助
如果当前周期的K线在本周期收盘时,朝有利于我的方向走了2ATR,则在收盘时平掉一半仓位。这个怎么编写?
--  作者:jinzhe
--  发布时间:2015/2/13 15:27:09
--  

aa:=stkindi(\'\',\'atr.atr\',0,datatype);

if holding>0 and c>=enterprice+2*aa then sell(1,50%,marketr);

if holding<0 and c<=enterprice-2*aa then sellshort(1,50%,marketr);