文章目录:
求同花顺MACD与股价底背离的选股公式,dif dea 红绿柱,面积底背离都可以
DIF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:=EMA(DIF,MID);
MACD0:=(DIF-DEA)*2;
XXX:=IF(N=1,DIF,IF(N=2,DEA,IF(N=3,MACD0,0)));
XG:CROSS(DIF,DEA) AND REF(LLV(L,BARSLAST(CROSS(DEA,DIF))+1),BARSLAST(CROSS(DIF,DEA))+1)REF(LLV(L,BARSLAST(CROSS(DEA,DIF))+1),BARSLAST(CROSS(DIF,DEA))+1+REF(BARSLAST(CROSS(DIF,DEA))+1,BARSLAST(CROSS(DIF,DEA))+1)) AND REF(LLV(XXX,BARSLAST(CROSS(DEA,DIF))+1),BARSLAST(CROSS(DIF,DEA))+1)REF(LLV(XXX,BARSLAST(CROSS(DEA,DIF))+1),BARSLAST(CROSS(DIF,DEA))+1+REF(BARSLAST(CROSS(DIF,DEA))+1,BARSLAST(CROSS(DIF,DEA))+1));
这个公式可以通过参数n调整选择dif背离,dea背离,macd绿柱背离,不能选背驰.
参数照着图片上填写.
求MACD底背离选股公式源码
MACD底背离:通达信版、同花顺版
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
QZQ:=BARSLAST(REF(MACD,1)0 AND MACD0);
QM:=LLVBARS(MACD,QZQ+20);
MQDZ:=IF(QMQZQ,REF(MACD,QM),0);
XG1:=MACD0 AND MACDMQDZ
AND CLOSE=LLV(CLOSE,QZQ+20) AND MQDZ0;
XG:REF(XG1,1)=1 AND MACDREF(MACD,1);
可以帮写一个同花顺的底背离选股公式吗?
MA1:=MA(CLOSE,5);
MA2:=MA(CLOSE,10);
DIF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:=EMA(DIF,MID);
MACD:=(DIF-DEA)*2,COLORSTICK;
DIFF:=SUM(MA1-MA2,0);
SUMMACD:=SUM(MACD,0);
W1:=BARSLAST(CROSS(MA2,MA1))+1;
W2:=BARSLAST(CROSS(MA1,MA2))+1;
W3:=BARSLAST(CROSS(MACD,0))+1;
W4:=BARSLAST(CROSS(-MACD,0))+1;
趋势力度:IF(K,SUMMACD-REF(SUMMACD,MIN(W3,W4)),DIFF-REF(DIFF,MIN(W1,W2)));
趋势平均力度:趋势力度/IF(K,(MIN(W3,W4)+1)/20,(MIN(W1,W2)+1)/20),COLORSTICK;
MAX趋势平均力度:HHV(趋势平均力度,34);
MIN趋势平均力度:LLV(趋势平均力度,34);
--------------------------------------------------------------------------------------------------------------------------------------------
K值可调,调成“0”是通过均线缠绕面积判断背驰
调成“1”是通过macd面积判断背驰。
白线为均线(或macd )到目前为止的面积,白线的拐点(即某一段的最大值(绝对值))是均线或macd面积。如果K调成1,红绿柱为凭据趋势力度。
此指标不是选股指标,是个副图指标,因为选股指标需要判断前后面积的大小,难度极大,不易做出,目前还没发现有人能写出来。
-----------------------------------------------------------------------------------------K值可调,调成“0”是通过均线缠绕面积判断背驰调成“1”是通过macd面积判断背驰。白线为均线(或ma
(CROSS(DEA,DIF))+1),BARSLAST(CROSS(DIF,DEA))+1)REF(LLV(L,BARSLAST(CROSS(DEA,DIF))+1),BARSLAST(CROSS(DIF,DEA))+1+REF(BARSLAST(CROSS(DIF,DEA))+1