-- 作者:FireScript
-- 发布时间:2018/3/30 13:06:01
--
input:p(26,20,100,8),s(12,5,40,4),m(9,2,60,6),P1(12,1,300,30),P2(50,1,300,30),P3(20,1,300,30),P4(60,1,300,30),N1(4,1,8,1);//参数设置
wx:=DRAWNULL; M1:EMA(CLOSE,P1);//EXPMA M2:EMA(CLOSE,P2)*if(n1<2,wx,1); M3:EMA(CLOSE,P3)*if(n1<3,wx,1); M4:EMA(CLOSE,P4)*if(n1<4,wx,1);
DIFF : EMA(CLOSE,S) - EMA(CLOSE,P); DEA : EMA(DIFF,M); MACD1 : 2*(DIFF-DEA), COLORSTICK;
expmajc:cross(m1,m2);//这里用的是m1和m2 ,您可以熟悉expma之后可以自行修改的 expmasc:cross(m2,m1);
if expmajc and macd1>0 then begin buy(holding=0,1,MARKET); end
if macd1<0 then begin sell(holding>0,holding,market); end
if expmasc and macd1<0 then begin buyshort(holding=0,1,MARKET); end
if macd1>0 then begin sellshort(holding<0,holding,market); end
|