一个特好的MACD指标
STICKLINE(C>0,0,0.002,15,0),colorgreen;
DIFF :=EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA : EMA(DIFF,M);
MACD :=2*(DIFF-DEA/2);
MAMACD:=MA(MACD,5);
STICKLINE(MAMACD>=1*REF(DIFF , 1),MAMACD,0, 1, 0),COLORF000DF;
STICKLINE(MAMACD<=1*REF(DEA , 1), MAMACD, 0,1, 0),COLORFFAC00;
STICKLINE(DIFF>=1*REF(DIFF , 1), DIFF,0,1, 0),COLORF000DF;
STICKLINE(DIFF<=1*REF(DIFF , 1), DIFF,0,1, 0),COLORFFAC00;
STICKLINE(MAMACD>1*REF(MAMACD, 1), MAMACD, MACD , 8,1),colorred;
STICKLINE(MAMACD<1*REF(MAMACD, 1), MAMACD, MACD ,8, 1),color00ff00;
//STICKLINE(MAMACD<1*REF(MAMACD, 1) AND MACD >1*REF(MACD , 1), MAMACD, MACD , 8, 0),colorred;
//STICKLINE(MACD>0,0,0.002,15,0),colorred;
PARTLINE(DIFF,DIFF>REF(DIFF,1),RGB(255,255,0),DIFF<REF(DIFF,1),RGB(0,255,0)),linethick1;
PARTLINE(DEA,DEA>REF(DEA,1),RGB(211,0,0),DEA<REF(DEA,1),RGB(0,255,0)),linethick2;
买线:=DIFF ;
卖线:=DEA;
买卖差:=买线-卖线;
STICKLINE(买卖差>=0,(买线-买卖差*0.05),(买线-买卖差*0.15),8,0),COLOR00ffff;
STICKLINE(买卖差>=0,(买线-买卖差*0.2),(买线-买卖差*0.35),8,0),COLOR00ccff;
STICKLINE(买卖差>=0,(买线-买卖差*0.4),(买线-买卖差*0.55),8,0),COLOR0099ff;
STICKLINE(买卖差>=0,(买线-买卖差*0.6),(买线-买卖差*0.75),8,0),COLOR0066ff;
STICKLINE(买卖差>=0,(买线-买卖差*0.8),(买线-买卖差*0.95),8,0),COLOR0000cc;
STICKLINE(买卖差<0,(卖线+买卖差*0.05),(卖线+买卖差*0.15),8,0),COLOR006600;
STICKLINE(买卖差<0,(卖线+买卖差*0.2),(卖线+买卖差*0.35),8,0),COLOR009900;
STICKLINE(买卖差<0,(卖线+买卖差*0.4),(卖线+买卖差*0.55),8,0),COLOR00cc00;
STICKLINE(买卖差<0,(卖线+买卖差*0.6),(卖线+买卖差*0.75),8,0),COLOR00ff00;
STICKLINE(买卖差<0,(卖线+买卖差*0.8),(卖线+买卖差*0.95),8,0),COLOR66ff00;
STICKLINE(MACD>=REF(MACD,1),MACD,MACD,5,0),colormagenta,LINETHICK3,POINTDOT;
STICKLINE(MACD<=REF(MACD,1),MACD,MACD,5,0),colorgreen,LINETHICK3,POINTDOT;
参数 DEA----采样点---线宽3
来函数检测结果如下:
该公式没有未来函数
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
当满足条件C>0时,在0和0.002之间画柱状线
DIFF :=收盘价的SHORT日指数移动平均 - 收盘价的LONG日指数移动平均
DEA : DIFF的M日指数移动平均
MACD :=2*(DIFF-DEA/2)
MAMACD赋值:CD的5日简单移动平均
STICKLINE(MAMACD>=1* 1日前的DIFF ,MAMACD,0, 1, 0),COLORF000DF
STICKLINE(MAMACD<=1* 1日前的DEA , MAMACD, 0,1, 0),COLORFFAC00
STICKLINE(DIFF>=1* 1日前的DIFF , DIFF,0,1, 0),COLORF000DF
STICKLINE(DIFF<=1* 1日前的DIFF , DIFF,0,1, 0),COLORFFAC00
STICKLINE(MAMACD>1* 1日前的MAMACD, MAMACD, MACD , 8,1),画红色
STICKLINE(MAMACD<1* 1日前的MAMACD, MAMACD, MACD ,8, 1),COLOR00FF00
//STICKLINE(MAMACD<1* 1日前的MAMACD AND MACD >1* 1日前的MACD , MAMACD, MACD , 8, 0),画红色
当满足条件MACD>0时,在0和0.002之间画柱状线
PARTLINE(DIFF,DIFF>1日前的DIFF,RGB(255,255,0),DIFF<1日前的DIFF,RGB(0,255,0)),LINETHICK1
PARTLINE(DEA,DEA>1日前的DEA,RGB(211,0,0),DEA<1日前的DEA,RGB(0,255,0)), 线宽为2
买线赋值:DIFF
卖线赋值:DEA
买卖差赋值:买线-卖线
STICKLINE(买卖差>=0,(买线-买卖差*0.05),(买线-买卖差*0.15),8,0),COLOR00FFFF
STICKLINE(买卖差>=0,(买线-买卖差*0.2),(买线-买卖差*0.35),8,0),COLOR00CCFF
STICKLINE(买卖差>=0,(买线-买卖差*0.4),(买线-买卖差*0.55),8,0),COLOR0099FF
STICKLINE(买卖差>=0,(买线-买卖差*0.6),(买线-买卖差*0.75),8,0),COLOR0066FF
STICKLINE(买卖差>=0,(买线-买卖差*0.8),(买线-买卖差*0.95),8,0),COLOR0000CC
STICKLINE(买卖差<0,(卖线+买卖差*0.05),(卖线+买卖差*0.15),8,0),COLOR006600
STICKLINE(买卖差<0,(卖线+买卖差*0.2),(卖线+买卖差*0.35),8,0),COLOR009900
STICKLINE(买卖差<0,(卖线+买卖差*0.4),(卖线+买卖差*0.55),8,0),COLOR00CC00
STICKLINE(买卖差<0,(卖线+买卖差*0.6),(卖线+买卖差*0.75),8,0),COLOR00FF00
STICKLINE(买卖差<0,(卖线+买卖差*0.8),(卖线+买卖差*0.95),8,0),COLOR66FF00
STICKLINE(MACD>=1日前的MACD,MACD,MACD,5,0),画洋红色, 线宽为3,POINTDOT
STICKLINE(MACD<=1日前的MACD,MACD,MACD,5,0),画绿色, 线宽为3,POINTDOT
参数 DEA----采样点---线宽3