在波段操作时,总是希望在一个副图上看到更多的趋势变化和转折点的多种信号出现,以便验证和判断。本指标组合了五种波段的强弱趋势和转折信号,在一个副图上用不同的图形和适当的色彩来表达趋势及转折信号的共振。通过图形的对比,顶底部和趋势的变化一目了然:(不含未来函数)
C/C++ www.gszb.com 股票公式指标网提供 Code复制内容到剪贴板
- {五线波段}{通达信版副图}
- {坐标线位置:0;20;30;50;80;90;100;}
- {额外Y轴:0;20;50}
- STICKLINE(C>0,20,100,10,0),COLOR95AA95;
- STICKLINE(C>0,80,80,10,0),COLORCC55CC;
- STICKLINE(C>0,90,90,10,0),COLORCC55CC;
- STICKLINE(C>0,20,30,10,0),COLOR557575;
- 强弱分界:50,COLORLIRED,NODRAW;
- {信号灯}
- SAR1:=(CLOSE+HIGH+LOW)/3;
- SAR2:=EMA(SAR1,10);
- SAR3:=REF(SAR2,1);
- 绿等待:IF(SAR2,99,DRAWNULL),COLOR00DD00,LINETHICK5;
- 黄买: IF(SAR2>SAR3,99,DRAWNULL), COLOR00DDDD,LINETHICK5;
- 蓝卖: IF(SAR2<SAR3,99,DRAWNULL),COLORDD0000,LINETHICK5;
- {波段强弱}
- ZC:=(100 - ((90 * (HHV(HIGH,14) - CLOSE)) / (HHV(HIGH,14) - LLV(LOW,14))))
- COLOR00DDDD;
- DRAWBAND(ZC,RGB(100,15,55),50,RGB(0,100,50));
- {中线波段}
- VAR0:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*100;
- VARA:=SMA(VAR0,3,1);
- VAR1:=SMA(VARA,4,1)-10;
- STICKLINE(REF(VAR1,1)<VAR1,VAR1,REF(VAR1,1),5,0),COLOR0055FF;
- STICKLINE(REF(VAR1,1)>VAR1,VAR1,REF(VAR1,1),5,1),COLOR007500;
- {趋势顶底判断}
- A4:=SMA((HHV(H,9)-C)/(HHV(H,9)-LLV(LOW,9))*100-70,9,1)+100;
- A5:=(C-LLV(L,9))/(HHV(H,9)- LLV(L,9))*100;
- A6:=SMA(SMA(A5,3,1),3,1)+100;
- A7:=(A6-A4)/1.5+10;
- 趋势:A7,COLOR00AAFF,NODRAW;
- 趋势底线:=EMA(趋势,5),COLORGREEN;
- STICKLINE(趋势>趋势底线,趋势,趋势底线,0.1,0),COLOR0099FF;
- STICKLINE(趋势<=趋势底线,趋势,趋势底线,0.1,-1),COLOR95AA00;
- 趋势金叉:IF(CROSS(趋势,趋势底线),趋势,DRAWNULL),CIRCLEDOT,COLORFF33FF;
- 趋势死叉:IF(CROSS(趋势底线,趋势),趋势,DRAWNULL),CIRCLEDOT,COLOR66FF00;
- TV1:=趋势;
- TV2:=趋势底线;
- TV3:=BARSLAST(REF(CROSS(TV1,TV2),1));
- TV3A:=REF(CLOSE,TV3+1)>CLOSE AND TV1>REF(TV1,TV3+1) AND
- CROSS(TV1,TV2);
- 趋势底背离:IF(TV3A,TV1,DRAWNULL),CIRCLEDOT,LINETHICK3,COLORFF00FF;
- TV4:=BARSLAST(REF(CROSS(TV2,TV1),1));
- TV4A:=REF(CLOSE,TV4+1)<CLOSE AND REF(TV1,TV4+1)>TV1 AND
- CROSS(TV2,TV1);
- 趋势顶背离:IF(TV4A,TV1,DRAWNULL),CIRCLEDOT,LINETHICK3,COLORFF6600;
- {KD}
- SSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
- K:SMA(SSV,3,1),LINETHICK2,COLOR0033FF;
- D:=SMA(K,3,1);
- K弱:IF(K<=REF(K,1),K,DRAWNULL),LINETHICK2,COLORDDDD00;
- KD金叉:IF(CROSS(K,D),K,DRAWNULL),CIRCLEDOT,COLOR0000FF;
- KD死叉:IF(CROSS(D,K),K,DRAWNULL),CIRCLEDOT,COLORFF0000;