至尊变色MACD副图指标 源码 通达信 划线有未来函数

[复制链接]
查看54 | 回复0 | 2022-7-11 10:01:27 | 显示全部楼层 |阅读模式
指标用法: 为了方便看盘,我更喜欢界面简洁的指标,因此MACD柱子只设计了3种色调,红色:强势;白色:转弱;绿色:转强。底背离自动划蓝线,顶背离自动紫线。水下二次金叉划红色小箭头,低位金叉0轴上第1柱画黄柱。MACD死叉后算出红柱面积写红色数字,MACD金叉后算出绿色柱体面积写绿色数字。面积数字更方便判读顶底背离。


DIF1:=EMA(CLOSE,12) - EMA(CLOSE,26); DEA1:=EMA(DIF1,9); MACD1:=2*(DIF1-DEA1),STICK; MACD2:=EMA(MACD1,3); STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,1,0),COLORRED; STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,1,0),COLORGREEN; STICKLINE(MACD1<MACD2,0,MACD1,1,0),COLORCBCBC0; STICKLINE(MACD1>=0,0,0,50,1),COLORWHITE; DIF:DIF1,COLOR33FF33; DEA:DEA1,COLORYELLOW; MACD:MACD1,NODRAW,COLORMAGENTA; 强:IF(DIF1>=DEA1,DIF1,DRAWNULL),COLORRED,LINETHICK2; 低位金叉:=CROSS(DIF1,DEA1) AND DIF1<-0.1; STICKLINE(低位金叉,0,0.08,6,0),COLORYELLOW; JCCOUNT:=COUNT(CROSS(DIF1,DEA1),BARSLAST(DEA1>=0)); 二次金叉:=CROSS(DIF1,DEA1) AND DEA1<0 AND COUNT(JCCOUNT=2,21)=1; DRAWICON(二次金叉,DEA1*0.9,1) ; A1:=BARSLAST(REF(CROSS(DIF1,DEA1),1)); 底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF1>REF(DIF1,A1+1) AND CROSS(DIF1,DEA1); 底背:DRAWLINE(A1=0,DEA1,底背离,DEA1,0),COLORBLUE,LINETHICK2; A2:=BARSLAST(REF(CROSS(DEA1,DIF1),1)); 顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF1,A2+1)>DIF1 AND CROSS(DEA1,DIF1); 顶背:DRAWLINE(A2=0,DEA1,顶背离,DEA1,0),COLORFF00FF,LINETHICK2; {周期放大开关:1为普通模式,0为放大模式}
周期放大:=1;
数显开关:=1;
倍数:=
IF(PERIOD=11,1,{年}
IF(PERIOD=10,4,{季}
IF(PERIOD=9,6, {多日}
IF(PERIOD=8,10,{多分钟}
IF(PERIOD=7,12,{月}
IF(PERIOD=6,5, {周}
IF(PERIOD=5,5, {日}
IF(PERIOD=4,4, {60F}
IF(PERIOD=3,8, {30F}
IF(PERIOD=2,4, {15F}
IF(PERIOD=1,6, {5F}
IF(PERIOD=0,5, {1F}
1))))))))))));
N1:=IF(周期放大,12,12*倍数);
N2:=IF(周期放大,26,26*倍数);
N3:=IF(周期放大,9,9*倍数);
DIFF:EMA(CLOSE,N1) - EMA(CLOSE,N2),COLORWHITE,NODRAW;
红柱面积:IF(MACD>0,SUM(MACD,BARSLAST(MACD<0)),0),NODRAW,COLORRED;
绿柱面积:ABS(IF(MACD<0,SUM(MACD,BARSLAST(MACD>0)),0)),NODRAW,COLORLIGREEN;
MACD面积:=IF(MACD>0,红柱面积,绿柱面积),NODRAW,COLORFFFF00;
位置:=MAX(HHV(DIFF,100),ABS(LLV(DIFF,100)));
{数显开关:1为打开,0为关闭}
DRAWNUMBER(数显开关=1 AND LONGCROSS(DEA,DIFF,3),位置*0.8,REF(红柱面积,1)),COLORRED;
DRAWNUMBER(数显开关=1 AND LONGCROSS(DIFF,DEA,3),0-位置*0.5,REF(绿柱面积,1)),COLORGREEN;
NOTEXTLMH: DRAWNUMBER(数显开关=1 AND ISLASTBAR AND MACD>0,位置*0.8,红柱面积),COLORRED;
NOTEXTLML: DRAWNUMBER(数显开关=1 AND ISLASTBAR AND MACD<0,0-位置*0.5,绿柱面积),COLORGREEN;

 

20208239583750872.jpg

20208239583750872.jpg


20208239584047851.jpg

20208239584047851.jpg

20208231003299036.rar

3.89 KB, 下载次数: 0

售价: 1 金钱  [记录]  [购买]

20208231003299036.rar

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则