通达信四色谷峰主图指标公式

[复制链接]
查看62 | 回复0 | 2021-8-20 03:30:47 | 显示全部楼层 |阅读模式

以下是通达信四色谷峰主图指标公式(无源码的请下载附件导入)

零轴:DYNAINFO(3)*1,COLOR0000FF;
 XA1:=MA(CLOSE,20);
 XA2:=(CLOSE>MA(CLOSE,5));
 XA3:=(MA(CLOSE,5)>MA(CLOSE,10));
 XA4:=(CLOSE>MA(CLOSE,10));
 XA5:=(MA(CLOSE,5)>MA(CLOSE,20));
 XA6:=(CLOSE>MA(CLOSE,20));
 XA7:=REF(XA1,1);
 XA8:=(XA1>XA7);
 AVX:=(((((IF(XA2,10,(0 - 10)) + IF(XA3,10,(0 - 10))) + IF(XA4,10,(0 -10))) +
 IF(XA5,10,(0 - 10))) + IF(XA6,10,(0 - 10))) + IF(XA8,10,(0 -10)))/80;
 XFX:=AVX+零轴,COLOR00FFFF,LINETHICK1;
 DRAWBAND(XFX,RGB(160,0,0),零轴,RGB(0,90,90));
谷峰线:XFX,COLOR8A8A8A;
 N:=120;
 {指标修改QQ:984388831}
 K:=BARSLAST(CURRBARSCOUNT=N);
 GD:=CONST(IF(ISLASTBAR=1,HHV(H,K),0));{高点}
DD:=CONST(IF(ISLASTBAR=1,LLV(L,K),0));{低点}
KJ:=GD-DD;{高低点差值=分区高度}
GD4:IF(CURRBARSCOUNT<=N/30,GD,DRAWNULL); {设置分区的宽度,调整数据可调整分区宽度}
平衡:IF(CURRBARSCOUNT<=N/30,DD+KJ/2,DRAWNULL),COLOR00FFFF;{低点+中点=0.50线,NODRAW}
压力:IF(CURRBARSCOUNT<=N/30,GD-KJ*0.191,DRAWNULL),COLORFF00FF;{高点-分区高度*0.191=0.819线,NODRAW}
支撑:IF(CURRBARSCOUNT<=N/30,DD+KJ*0.191,DRAWNULL),COLOR00FF00;{低点+分区高度*0.191=0.191线,NODRAW}
高:IF(CURRBARSCOUNT<=N/30,GD,DRAWNULL),COLOR00FFFF;{高点划线,POINTDOT}
低:IF(CURRBARSCOUNT<=N/30,DD,DRAWNULL),COLOR00FF00;{低点划线,POINTDOT}
低涨:IF(CURRBARSCOUNT<=N/30,(C/LLV(LOW,K)-1)*100,DRAWNULL),COLOR0000FF,NODRAW;
天数:BARSLAST(L=DD),COLORCYAN,NODRAW;
 DRAWBAND(高,RGB(160,160,0),压力,RGB(0,0,0));
 DRAWBAND(压力,RGB(130,0,0),平衡,RGB(0,0,0));
 DRAWBAND(平衡,RGB(100,0,100),支撑,RGB(0,0,0));
 DRAWBAND(支撑,RGB(150,150,150),低,RGB(0,0,0));
 STICKLINE(CURRBARSCOUNT=N/30,GD,DD,0,0),COLORGREEN;{划左侧高低点边线}
