n:=(取外部統計數值如果數值低于0.3則取0.3,最高不限);
止贏:檢測真實賬戶實際持倉均價的盈利百分比大于n則止贏;
請幫忙將以上代碼加入下面的交易模塊中,更請優化一下開關倉代碼,萬分感謝!
清倉時間:= time>=112800 and time<=113000 or (time>=145800 and time<=150000);
開車時間:=time>090000 and time<112800 or (time>133000 and time<145800);
tsell(tholding>0 and 平多 or 清倉時間,0,lmtc),orderqueue;
tsellshort(tholding<0 and 平空 or 清倉時間,0,lmt,c),orderqueue;
tbuy(tholding=0 and 開多 and 開倉時間,1,Lmt,c),orderqueue;
tbuyshort(tholding=0 and 開空 and 開倉時間,1,Lmt,c),orderqueue;
外部數值為變量S
n:=if(s>=0.3,s,0.3);
if tholding>0 and (dynainfo(7)-avgtenterprice)/avgtenterrpcie>n/100 then tsell(1,0,mkt);
if tholding<0 and (avgtenterprice-dynainfo(7))/dynainfo(7)>n/100 then tsellshort(1,0,mkt);