|
|

楼主 |
发表于 2024-10-20 05:46
|
显示全部楼层
通达信用公式
{带顶底背离标识的MACD}
{参数SHORT 2.00 200.00 10.00}
{参数LONG 2.00 200.00 20.50}
{参数MID 2.00 200.00 7.50}
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIF,MID);
DRAWTEXT_FIX(1,0.00,0.00,0,'旧想2018珍藏版'),COLORYELLOW;
MACD:(DIF-DEA)*2,COLORSTICK;
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2;
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);
顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;
JXT:=BARSLAST(MACD<0);
SXT:=BARSLAST(MACD>0);
DRAWNUMBER(JXT=1,MACD,JXT);
{DRAWNUMBER(JXT=3,MACD,JXT);
DRAWNUMBER(JXT=5,MACD,JXT);}
DRAWNUMBER(JXT=9,MACD,JXT);
DRAWNUMBER(JXT=12,MACD,JXT);
DRAWNUMBER(JXT=18,MACD,JXT);
DRAWNUMBER(JXT=21,MACD,JXT);
DRAWNUMBER(JXT=24,MACD,JXT);
{DRAWNUMBER(JXT=29,MACD,JXT);}
DRAWNUMBER(JXT=33,MACD,JXT);
{DRAWNUMBER(JXT=40,MACD,JXT);}
DRAWNUMBER(JXT=45,MACD,JXT);
{DRAWNUMBER(JXT=55,MACD,JXT);}
DRAWNUMBER(SXT=1,MACD,SXT),COLORGREEN;
{DRAWNUMBER(SXT=3,MACD,SXT),COLORGREEN;
DRAWNUMBER(SXT=5,MACD,SXT),COLORGREEN;}
DRAWNUMBER(SXT=9,MACD,SXT),COLORGREEN;
DRAWNUMBER(SXT=12,MACD,SXT),COLORGREEN;
DRAWNUMBER(SXT=18,MACD,SXT),COLORGREEN;
DRAWNUMBER(SXT=21,MACD,SXT),COLORGREEN;
DRAWNUMBER(SXT=24,MACD,SXT),COLORGREEN;
{DRAWNUMBER(SXT=29,MACD,SXT),COLORGREEN;}
DRAWNUMBER(SXT=33,MACD,SXT),COLORGREEN;
{DRAWNUMBER(SXT=40,MACD,SXT),COLORGREEN;}
DRAWNUMBER(SXT=45,MACD,SXT),COLORGREEN;
{DRAWNUMBER(SXT=55,MACD,SXT),COLORGREEN;};
|
|
|