STICKLINE(CURRBARSCOUNT=1,GD,DD,0,0),COLORGREEN;{划右侧高低点边线}
STICKLINE(CURRBARSCOUNT<=N/30,平衡,平衡,4,0),COLORWHITE;{划平衡线横线线}
STICKLINE(CURRBARSCOUNT<=N/30,压力,压力,4,0),COLORRED;{划压力线横线线}
STICKLINE(CURRBARSCOUNT<=N/30,支撑,支撑*0.997,4,0),COLORRED;{划支撑想横线线}
STICKLINE(CURRBARSCOUNT<=N/30,低,低,4,0),COLORGREEN;{划低位横线线}
N2:=5;
 A1:=REF(H,N2)=HHV(H,2*N2+1);
 B1:=FILTER(A1,N2);
 C1:=BACKSET(B1,N2+1);
 HD:= FILTER(C1,N2);
 RH:=BACKSET(CURRBARSCOUNT=2,BARSLAST(HD)+1);
 SH:=RH>REF(RH,1);
 H1:=REF(H ,BARSLAST(SH));
 STICKLINE(H1,H1,H1,5,0),LINETHICK2,COLOR00FFFF;
 DRAWTEXT(ISLASTBAR,H1*1.005,'近期高点'),COLORFFFF00;
 TTP:=(CURRBARSCOUNT=5-4);
 DRAWNUMBER(TTP AND H1,H1,H1),COLORFFFF00;
 A2:=REF(L,N2)=LLV(L,2*N2+1);
 B2:=FILTER(A2,N2);
 C2:=BACKSET(B2,N2+1);
 LD:=FILTER(C2,N2);
 RL:=BACKSET(CURRBARSCOUNT=2,BARSLAST(LD)+1);
 SL:=RL>REF(RL,1);
 L1:=REF(L ,BARSLAST(SL));
 STICKLINE(L1,L1,L1,5,0),COLORFFFF00,LINETHICK5;
 DRAWTEXT(ISLASTBAR,L1*1.005,'近期低点'),COLORFFFF00;
 DRAWNUMBER(TTP AND L1,L1,L1),COLOR00FFFF;
 AHX:=MA(C,3);
 BHX:=MA(C,14);
 EHX:=(AHX+BHX)/2;
当前价:=C,COLORFFFFFF;
市盈率:=IF(FINANCE(33)>0,DYNAINFO(39),0)*0.35;
每股收益:=IF(FINANCE(33)>0.01,FINANCE(33)*0.65,0);
 CKMJ:=每股收益*市盈率*4;
参考买价:STICKLINE(1,CKMJ,CKMJ*0.9983,5,0),COLOR00FF00;
 DRAWTEXT(ISLASTBAR,CKMJ*1.0054,'参考买价'),COLOR00FFFF;
 C11:=C>=CKMJ;
 C21:=C<CKMJ;
 AA:=C11>=C21 ;
 BB:=C21>C11 ;
 STICKLINE(AA,C,O,3.4,0),COLORAA00AA;
 STICKLINE(AA,C,O,3.0,0),COLORBB00BB ;
 STICKLINE(AA,C,O,2.0,0),COLORDD00DD ;
 STICKLINE(AA,C,O,1.6,0),COLOREE00EE;
 STICKLINE(AA,C,O,1.2,0),COLORFF00FF;
 STICKLINE(AA,C,O,0.6,0),COLORFF00FF;
 STICKLINE(AA,H,L,0,0),COLORFF00FF;
 STICKLINE(BB,C,O,3.4,0),COLORAAAA00;
 STICKLINE(BB,C,O,3.0,0),COLORBBBB00;
 STICKLINE(BB,C,O,1.6,0),COLOREEEE00;
 STICKLINE(BB,C,O,1.2,0),COLORFFFF00;
 STICKLINE(BB,C,O,0.6,0),COLORFFFF00;
 STICKLINE(BB,H,L,0,0),COLORFFFF00;
 TTP123:=(CURRBARSCOUNT=5-4);
 DRAWNUMBER(TTP123 AND CKMJ,CKMJ,CKMJ),COLORFFFF00;
 SJ:=WMA((C-LLV(L,5))/(HHV(H,5)-LLV(L,5))*100,2);
 ZJ:=WMA(0.667*REF(SJ,1)+0.333*SJ,2);
 DRAWTEXT(CROSS(SJ,ZJ) AND SJ<30,L-0.05,'←低吸'),COLOR00FF99,LINETHICK2;
 DRAWTEXT(CROSS(ZJ,SJ) AND SJ>70,H+0.05,'←高抛'),COLOR00FF00,LINETHICK2;
 DRAWTEXT(CURRBARSCOUNT=N/30+4,GD-KJ/12,'【风险区】--高抛避险'),COLOR00FFFF;
 DRAWTEXT(CURRBARSCOUNT=N/30+4,GD-KJ/3,'【警示区】--逢高减仓'),COLORFFFFFF;
 DRAWTEXT(CURRBARSCOUNT=N/30+4,DD+KJ/3,'【关注区】--逢低买入'),COLOR00FFFF;
 DRAWTEXT(CURRBARSCOUNT=N/30+4,DD+KJ/10,'【休整区】--养精畜锐'),COLOR00FF00;

64455111.png

64455111.png

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则