请教各位大神:
麻烦帮我看一下我的后台交易代码有没有什么问题:
IF BUYCOND THEN BEGIN
TBUY(THOLDING=0,SS,MKT);
END
IF BUYSHORTCOND THEN BEGIN
TBUYSHORT(THOLDING=0,SS,MKT);
END
zg:=hhv(Tasset,Tenterbars+1);
cs:=ref(Tasset,Tenterbars);
if (zg-cs)/cs>=0.01 and (Tasset-cs)<=(zg-cs)*0.8 then begin
Tsell(1,0,MKT);
Tsellshort(1,0,MKT);
End
多单止损:=Tsell(Tavgenterprice-c>20*mindiff and Tholding>0,0,MKT);
空单止损:=Tsellshort(c-Tavgenterprice>20*mindiff and Tholding<0,0,MKT);
谢谢!!!!!
持仓判断最好用
TBUYHOLDING//多仓
TSELLHOLDING//空仓
cs:=ref(Tasset,Tenterbars+1);