大智慧MACD背离与面积不错的研判技术源码说明

DIFF:EMA(CLOSE,10) - EMA(CLOSE,22),LINETHICK0;
DEA :EMA(DIFF,7.5),LINETHICK0;
MACD :2*(DIFF-DEA),LINETHICK0;
HZL:=CROSS(MACD,0);
LZH:=CROSS(0,MACD);
BC:=BARSLAST(HZL OR LZH)+1;
ZGHZ:=IF(MACD>0,HHV(MACD,bc),0);
ZDLZ:=IF(MACD<0,LLV(MACD,bc),0);
FILLRGN(ZDLZ,0,MACD<0,RGB(44,88,44),MACD<0,RGB(0,0,0));
FILLRGN(ZGHZ,0,MACD>0,RGB(99,55,55),MACD<0,RGB(0,0,0));
FILLRGN(DIFF,DEA,DIFF>DEA,RGB(142,66,140),DIFF<DEA,RGB(64,129,129));{
PARTLINE(CROSS(DIFF,DEA) AND DIFF<0,DIFF),CROSSDOT,LINETHICK3,COLORff00FF;
PARTLINE(CROSS(DEA ,DIFF),DIFF),CROSSDOT,LINETHICK3,COLOR00ff00;}
STICKLINE(MACD>0 AND MACD>REF(MACD,1),0,MACD,5,1),COLORRED;
STICKLINE(MACD>0 AND MACD<REF(MACD,1),0,MACD,5,0),COLOR90FF00;
STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,5,1),COLOREFFF00;
STICKLINE(MACD<0 AND MACD>REF(MACD,1),0,MACD,5,0),COLORFFAAFF;
↑:TROUGHBARS(3,3,1),COLOR0000FF,LINETHICK0;
↓:PEAKBARS(3,3,1),COLOR00FF00,LINETHICK0;
低:=IF(↑=0,DIFF,IF(↓<↑,TROUGH(3,3,1),REF(TROUGH(3,3,1),1)));
高:=IF(↓=0,DIFF,IF(↑<↓,PEAK(3,3,1),REF(PEAK(3,3,1),1)));
STICKLINE(↑=0 AND DIFF<0 AND DIFF<DEA,0,DIFF,0,0),COLOR0000FF;
STICKLINE(↓=0 AND DIFF>0 AND DIFF>DEA,DIFF,0,0,0),COLOR00FF00;
DRAWTEXT(↑=0 AND DIFF<0 AND DIFF<DEA,DIFF,'低'),COLORWHITE;
DRAWTEXT(↓=0 AND DIFF>0 AND DIFF>DEA,DIFF,'高'),COLOR11FF11;
PARTLINE(DIFF,CROSS(DIFF,DEA ) AND DIFF<0,RGB(2,224,12)),CROSSDOT,LINETHICK3;
PARTLINE(DIFF,CROSS(DIFF,DEA ) AND DIFF>0,RGB(255,22,222)),CROSSDOT,LINETHICK3;
PARTLINE(DIFF,CROSS(DEA,DIFF ),RGB(255,245,12)),CIRCLEDOT,LINETHICK3;
DRAWFLAGTEXT(CROSS(DIFF,DEA ) AND DIFF<0,DIFF,'MACD<0金叉');
DRAWFLAGTEXT(CROSS(DIFF,DEA ) AND DIFF>0,DIFF,'MACD>0金叉');
DRAWFLAGTEXT(CROSS(DEA ,DIFF),DIFF,'死叉');
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);
DRAWTEXT(FILTER(B1>0,5),0,'←MACD'),COLORGREEN;
A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));
B2:=REF(C,A2+1)>C AND REF("KDJ.K",A2+1)<"KDJ.K" AND CROSS("KDJ.K","KDJ.D");
DRAWTEXT(FILTER(B2>0,5),MACD,'←KDJ'),COLORYELLOW;
A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1",A3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2");
DRAWTEXT(FILTER(B3>0,5),MACD,'←RSI'),COLORCYAN;
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF);
DRAWTEXT(FILTER(D1>0,5),MACD,'←MACD'),COLORWHITE;
C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));
D2:=REF(C,C2+1)<C AND REF("KDJ.K",C2+1)>"KDJ.K" AND CROSS("KDJ.D","KDJ.K");
DRAWTEXT(FILTER(D2>0,5),MACD,'←KDJ'),COLORWHITE;
C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));
D3:=REF(C,C3+1)<C AND REF("RSI.RSI1",C3+1)>"RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1");
DRAWTEXT(FILTER(D3>0,5),MACD,'←RSI'),COLORMAGENTA;
DRAWFLAGTEXT(FILTER(B2>0,5),MACD,'KDJ金叉');
DRAWFLAGTEXT(FILTER(B3>0,5),MACD,'RSI金叉');
DRAWFLAGTEXT(FILTER(D2>0,5),MACD,'KDJ死叉');
DRAWFLAGTEXT(FILTER(D3>0,5),MACD,'RSI死叉');
DRAWTEXTABS(2,8,'【精华8个字 买小卖小,缩头缩脚】 当股价一波比一波高时,反而红柱的堆,一堆比一堆小,证明产生了顶背离现象,应该及时卖出'+''),Color1111FF;
DRAWTEXTABS(200,22,'当股价一波比一波低时,反而绿柱的堆,一堆比一堆小,证明产生了底背离现象,应该及时买进'+''),Color11FF11;




未来函数检测结果如下:
该公式包含未来函数:PEAK
该公式包含未来函数:PEAKBARS
该公式包含未来函数:TROUGH
该公式包含未来函数:TROUGHBARS
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式

联系我们  |  股票指标网  |  指标网   |  指标公式  |   加入收藏   |  设为主页

@2005-2023 粤ICP备2023063687号-2 股票指标网别名指标网仅为互联网文章,所有股票指标公式及文章仅供学习研究,并不构成投资建议,请勿以此为依据进行股票交易,由此引起的投资亏损与本站无关。股票指标网均来源互联网收集整理,如不慎侵犯了你的权益,请联系我们告知,我们将做删除处理
QQ:88652583 微信 88652583
sitemap站点地图