以文本方式查看主题

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

--  作者:whong
--  发布时间:2015/9/18 16:30:54
--  请一个问题
金字老师,请问一下:开仓后,如果亏损大于上次利润的30%就平仓,怎么编写?谢谢
--  作者:jinzhe
--  发布时间:2015/9/18 16:35:14
--  

if numprofit(1)>0 and openprofit<0 and abs(opeprofit)/numprofit(1)>0.3 then begin

   sell(1,0,market);

   sellshort(1,0,market);

end