diff:=ema(close,12)-ema(close,26);
dea:=ema(diff,9);
macd:=2*(diff-dea);
ema15:=ema(close,15);
n:=barslast(date<>ref(date,1));
topen:=valuewhen(n=0,open);//今开
tlow:=valuewhen(n=0,low);//今低
lclose:=callstock(stklabel,vtclose,6,-1);//昨收
jumphigh:=tlow>lclose;//跳空高开
jumplow:=tlow<lclose;//跳空低开
if (jumphigh and ref(close,1)<lclose and diff>dea and close>ema15)then begin
buy(holding=0,1,market);//做多
end
if time>=151500 then begin
sell(holding>0,holding,market);
sellshort(holding<0,holding,market);
end
if (holding>0 and (AVGENTERPRICE-close)/AVGENTERPRICE>0.01) then sell(1,holding, market);
if (holding<0 and (close-AVGENTERPRICE)/AVGENTERPRICE>0.01) then sellshort(1,holding, market);
资金:asset,noaxis,colorred,linethick2;