以文本方式查看主题

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

--  作者:skylands
--  发布时间:2014/9/24 13:26:02
--  连亏
日内模型,当日连亏3次后就不再开仓,如何表达?
--  作者:jinzhe
--  发布时间:2014/9/24 13:36:49
--  

variable:n=0;

开仓条件加上n<3

if 平仓条件 and 持仓判断 then begin

    平仓语句;

     if numprofit(1)>=0 then n:=0;

     if numprofit(1)<0 then n:=n+1;

end