MACD底背离过滤 指标 公式 源码[同花顺公式]
指标公式代码分析及使用说明:
这段代码是一个股票技术指标的计算和绘图函数。具体分析指标如下:
1. MACD指标:通过计算收盘价的短期(12日)指数移动平均和长期(26日)指数移动平均的差异,再计算差异的加权移动平均来得到MACD值。MACD底背离用于判断股票价格的短期下跌趋势可能结束,可以考虑买入。
2. KDJ指标:通过计算最高价、最低价和收盘价的关系来判断买入卖出的时机。K值代表最近N日内收盘价与最低价之间的相对位置,D值代表K值的M1天简单移动平均,J值则是3倍的K值减去2倍的D值。
3. 量价指标:通过计算成交量和金额的移动均值来判断市场资金流向。计算资金与成交量的比例,然后将收盘价与资金比例之差除以资金比例再乘以100得到提纯指标。上涨分界为25,可作为股票上涨的参考阈值。
综合利用这些指标可以进行技术分析,提示买入和卖出的时机。但需要注意,技术指标只是辅助工具,不能单独作为投资决策的依据,还需结合其他因素进行综合分析。建议在实际使用时,根据个人的投资策略和风险偏好进行灵活运用。
源码:
DRAWGBK(OPEN>0,RGB(0,0,250),RGB(0,0,0),0,'02',0);
DIFF:= EMA(DCLOSE,12)-EMA(DCLOSE,26);
DEA:= EMA(DIFF,9),COLORFFFF00;
MACD:= (DIFF-DEA)*2;
A1: BARSLAST(DIFF<REF(DIFF,1)),COLOR00FFFF,LINETHICK1;
A11: A1*-1,COLOR00FFFF,LINETHICK1;
A2: BARSLAST(DEA<REF(DEA,1)),colorred,LINETHICK1;
A22: A2*-1,colorred,LINETHICK1;
DRAWBAND(A2,RGB(150,50,20),A1,RGB(150,100,150));
DRAWBAND(A22,RGB(150,100,150),A11,RGB(150,50,20));
STICKLINE(CROSS(DIFF,DEA) AND DIFF<0,A11,0,2,0),colorred;
STICKLINE(CROSS(DIFF,DEA) AND DIFF>0,0,A1,2,0),colorred;
STICKLINE(CROSS(DEA,DIFF) AND DIFF<0,A11,0,2,0),colorblue;
STICKLINE(CROSS(DEA,DIFF) AND DIFF>0,0,A1,2,0),colorblue;
MACD底背离:
STICKLINE(REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA),-25,25,0.00001,0),coloryellow;
STICKLINE(A1>0 AND A2>0,A2,A1,0.00001,0),COLORFFFFFF;
STICKLINE(A1>0 AND A2>0,A22,A11,0.00001,0),COLORFFFFFF;
STICKLINE(A1>0 AND A2>0,0,A1,0.000001,0),COLORFF00FF;
STICKLINE(A1>0 AND A2>0,0,A11,0.000001,0),COLORGREEN;//http://www.cxh99.com
DRAWTEXT(CROSS(DIFF,DEA) AND DIFF<0,-5,'〇'),colorcyan;
DRAWTEXT(CROSS(DIFF,DEA) AND DIFF<0,-12,'〇'),colorcyan;
DRAWTEXT(CROSS(DIFF,DEA) AND DIFF>0,5,'〇'),COLORGREEN;//http://www.cxh99.com
DRAWTEXT(CROSS(DIFF,DEA) AND DIFF>0,12,'〇'),COLORGREEN;//http://www.cxh99.com
DRAWTEXT(A2>A1 AND A22<A11 AND A1=0 AND A11=0,A2,'∈'),COLORGREEN;//http://www.cxh99.com
DRAWTEXT(A2>A1 AND A22<A11 AND A1=0 AND A11=0,0,'∈'),COLORGREEN;//http://www.cxh99.com
DRAWTEXT(A2>A1 AND A22<A11 AND A1=0 AND A11=0,A22,'∈'),COLORGREEN;//http://www.cxh99.com
STICKLINE(CROSS(DIFF,DEA) AND DIFF<0,A11,0,2,0),colorred;
STICKLINE(CROSS(DIFF,DEA) AND DIFF>0,0,A1,2,0),colorred;
STICKLINE(CROSS(DEA,DIFF) AND DIFF<0,A11,0,2,0),colorblue;
STICKLINE(CROSS(DEA,DIFF) AND DIFF>0,0,A1,2,0),colorblue;
N:=5;M1:=5;//www.cxh99.com
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K:=SMA(RSV,5,1);
D:=SMA(K,M1,5);
J:=3*K-2*D;
CXHB2:=(RSV/2+22)*1;
量:=EMA(VOL,13);
资金:=EMA(AMOUNT,13);
过滤:=((资金 /量) / 100);
提纯:=(((CLOSE -过滤) / 过滤) * 100);
上涨分界:=25;
公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程】
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容