当前位置:分析家公式网 → 股票公式 → 同花顺公式 → 一键转帖:MACD主升浪指标(同花顺公式 幅图 源码 测试图)
软件名称:[B]MACD主升浪指标(同花顺公式 幅图 源码 测试图)[/B]
软件类型:国产软件
运行环境:Win10/Win9X/Win8/Win2000/WinXP/Win2003/Win7/
软件语言:简体中文
授权方式:免费版
软件大小:8.00 KB
官方主页:Home Page
更新时间:2022-11-01 00:07:15
软件简介:
MACD主升浪指标
MACD指标说明
MACD指数平滑异同移动平均线为两条长、短的平滑平均线。
其买卖原则为:
1.DIFF、DEA均为正,DIFF向上突破DEA,买入信号参考。
2.DIFF、DEA均为负,DIFF向下跌破DEA,卖出信号参考。
3.DEA线与K线发生背离,行情可能出现反转信号。
4.分析MACD柱状线,由红变绿(正变负),卖出信号参考;由绿变红,买入信号参考。
DIF:EMA(CLOSE,12) - EMA(CLOSE,26),colorwhite;
DEA:EMA(DIF,9),coloryellow;
MACD:=2*(DIF-DEA);
Zero : 0,colorred;
IF (DIF>DEA)
{
IF (DIF<0)STOCK:"建仓"; ELSE STOCK:"加仓";
}
ELSE
{
IF (DIF>0) STOCK:"减仓"; ELSE STOCK:"清仓";
}
DRAWICON(CROSS(DIF,0),DIF-0.02,1);//买点图标
DRAWICON(CROSS(DIF,DEA) AND DIF >0,DIF-0.02,1);//买点图标
DRAWICON(CROSS(0,DIF),DIF-0.02,2);//卖点图标
DRAWICON(CROSS(DEA,DIF) AND DIF>0,DIF-0.02,2);//卖点图标
FILLRGN(DIF,DEA,DIF>DEA AND DIF>0,RGB(255,255,0),DIF<DEA AND DIF<0,RGB(255,0,255));//面积图
FILLRGN(DIF,DEA,DIF>DEA AND DIF<0,RGB(255,255,255),DIF<DEA AND DIF>0,RGB(0,255,255));//面积图
DRAWGBK(DIF>0 ),colorblue;//蓝色上升趋势
DRAWGBK(DIF<0),colorblack;//黑色下降趋势
VERLINE(CROSS(DIF,0),0); //建仓垂直线
VERLINE(CROSS(0,DIF),0); //清仓垂直线
/***************************MACD背离算法***************************************************/
gj:=MAX(C,O);
STICKLINE(MACD>0 AND MACD>=REF(MACD,1),0,MACD,2,0),color0000ff;
STICKLINE(MACD>0 AND MACD<REF(MACD,1),0,MACD,2,0),colorffff00;
STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,2,0),colorff00ff;
STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,2,0),color00ff00;
L4:=LLV(gj,4);
jl:=(HHV(DIF,55)-LLV(DIF,55))/5;
gt:=DEA>REF(DEA,1) AND REF(DEA,1)<REF(DEA,2);
A1:=BARSLAST(REF(gt,1));
底背离:=REF(L4,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND gt;
DRAWLINE(A1=0,DEA,底背离,REF(DEA,A1),0),colorred,LINETHICK2;
DRAWLINE(底背离,DEA,底背离,REF(DEA,A1),0),colorred,LINETHICK2;
DRAWTEXT(底背离,REF(DEA,A1)*1.18,' 底背离'),colorred;
H4:=HHV(gj,4);
gt2:=DEA<REF(DEA,1) AND REF(DEA,1)>REF(DEA,2);
A2:=BARSLAST(REF(gt2,1));
顶背离:= REF(H4,A2+1)<H4 AND DIF<REF(DIF,A2+1) AND gt2;
DRAWLINE(A2=0 ,DEA,顶背离,REF(DEA,A2),0),colorgreen,LINETHICK2;
DRAWLINE(顶背离,DEA,顶背离,REF(DEA,A2),0),colorgreen,LINETHICK2;
DRAWTEXT(顶背离,REF(DEA,A2)*1.18,' 顶背离'),colorgreen;
A0:=DIF<0 AND DEA<0;
A11:=A0>REF(A0,1);
A3:=BARSLAST(A11);
A4:=COUNT(DEA>0 AND DIF >0,A3)=0;
A5:=CROSS(DIF ,DEA);
A6:=BARSLAST(A5);
A7:=REF(A6,A6+1)+A6;
A8:=(DIF+DEA)/2;
A9:=(HIGH+LOW)/2;
A10:=A5 AND A7<A3 AND A4 AND A8>REF(A8,A7) AND A9<REF(A9,A7) AND MACD>0;
DRAWTEXT(A10,DIF*0.95,'★金叉买入'),coloryellow;
//**************************************************************************************/
difF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
AAA:=REF(CLOSE,1);
BBB:=SMA(MAX(CLOSE-AAA,0),5,1)/SMA(ABS(CLOSE-AAA),5,1)*1000;
HHH:=BBB-LLV(BBB,10);
SS:=(MA(HHH,2)*3+HHH*13)/16;
短线买点:=IF(SS>13,MA(SS,2),SS)/6;
短线出击:IF(CROSS(短线买点,1) AND (短线买点<30),10,0),coloryellow,LINETHICK2;
总金额亿:AMOUNT/10000/10000,colorwhite,NODRAW;
VAR1:=AMOUNT/((HIGH-LOW)*2-ABS(CLOSE-OPEN));
流入亿:IF(CLOSE>OPEN,VAR1*(HIGH-LOW),IF(CLOSE<OPEN,VAR1*((HIGH-OPEN)+(CLOSE-LOW)),AMOUNT/2))/10000/10000,colorred,NODRAW;
流出亿:IF(CLOSE>OPEN,0-VAR1*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE<OPEN,0-VAR1*(HIGH-LOW),0-AMOUNT/2))/10000/10000,COLOR00FF00,NODRAW;
差额亿:流入亿+流出亿,colorwhite,NODRAW;
地域:DRAWTEXT_FIX(ISLASTBAR,0.78,0,1,BLOCK(2,1)),coloryellow;
所属行业:DRAWTEXT_FIX(ISLASTBAR,0.85,0,1,BLOCK(1,1)),coloryellow;
主概念:DRAWTEXT_FIX(ISLASTBAR,0.1,0,1,BLOCK(3,1)),colorred;
LC:=REF(CLOSE,1);
RSI5:=((SMA(MAX((CLOSE - LC),0),5,1) / SMA(ABS((CLOSE - LC)),5,1)) * 100);
TR1:=SUM(MAX(MAX((HIGH - LOW),ABS((HIGH - REF(CLOSE,1)))),ABS((LOW - REF(CLOSE,1)))),10);
HD:=(HIGH - REF(HIGH,1));
LD:=(REF(LOW,1) - LOW);
DMP:=SUM(IF(((HD > 0) AND (HD > LD)),HD,0),10);
DMM:=SUM(IF(((LD > 0) AND (LD > HD)),LD,0),10);
PDI:=((DMP * 100) / TR1);
MDI:=((DMM * 100) / TR1);
ADX:=MA(((ABS((MDI - PDI)) / (MDI + PDI)) * 100),5);
AV:=(RSI5 + ADX);
DXR:=(((ADX + REF(ADX,5)) / 2) + RSI5);
WR10:=((100 * (HHV(HIGH,10) - CLOSE)) / (HHV(HIGH,10) - LLV(LOW,10)));
NEWVOL:=(RSI5 - WR10);
最佳买入:=(AV + NEWVOL);
买入选股:IF(CROSS(最佳买入,0),4,0),STICK,COLOR00FFFF,LINETHICK2;
[url=http://www.70822.com/soft/sort013/sort036/down-164774.html]MACD主升浪指标(同花顺公式 幅图 源码 测试图)[/url]