股资源-股票学习站-学炒股-股票课程-炒股教程-分析选股指标-入门基础知识

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[同花顺] 同花顺MACD背离图案副图指标 源码


    [-----复制链接-----]
楼主
 通达信源码安装路径:1,工具栏点击公式选项。2,弹出公式窗口点击新建。3,把源码复制到指标编辑器保存。4,回到K线图界面安装建立好的公式 || 2024-3-29 17:42:50
同花顺MACD背离图案副图指标 源码介绍

同花顺MACD背离图案副图指标 源码

用法同macd
MACD指标说明
MACD指数平滑异同移动平均线为两条长、短的平滑平均线。
其买卖原则为:
1.DIFF、DEA均为正,DIFF向上突破DEA,买入信号参考。
2.DIFF、DEA均为负,DIFF向下跌破DEA,卖出信号参考。
3.DEA线与K线发生背离,行情可能出现反转信号。
4.分析MACD柱状线,由红变绿(正变负),卖出信号参考;由绿变红,买入信号参考。

N:=21;M:=11;
DIFF1:=EMA(CLOSE,12)-EMA(CLOSE,27);
DEA1:=EMA(DIFF1,9);
MACD:=2*(DIFF1-DEA1),STICK;
DRAWBAND(DIFF1,RGB(200,50,55),DEA1,RGB(0,100,50));
DIFF:DIFF1,COLOR33FF33;
DEA:DEA1,coloryellow;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,0.9,0),COLORFF8B00;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,0.3,0),COLORFFAB00;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,0.9,0),COLOR0000DD;
STICKLINE(MACD>=REF(MACD,1)AND MACD>0,0,MACD,0.3,0),COLOR0000FF;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,0.9,0),COLORDDDDDD;
STICKLINE(MACD>REF(MACD,1)AND MACD<0,0,MACD,0.3,0),COLORFFFFFF;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,0.9,0),COLORFF8B00;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,0.3,0),COLORFFAB00;
STICKLINE(MACD>=0 OR MACD<=0,0,0,50,2),colorwhite;
金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
DRAWICON(金叉,DEA,23);
DRAWTEXT(金叉,DEA,' 低金'),coloryellow;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二金:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
DRAWICON(二金,DEA*1.04,13) ;
DRAWTEXT(二金,-0.1,' 二金'),COLORFF00FF;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),colorred,POINTDOT;
DRAWTEXT(底背离,-0.2,'底背'),colormagenta;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),colorgreen,POINTDOT;
DRAWTEXT(顶背离,DIFF,'顶背'),colorgreen;
AA:=REF(HHV(HIGH,N),1);
BB:=REF(LLV(LOW,N),1);
GG:=(AA+BB)/2;
TJ1:=(AA-BB)/GG<(M/100);
TJ2:=C>REF(HHV(HIGH,N),1);
XG:=TJ1 AND TJ2;
LB:=V/REF(V,1)>2;
W88:金叉 AND XG AND LB;
STICKLINE(W88,0,0.2,3,0),COLOR00FFFF;






gd46347

回复

举报

QQ|

GMT+8, 2024-11-18 03:29

快速回复 返回顶部 返回列表