提前MACD(源码 主图/副图 通达信)

{提前MACD}
DIF:=(EMA(C,3)-EMA(L,30))/EMA(L,30)*600;
DEA:=EMA(DIF,7);
BC:=2*(DIF-DEA);
DQS:=3*DEA-2*DIF;
信号:DIF,COLORWHITE;
平滑:DEA,COLORYELLOW;
倍差:BC,COLORLIMAGENTA,NODRAW;
趋势:DQS,COLORCYAN,NODRAW;
BC1:=MA(BC,2);
BC2:=IF(WINNER(C*0.95)*100>50 AND COST(85)<C AND BC>=REF(BC,1),BC,DRAWNULL);
QSDT:=DIF>REF(DIF,1) AND DIF>0 AND BC>BC1 AND WINNER(C*0.95)*100>50 AND COST(85)<C,NODRAW;
高度控盘:BARSLAST(QSDT=0),COLORYELLOW,NODRAW;
{DRAWBAND(BC,RGB(250,250,0),MA(BC,2),RGB(0,200,250))};
STICKLINE(BC>0 AND BC>=REF(BC,1),0,BC,2.8,0),COLOR000055;
STICKLINE(BC>0 AND BC>=REF(BC,1),0,BC,2.6,0),COLOR000077;
STICKLINE(BC>0 AND BC>=REF(BC,1),0,BC,2.4,0),COLOR000099;
STICKLINE(BC>0 AND BC>=REF(BC,1),0,BC,2.2,0),COLOR0000BB;
STICKLINE(BC>0 AND BC>=REF(BC,1),0,BC,2.0,2),COLOR0000DD;
STICKLINE(BC>0 AND BC>=REF(BC,1),0,BC,1.0,0),COLOR0000FF;
STICKLINE(BC<0 AND BC<REF(BC,1),0,BC,2.8,0),COLORAA4400;
STICKLINE(BC<0 AND BC<REF(BC,1),0,BC,2.6,0),COLORBB5500;
STICKLINE(BC<0 AND BC<REF(BC,1),0,BC,2.4,0),COLORCC6600;
STICKLINE(BC<0 AND BC<REF(BC,1),0,BC,2.2,0),COLORDD7700;
STICKLINE(BC<0 AND BC<REF(BC,1),0,BC,2.0,2),COLOREE8800;
STICKLINE(BC<0 AND BC<REF(BC,1),0,BC,1.0,0),COLORFFBB00;
STICKLINE(BC>0 AND BC<REF(BC,1),0,BC,2.8,0),COLOR005500;
STICKLINE(BC>0 AND BC<REF(BC,1),0,BC,2.6,0),COLOR007700;
STICKLINE(BC>0 AND BC<REF(BC,1),0,BC,2.4,0),COLOR009900;
STICKLINE(BC>0 AND BC<REF(BC,1),0,BC,2.2,0),COLOR00BB00;
STICKLINE(BC>0 AND BC<REF(BC,1),0,BC,2.0,0),COLOR000000;
STICKLINE(BC>0 AND BC<REF(BC,1),0,BC,2.0,1),COLOR00DD00;
STICKLINE(BC>0 AND BC<REF(BC,1),0,BC,1.0,0),COLOR00FF00;
STICKLINE(BC<0 AND BC>=REF(BC,1),0,BC,2.8,0),COLORAA0044;
STICKLINE(BC<0 AND BC>=REF(BC,1),0,BC,2.6,0),COLORBB0055;
STICKLINE(BC<0 AND BC>=REF(BC,1),0,BC,2.4,0),COLORCC0066;
STICKLINE(BC<0 AND BC>=REF(BC,1),0,BC,2.2,0),COLORDD0077;
STICKLINE(BC<0 AND BC>=REF(BC,1),0,BC,2.0,2),COLOREE0088;
STICKLINE(BC<0 AND BC>=REF(BC,1),0,BC,1.0,0),COLORFF00BB;
STICKLINE(BC2,0,BC2,2.8,0),COLOR0044AA;
STICKLINE(BC2,0,BC2,2.6,0),COLOR0055BB;
STICKLINE(BC2,0,BC2,2.4,0),COLOR0066CC;
STICKLINE(BC2,0,BC2,2.2,0),COLOR0077DD;
STICKLINE(BC2,0,BC2,2.0,2),COLOR0088EE;
STICKLINE(BC2,0,BC2,1.0,0),COLOR00BBFF;
FG:=(DIF-DEA)/6;
PH1:=EMA(DIF,1);
PH2:=PH1-FG*1;
PH3:=PH1-FG*2;
PH4:=PH1-FG*3;
PH5:=PH1-FG*4;
PH6:=PH1-FG*5;
PH7:=EMA(DIF,7);
PH8:=IF(PH1<REF(PH1,1) AND PH1<PH7,PH1,DRAWNULL);
PH9:=IF(PH2<REF(PH2,1) AND PH2<PH7,PH2,DRAWNULL);
PH10:=IF(PH3<REF(PH3,1) AND PH3<PH7,PH3,DRAWNULL);
PH11:=IF(PH4<REF(PH4,1) AND PH4<PH7,PH4,DRAWNULL);
PH12:=IF(PH5<REF(PH5,1) AND PH5<PH7,PH5,DRAWNULL);
PH13:=IF(PH6<REF(PH6,1) AND PH6<PH7,PH6,DRAWNULL);
PH14:=IF(PH7<REF(PH7,1),PH7,DRAWNULL);
PH15:=IF(PH1>REF(PH1,1) AND PH1>PH7,PH1,DRAWNULL);
PH16:=IF(PH2>REF(PH2,1) AND PH2>PH7,PH2,DRAWNULL);
PH17:=IF(PH3>REF(PH3,1) AND PH3>PH7,PH3,DRAWNULL);
PH18:=IF(PH4>REF(PH4,1) AND PH4>PH7,PH4,DRAWNULL);
PH19:=IF(PH5>REF(PH5,1) AND PH5>PH7,PH5,DRAWNULL);
PH20:=IF(PH6>REF(PH6,1) AND PH6>PH7,PH6,DRAWNULL);
PH21:=IF(PH7>REF(PH7,1),PH7,DRAWNULL);
DRAWBAND(PH1,RGB(250,250,0),PH1,RGB(250,250,0));
DRAWBAND(PH2,RGB(250,250,0),PH2,RGB(250,250,0));
DRAWBAND(PH3,RGB(250,250,0),PH3,RGB(250,250,0));
DRAWBAND(PH4,RGB(250,250,0),PH4,RGB(250,250,0));
DRAWBAND(PH5,RGB(250,250,0),PH5,RGB(250,250,0));
DRAWBAND(PH6,RGB(250,250,0),PH6,RGB(250,250,0));
DRAWBAND(PH7,RGB(250,250,0),PH7,RGB(250,250,0));
DRAWBAND(PH8,RGB(0,250,0),PH8,RGB(0,250,0));
DRAWBAND(PH9,RGB(0,250,0),PH9,RGB(0,250,0));
DRAWBAND(PH10,RGB(0,250,0),PH10,RGB(0,250,0));
DRAWBAND(PH11,RGB(0,250,0),PH11,RGB(0,250,0));
DRAWBAND(PH12,RGB(0,250,0),PH12,RGB(0,250,0));
DRAWBAND(PH13,RGB(0,250,0),PH13,RGB(0,250,0));
DRAWBAND(PH14,RGB(0,250,0),PH14,RGB(0,250,0));
DRAWBAND(PH15,RGB(250,0,250),PH15,RGB(250,0,250));
DRAWBAND(PH16,RGB(250,0,250),PH16,RGB(250,0,250));
DRAWBAND(PH17,RGB(250,0,250),PH17,RGB(250,0,250));
DRAWBAND(PH18,RGB(250,0,250),PH18,RGB(250,0,250));
DRAWBAND(PH19,RGB(250,0,250),PH19,RGB(250,0,250));
DRAWBAND(PH20,RGB(250,0,250),PH20,RGB(250,0,250));
DRAWBAND(PH21,RGB(250,0,250),PH21,RGB(250,0,250));
NOTEXT:DQS,COLORCYAN;
DRAWICON(CROSS(DIF,DEA),DEA,42);
DRAWICON(CROSS(DEA,DIF),DEA,43);

