同花顺背离顶底指标公式
2019-04-24 作者:股匠网整理 来源:本站整理
DIF:(EMA(CLOSE12)-EMA(CLOSE26))colorwhite;
DEA:EMA(DIF9)coloryellow;
MACD:(DIF-DEA)*2COLORSTICK;
死叉:=CROSS(DEADIF);
N1:=BARSLAST(死叉);
N2:=REF(BARSLAST(死叉)N1+1);
N3:=REF(BARSLAST(死叉)N2+N1+2);
CL1:=LLV(CN1+1);
DIFL1:=LLV(DIFN1+1);
CL2:=REF(CL1N1+1);
DIFL2:=REF(DIFL1N1+1);
CL3:=REF(CL2N1+1);
DIFL3:=REF(DIFL2N1+1);
PDIFL2:=IF(DIFL2>0INTPART(LOG(DIFL2))-1INTPART(LOG(-DIFL2))-1);
MDIFL2:=INTPART(DIFL2/POW(10PDIFL2));
PDIFL3:=IF(DIFL3>0INTPART(LOG(DIFL3))-1INTPART(LOG(-DIFL3))-1);
MDIFL3:=INTPART(DIFL3/POW(10PDIFL3));
MDIFB2:=INTPART(DIF/POW(10PDIFL2));
MDIFB3:=INTPART(DIF/POW(10PDIFL3));
直接底背离:=(CL1<CL2 ) AND (MDIFB2>MDIFL2) AND (MACD<0 AND REF(MACD1)<0) AND MDIFB2<=REF(MDIFB21);
隔峰底背离:=(CL1<CL3 AND CL3<CL2 ) AND (MDIFB3>MDIFL3) AND (MACD<0 AND REF(MACD1)<0) AND MDIFB3<=REF(MDIFB31);
B:=(直接底背离 OR 隔峰底背离);
BG:=((MDIFB2>REF(MDIFB21))*REF(直接底背离1)) OR ((MDIFB3>REF(MDIFB31))*REF(隔峰底背离1));
STICKLINE(B OR BG0MACD80)colorgreen;
DRAWTEXT(FILTER(BG10)(DIF*1.5)'底')colorred;
金叉:=CROSS(DIFDEA);
M1:=BARSLAST(金叉);
M2:=REF(BARSLAST(金叉)M1+1);
M3:=REF(BARSLAST(金叉)M2+M1+2);
CH1:=HHV(CM1+1);
DIFH1:=HHV(DIFM1+1);
CH2:=REF(CH1M1+1);
DIFH2:=REF(DIFH1M1+1);
CH3:=REF(CH2M1+1);
DIFH3:=REF(DIFH2M1+1);
PDIFH2:=IF(DIFH2>0INTPART(LOG(DIFH2))-1INTPART(LOG(-DIFH2))-1);
MDIFH2:=INTPART(DIFH2/POW(10PDIFH2));
PDIFH3:=IF(DIFH3>0INTPART(LOG(DIFH3))-1INTPART(LOG(-DIFH3))-1);
MDIFH3:=INTPART(DIFH3/POW(10PDIFH3));
MDIFT2:=INTPART(DIF/POW(10PDIFH2));
MDIFT3:=INTPART(DIF/POW(10PDIFH3));
直接顶背离:=(CH1>CH2 ) AND (MDIFT2<MDIFH2) AND (MACD>0 AND REF(MACD1)>0) AND MDIFT2>=REF(MDIFT21);
隔峰顶背离:=(CH1>CH3 AND CH3>CH2 ) AND (MDIFT3<MDIFH3) AND (MACD>0 AND REF(MACD1)>0) AND MDIFT3>=REF(MDIFT31);
T:=(直接顶背离 OR 隔峰顶背离);
TG:=((MDIFT2<REF(MDIFT21))*REF(直接顶背离1)) OR ((MDIFT3<REF(MDIFT31))*REF(隔峰顶背离1));
STICKLINE(T OR TG0MACD80)colorred;
DRAWTEXT(FILTER(TG20)(DIF*1.4)'顶')colorgreen;
上一篇: 同花顺主力预判指标公式
下一篇: 同花顺金牛出水主图指标公式