[PEL] 复制代码 input:p(26,20,100,8),s(12,5,40,4),m(9,2,60,6);//macd参数设置
input:手数(3,1,300,1);
diff := ema(close,s) - ema(close,p);
dea : =ema(diff,m);
macd1 : =2*(diff-dea), colorstick;
macdjc:cross(macd1,0);
macdsc:cross(0,macd1);
ma15:ma(c,15);
kk:=(diff<0 and dea<0 and cross(ma15,c)) or (macd1<0 and macdsc);
kd:=(diff>0 and dea>0 and cross(c,ma15)) or (macd1>0 and macdjc);
pk:=macdjc;
pd:=macdsc;
if kk then
begin
sell(1,holding,market);
buyshort(holding=0,手数,market);
end
if kd then
begin
sellshort(1,holding,market);
buy(holding=0,手数,market);
end
sell(pd,holding,market);
sellshort(pk,holding,market); |