原理:計算當日macd金叉或死叉需要滿足的價格,,以及macd走平或柱體放大縮小滿足的價格位,可以當作止損止盈的一種測算方法,!【將代碼插入macd指標就ok了】
JCSC:=(9-1)/(9+1)*DEA/(1-2/(9+1));{計算出金叉死叉時的DIF值}
DD:=(MACD/2+(DEA*(9-1)/(9+1)))/(1-2/(9+1));{計算出明日MACD=MACD時的DIF值}
{計算今日DIF=DIF的對應股價}
DIF不變:(DIF*(12+1)*(26+1)-(26+1)*(12-1)*EMA(C,12)+(12+1)*(26-1)*EMA(C,26))/(2*((26+1)-(12+1))),NODRAW;
金叉死叉:(JCSC*(12+1)*(26+1)-(26+1)*(12-1)*EMA(C,12)+(12+1)*(26-1)*EMA(C,26))/(2*((26+1)-(12+1))),NODRAW;
柱體變向:(DD*(12+1)*(26+1)-(26+1)*(12-1)*EMA(C,12)+(12+1)*(26-1)*EMA(C,26))/(2*((26+1)-(12+1))),NODRAW;
|
|