[PEL] 复制代码
O1:VALUEWHEN(TODAYBAR=1,O);//默认夜盘第一个K是一个交易日的第一个K
KD:O1>PRVSETTLEMENT;
KK:O1<PRVSETTLEMENT;
IF KD AND TODAYBAR=1 THEN TBUY(1,1,MKT);
IF KK AND TODAYBAR=1 THEN TBUYSHORT(1,1,MKT);
IF C-TAVGENTERPRICEEX2('','',0)>=100*MINDIFF AND TBUYHOLDINGEX('','',1)>0 THEN TSELL(1,0,MKT);
IF TAVGENTERPRICEEX2('','',0)-C>=20*MINDIFF AND TBUYHOLDINGEX('','',1)>0 THEN TSELL(1,0,MKT);
IF TAVGENTERPRICEEX2('','',1)-C>=100*MINDIFF AND TSELLHOLDINGEX('','',1)>0 THEN TSELLSHORT(1,0,MKT);
IF C-TAVGENTERPRICEEX2('','',1)>=20*MINDIFF AND TSELLHOLDINGEX('','',1)>0 THEN TSELLSHORT(1,0,MKT);
if time=CLOSETIME(0) then
begin
TSELL(1,0,MKT);
TSELLSHORT(1,0,MKT);
end
供参考。 |