当前位置:→ 公式网 > 大智慧公式 > 正文 ℃ 公式解密、改选股等业务 联系点击查看详情...
以下是标有周线月线金叉死叉的4色趋势MACD(无源码的请下载附件导入)
C/C++ www.gszb.com 股票公式指标网提供 Code复制内容到剪贴板
- {DIF:(EMA(CLOSE,12)-EMA(CLOSE,26))/EMA(CLOSE,26)*100;
- DEA:EMA(DIF,9);
- MACD:(DIF-DEA)*2,COLORSTICK;
- S1:10,COLORMAGENTA;
- S2:-10,COLORMAGENTA;}
- 0,color505050;
- DIFF:(EMA(CLOSE,short) - EMA(CLOSE,long))/EMA(CLOSE,26)*100,COLOrc0c0c0,LINETHICK1;
- {PARTLINE(DIFF,DIFF>=REF(DIFF,1),RGB(200,200,200),DIFF<REF(DIFF,1)
- ,RGB(0,170,80)),LINETHICK1;}
- DEA: EMA(DIFF,m),Coloryellow,LINETHICK1;
- MACD:= 2*(DIFF-DEA);
- {S1:5,COLORMAGENTA;
- S2:-5,COLORMAGENTA;}
- STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,2,0),COLOR009900;{ 深红}
- STICKLINE(MACD<ref(MACD,1)and MACD<0,0,MACD,2,0),colorff5500;{ 蓝}
- STICKLINE(MACD>ref(MACD,1)and MACD,0,MACD,2,0),color000066;{ 录}
- STICKLINE(MACD>ref(MACD,1)and MACD>0,0,MACD,2,0),COLOrred;{ 红}
- {周线金叉,死叉▲}
- AA:="MACD.DIFF#WEEK";
- BB:="MACD.DEA#WEEK";
- DRAWTEXT(CROSS(AA,BB),-1,'周'),ALIGN2,COLORyellow;
- DRAWTEXT(CROSS(BB,AA),-1,'周'),ALIGN2,COLORffaa00;
- {月线金叉,死叉★}
- CC:="MACD.DIFF#MONTH";
- DD:="MACD.DEA#MONTH";
- DRAWTEXT(CROSS(CC,DD),-1,'月'),ALIGN2,COLORyellow;
- DRAWTEXT(CROSS(DD,CC),-1,'月'),ALIGN2,COLORff00ff;