通达信大行情牛启动副图 长短周期MACD改版 指标源码 附图
DIF:((EMA(CLOSE,48)-EMA(CLOSE,104))),COLORMAGENTA;
DEA:EMA(DIF,9),COLORGREEN;
MACD:=SMA((DIF-DEA)*10,100,1),COLORSTICK;
{DRAWICON(CROSS(DIF,DEA),DEA,1);
DRAWICON(CROSS(DEA,DIF),DIF,2);
0;}
IF(DIF>=REF(DIF,1),DIF,DRAWNULL),COLORMAGENTA;
IF(DEA>=REF(DEA,1),DEA,DRAWNULL),COLORMAGENTA;
IF(DIF<=REF(DIF,1),DIF,DRAWNULL),COLORGREEN;
IF(DEA<=REF(DEA,1),DEA,DRAWNULL),COLORGREEN;
DIF1:((EMA(CLOSE,14)-EMA(CLOSE,53))),COLORWHITE;
DEA1:EMA(DIF1,5),COLORYELLOW;
MACD1:=(DIF1-DEA1),COLORSTICK;
{DRAWICON(CROSS(DIF1,DEA1),DEA1,11);
DRAWICON(CROSS(DEA1,DIF1),DIF1,12);}
IF(DIF1>=REF(DIF1,1),DIF1,DRAWNULL),COLORYELLOW;
IF(DEA1>=REF(DEA1,1),DEA1,DRAWNULL),COLORYELLOW;
IF(DIF1<=REF(DIF1,1),DIF1,DRAWNULL),COLORGRAY;
IF(DEA1<=REF(DEA1,1),DEA1,DRAWNULL),COLORGRAY;
X_1:=MA(CLOSE,1);
DIF2:EMA(X_1,6)-EMA(X_1,13),COLORWHITE;
DEA2:EMA(DIF2,4),COLORWHITE;
{DRAWICON(CROSS(DIF2,DEA2),DEA2,38);
DRAWICON(CROSS(DEA2,DIF2),DIF2,39);}
MACD2:(DIF2-DEA2)*2,COLORSTICK;
IF(DIF2>=REF(DIF2,1),DIF2,DRAWNULL),COLORRED;
IF(DEA2>=REF(DEA2,1),DEA2,DRAWNULL),COLORRED;
IF(DIF2>=REF(DIF2,1) AND DIF2>0 AND DIF2<MACD2 AND MACD2>=REF(MACD2,1),DIF2,DRAWNULL),COLORYELLOW;
DIF3:=EMA(CLOSE,12)-EMA(CLOSE,25);
DEA3:=EMA(DIF3,5);
MACD3:=(DIF3-DEA3)*2;
MACD120:=REF(MACD3/2,BARSLAST(MACD3=HHV(MACD3,120))),COLORRED,LINETHICK2;
MACD250:=REF(MACD3/2,BARSLAST(MACD3=HHV(MACD3,250))),COLORWHITE,LINETHICK2;
XG:=NOT(REF(MACD120,1)=MACD120);
{STICKLINE(XG,0,MACD3,2,0),COLORYELLOW;
STICKLINE(MACD3>=MACD250,MACD250,MACD3,2,0),COLORMAGENTA;}
大行情:=NOT(REF(MACD120,1)=REF(MACD250,1)) AND MACD120=MACD250;
DRAWTEXT(大行情,0.5,'大牛启动'),COLORFF00FF;
DRAWICON(大行情,0.5,31);
STICKLINE(MACD1>MA(MACD1,5),MACD1,MA(MACD1,5),1,0),COLOR80FFFF;
DRAWICON(CROSS(DIF,DEA),DEA,1);
DRAWICON(CROSS(DIF1,DEA1),DEA1,11);
DRAWICON(CROSS(DIF2,DEA2),DEA2,38);
0;
涨跌停封单:=DYNAINFO(58)*C*100;
DRAWTEXT_FIX(1,0.02,0.06,0,'涨跌封单'),COLORRED;
DRAWNUMBER_FIX(1,0.07,0.06,0,CONST(涨跌停封单)),COLORRED;
封单比:=涨跌停封单/FINANCE(7)*100;
DRAWTEXT_FIX(1,0.02,0.24,0,'封 单 比'),COLORGREEN;
DRAWNUMBER_FIX(1,0.07,0.24,0,CONST(封单比)),COLORGREEN;
未来函数检测结果如下:
该公式包含未来函数:DYNAINFO
该公式包含未来函数:FINANCE
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
输出DIF:((收盘价的48日指数移动平均-收盘价的104日指数移动平均)),画洋红色
输出DEA:DIF的9日指数移动平均,画绿色
MACD赋值:SMA((DIF-DEA)*10,100,1),COLORSTICK
{DRAWICON(DIF上穿DEA,DEA,1)
DRAWICON(DEA上穿DIF,DIF,2)
0
}
IF(DIF>=1日前的DIF,DIF,DRAWNULL),画洋红色
IF(DEA>=1日前的DEA,DEA,DRAWNULL),画洋红色
IF(DIF<=1日前的DIF,DIF,DRAWNULL),画绿色
IF(DEA<=1日前的DEA,DEA,DRAWNULL),画绿色
DIF1:((收盘价的14日指数移动平均-收盘价的53日指数移动平均)),画白色
DEA1:DIF1的5日指数移动平均,画黄色
MACD1:=(DIF1-DEA1),COLORSTICK
{DRAWICON(DIF1上穿DEA1,DEA1,11)
DRAWICON(DEA1上穿DIF1,DIF1,12)
}
IF(DIF1>=1日前的DIF1,DIF1,DRAWNULL),画黄色
IF(DEA1>=1日前的DEA1,DEA1,DRAWNULL),画黄色
IF(DIF1<=1日前的DIF1,DIF1,DRAWNULL),COLORGRAY
IF(DEA1<=1日前的DEA1,DEA1,DRAWNULL),COLORGRAY
X_1赋值:收盘价的1日简单移动平均
DIF2:X_1的6日指数移动平均-X_1的13日指数移动平均,画白色
DEA2:DIF2的4日指数移动平均,画白色
{DRAWICON(DIF2上穿DEA2,DEA2,38)
DRAWICON(DEA2上穿DIF2,DIF2,39)
}
MACD2:(DIF2-DEA2)*2,COLORSTICK
IF(DIF2>=1日前的DIF2,DIF2,DRAWNULL),画红色
IF(DEA2>=1日前的DEA2,DEA2,DRAWNULL),画红色
IF(DIF2>=1日前的DIF2 AND DIF2>0 AND DIF2=1日前的MACD2,DIF2,DRAWNULL),画黄色
DIF3:=收盘价的12日指数移动平均-收盘价的25日指数移动平均
DEA3:=DIF3的5日指数移动平均
MACD3:=(DIF3-DEA3)*2
MACD120:=REF(MACD3/2,上次MACD3=120日内MACD3最高值距今天数),画红色, 线宽为2
MACD250:=REF(MACD3/2,上次MACD3=250日内MACD3最高值距今天数),画白色, 线宽为2
XG赋值:NOT(1日前的MACD120=MACD120)
当满足条件XG时,在0和MACD3之间画柱状线
当满足条件MACD3>=MACD250时,在MACD250和MACD3之间画柱状线
}
大行情赋值:NOT(1日前的MACD120=1日前的MACD250) AND MACD120=MACD250
当满足条件大行情时,在0.5和'大牛启动'位置书写文字
当满足条件大行情时,在0.5和31之间画图标
STICKLINE(MACD1>CD1的5日简单移动平均,MACD1,CD1的5日简单移动平均,1,0),COLOR80FFFF
DRAWICON(DIF上穿DEA,DEA,1)
DRAWICON(DIF1上穿DEA1,DEA1,11)
DRAWICON(DIF2上穿DEA2,DEA2,38)
0
涨跌停封单赋值:DYNAINFO(58)*C*100
当满足条件1时,在横轴0.02纵轴0.06位置书写文字
DRAWNUMBER_FIX(1,0.07,0.06,0,CONST(涨跌停封单)),画红色
封单比赋值:涨跌停封单/FINANCE(7)*100
当满足条件1时,在横轴0.02纵轴0.24位置书写文字
DRAWNUMBER_FIX(1,0.07,0.24,0,CONST(封单比)),画绿色