怎么好像它不归零啊?
我是想每月1号开始统计,如果本月连续亏损3次,后面就不交易了。
可是上面怎么看上去不对啊?
vairable:n=0;
if month<>ref(month,1) then n:=0;
if 平仓条件 and holding>0 then begein
sell(1,0,market);
if numprofit(1)<0 then n:=n+1;
if numprofit(1)>0 then n:=0;
end
if n>=3 then BEGIN
drawtextex(1,1,500,500,'月损益过大停止运行,下月再战');
exit;
END;
if numprofit(1)>0 then n:=0;
这2句莫非必须要在所有平仓条件都跟? 而不是检测仓位状况后再执行?
if 平仓条件 and holding>0 then begein
sell(1,0,market);
if numprofit(1)<0 then n:=n+1;
if numprofit(1)>0 then n:=0;
end
这样的是一定要 条件判断+持仓判断 一起的,不然条件满足但是没持仓的也给算进去
和开仓条件没什么关系
是的,有多少加多少