副图指标:春江花月夜买卖点俱全
DI:=EMA(C,3)-EMA(C,13);
DE:=EMA(DI,9);
MACD1:=2*(DI-DE)*10;
DI2:=EMA(C,5)-EMA(C,26);
DEA2:=EMA(DI2,9);
MACD2:=2*(DI2-DEA2)*10;
DIFF3:=EMA(C,7)-EMA(C,89);
DEA3:=EMA(DIFF3,21);
MACD3:=2*(DIFF3-DEA3)*10;
MMACD5:=MA(MACD3,3);
M3:=IF(MACD3<0,-MACD3,DRAWNULL)LINETHICK4,COLOR646400;
M2:=IF(MACD2<0,-MACD2,DRAWNULL)LINETHICK4,COLOR333333;
M1:=IF(MACD1<0,-MACD1,DRAWNULL);
MM3:=IF(MACD3>0,MACD3,DRAWNULL);
MN1:=HHV(MM3,250);
MN2:=HHV(M3,250);
MMM:=CONST(MAX(MN1,MN2));
DRAWBAND(MMM,RGB(50,80,50),-MMM,DRAWNULL);
DRAWBAND(MMM,RGB(150,150,150),0,DRAWNULL);
DRAWBAND(M3,RGB(00,100,100),0,DRAWNULL);
DRAWBAND(M2,RGB(100,100,100),0,DRAWNULL);
DRAWBAND(M1,RGB(80,80,00),0,DRAWNULL);
DRAWBAND(MM3,RGB(0,200,0),0,DRAWNULL);
STICKLINE(MACD2>=0,0,MACD2,4,0),COLOR009900;
STICKLINE(MACD1>=0,0,MACD1,4,0),COLOR006600;
MM:=-M3*0.3;{}
DRAWBAND(0,RGB(0,0,0),-MM3*0.3,DRAWNULL);
DRAWBAND(0,RGB(0,0,0),MM,DRAWNULL);
IF(MACD3>0,-3,DRAWNULL),COLORFFFF00,POINTDOT;
IF(C>0,-2,-2),COLORFFFF00,POINTDOT;
小花买入:IF(MACD1>=0 AND REF(MACD1,1)<0,1,DRAWNULL),CROSSDOT,LINETHICK6,COLORFF33FF;
IF(MACD1>=0 AND REF(MACD1,1)<0,1,DRAWNULL),POINTDOT,LINETHICK4,COLOR00CCFF;
白帆买入:STICKLINE(CROSS(MACD3,MMACD5) AND MACD3<0,MACD3*1.1,MACD3*1.1-0.5,16,0),COLORLIRED;
STICKLINE(CROSS(MACD3,MMACD5) AND MACD3<0,MACD3*1.1+4,MACD3*1.1+0.3,5,0),COLORWHITE;
春雪卖出:IF(CROSS(MMACD5,MACD3) AND MACD3>0,MACD3*1.2,DRAWNULL),
CROSSDOT, LINETHICK2,COLORFFFFFF;
IF(CROSS(MMACD5,MACD3) AND MACD3<0,MACD3*0.8,DRAWNULL),CROSSDOT, LINETHICK2,COLORCCCCCC;
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
DI赋值:C的3日指数移动平均-C的13日指数移动平均
DE赋值:DI的9日指数移动平均
MACD1赋值:2*(DI-DE)*10
DI2:=C的5日指数移动平均-C的26日指数移动平均
DEA2:=DI2的9日指数移动平均
MACD2赋值:2*(DI2-DEA2)*10
DIFF3:=C的7日指数移动平均-C的89日指数移动平均
DEA3:=DIFF3的21日指数移动平均
MACD3赋值:2*(DIFF3-DEA3)*10
MMACD5赋值:CD3的3日简单移动平均
如果MACD3<0返回-MACD3否则返回DRAWNULL
如果MACD2<0返回-MACD2否则返回DRAWNULL
如果MACD1<0返回-MACD1否则返回DRAWNULL
如果MACD3>0返回MACD3否则返回DRAWNULL
MN1赋值:250日内MM3最高值
MN2赋值:250日内M3最高值
MMM赋值:CONST(MN1和MN2较大值)
DRAWBAND(MMM,RGB(50,80,50),-MMM,DRAWNULL)
DRAWBAND(MMM,RGB(150,150,150),0,DRAWNULL)
DRAWBAND(M3,RGB(00,100,100),0,DRAWNULL)
DRAWBAND(M2,RGB(100,100,100),0,DRAWNULL)
DRAWBAND(M1,RGB(80,80,00),0,DRAWNULL)
DRAWBAND(MM3,RGB(0,200,0),0,DRAWNULL)
当满足条件MACD2>=0时,在0和MACD2之间画柱状线
当满足条件MACD1>=0时,在0和MACD1之间画柱状线
MM赋值:-M3*0.3
{}
DRAWBAND(0,RGB(0,0,0),-MM3*0.3,DRAWNULL)
DRAWBAND(0,RGB(0,0,0),MM,DRAWNULL)
如果MACD3>0返回-3否则返回DRAWNULL
如果C>0返回-2否则返回-2
输出
小花买入:IF(MACD1>=0 AND 1日前的MACD1<0,1,DRAWNULL),CROSSDOT,LINETHICK6,COLORFF33FF
IF(MACD1>=0 AND 1日前的MACD1<0,1,DRAWNULL),POINTDOT,LINETHICK4,COLOR00CCFF
输出
白帆买入:STICKLINE(MACD3上穿MMACD5 AND MACD3<0,MACD3*1.1,MACD3*1.1-0.5,16,0),COLORLIRED
STICKLINE(MACD3上穿MMACD5 AND MACD3<0,MACD3*1.1+4,MACD3*1.1+0.3,5,0),画白色
输出
春雪卖出:IF(MMACD5上穿MACD3 AND MACD3>0,MACD3*1.2,DRAWNULL),
CROSSDOT, 线宽为2,COLORFFFFFF
IF(MMACD5上穿MACD3 AND MACD3<0,MACD3*0.8,DRAWNULL),CROSSDOT, 线宽为2,COLORCCCCCC