以文本方式查看主题

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

--  作者:c100011212
--  发布时间:2016/5/4 11:47:24
--  止损
请问如何编写亏损达到开仓价的5%就平仓?
--  作者:c100011212
--  发布时间:2016/5/4 13:13:52
--  
没人回答吗?
--  作者:jinzhe
--  发布时间:2016/5/4 13:18:17
--  

if holding>0 and c<enterprice*0.95 then sell(1,0,marketr);

if holding<0 and c>enterprice*1.05 then sellshort(1,0,marketr);