[PEL] 复制代码 INPUT:ss(1,1,100,1);
input:p(26,20,100,8),s(12,5,40,4),m(9,2,60,6);
DIFF :EMA(CLOSE,S) - EMA(CLOSE,P);
DEA :EMA(DIFF,M);
MACD1 :2*(DIFF-DEA), COLORSTICK;
tt:time;
macdjc:cross(diff,dea),NODRAW;//macd金叉
macdsc:cross(dea,diff),NODRAW;
tcd: (time>=130100 and time<185900) or (time>=013100 and time<25900);
if macdjc and tcd then buy(holding=0,ss,market);
if macdsc and tcd then sell(1,holding,market);
if time>=185900 or (time>=25900 and time<130100) then
begin
收盘平仓:sell(1,holding,market);
end
供参考,参数可调整。 |