---------------------------------

{MACD主图}
ZIF:=EMA(C,12)-EMA(C,26);
ZEA:=EMA(ZIF,9);
ZBC:=2*(ZIF-ZEA);
ZJS:=1.25*ZIF-0.25*ZEA;
ZXH:=(ZJS*13*27-27*11*EMA(C,12)+13*25*EMA(C,26))/28,COLORWHITE;
ZPH:=(ZIF*13*27-27*11*EMA(C,12)+13*25*EMA(C,26))/28,COLORYELLOW;
ZQS:=(ZEA*13*27-27*11*EMA(C,12)+13*25*EMA(C,26))/28,COLORCYAN;
ZNX:=(ZXH+ZQS)/2,COLORMAGENTA;
信号:ZXH,COLORFFFFFF,LINETHICK1;
平滑:ZPH,COLOR00FFFF,LINETHICK1;
牛熊:ZNX,COLORFF00FF,LINETHICK1;
趋势:ZQS,COLORFFFF00,LINETHICK1;
DRAWKLINE(H,O,L,C);




未来函数检测结果如下:
该公式包含未来函数:WINNER
该公式包含未来函数:COST
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式

联系我们  |  股票指标网  |  指标网   |  指标公式  |   加入收藏   |  设为主页

@2005-2023 粤ICP备2023063687号-2 股票指标网别名指标网仅为互联网文章,所有股票指标公式及文章仅供学习研究,并不构成投资建议,请勿以此为依据进行股票交易,由此引起的投资亏损与本站无关。股票指标网均来源互联网收集整理,如不慎侵犯了你的权益,请联系我们告知,我们将做删除处理
QQ:88652583 微信 88652583
sitemap站点地图