以下內容為程序代碼:
1 損數:NUMSEQLOSS,NODRAW;
2 限制:=valuewhen(month<>ref(month,1),損數),NODRAW;
3 if 損數>3 then
4 BEGIN
5 drawtextex(1,1,500,500,'月損益過大停止運行,下月再戰');
6 exit;
7 END;
怎么好像它不歸零啊?
我是想每月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
這樣的是一定要 條件判斷+持倉判斷 一起的,不然條件滿足但是沒持倉的也給算進去
和開倉條件沒什么關系