用程式自製零滯後MACD
潮流特區
程式交易 www.quants.hk (導師: 財經書藉作家: 麥振威) ・2020-08-18
今天的市況,zero lag macd (零滯後MACD)也是比舊MACD快了差不多60點。近幾天真的較多人問,用Multicharts自製零滯後MACD同時配合Autotrade的在課堂會再講解的。 若以Amibroker自製零滯後MACD,可用以下公式: _SECTION_BEGIN("零滯後MACD");p = Param("P",12,3,36,2);q = Param("Q",26,3,52,2);r = Param("R",9,3,15,1);EMA1= EMA(Close,P);EMA2= EMA(EMA1,P);Difference= EMA1 - EMA2;ZeroLagEMAp= EMA1 + Difference;EMA3= EMA(Close,Q);EMA4= EMA(EMA3,Q);Difference= EMA3 - EMA4;ZeroLagEMAq= EMA3 + Difference;ZeroLagMACD=ZeroLagEMAp - ZeroLagEMAq;EMA5= EMA(ZeroLagMACD,R);EMA6= EMA(EMA5,R);Difference= EMA5 - EMA6;ZeroLagTRIG= EMA5 + Difference;Plot(zerolagMACD, "",5,4);Plot(zerolagtrig, "",7,4);_SECTION_END();