通达信精品指标棋盘法则公式
有朋友反应,部分个股无显示,那是因为其之字幅度或趋势角度与预设的相差较大,需要手工调整参数,下面的原码解决了角度的问题,-------为了更准确的看清趋势,还是应该微调角度调节,以达到最佳效果.
之字幅度的调节,那是必需的,因为这是找到最佳起点的关键,同时各个个股的涨跌幅相差太大,预设的参数就有可能大大超出了某个股的范围,所以遇到不显示的,就应该手工调节了.
{牛牛指标网提供:www.tdx001.com}
C/C++ Code复制内容到剪贴板
- {棋盘法则-------通达信用
-
- 人生如棋,股市何尝不是}
-
- 最低:=TROUGHBARS(L,之字幅度,1);{调整之字幅度找到低位起点}
- 最高:=BARSLAST(HHV(H,REFDATE(最低,DATE))=H);
- P:=横向调节;{调整竖线间隔}
- N:=最低;
- 数列:=INTPART(LOG((1/SQRT(5))*(POW((1+SQRT(5))/2,N)-POW((1-SQRT(5))/2,N)))/POW(N*P,1/5)),NODRAW;
-
- 低价:=REF(L,BARSLAST(最低=0));
- 高价:=CONST(HHV(H,最低))*1.01;
- 高位:=REFDATE(最高,DATE);
- 低价_:DRAWLINE(最低=0,L,ISLASTBAR,低价,0);
-
- 斜率:=角度调节*(高价-低价)/(最低-高位)/380;{角度调节以便把握趋势}
-
-
- 前高低:=HHV(H,最低+1)=H;{数4高}
- 统计:=CROSS(COUNT(前高低,最低)=4,0.5);
-
- KK:=BARSLAST(统计);
- DRAWTEXT(CURRBARSCOUNT=CONST(KK)+7,H*1.05,'起');
-
- DRAWTEXT(CURRBARSCOUNT=CONST(KK)+7,H,'点');
- PP:=IF(REF(C,BARSLAST(CROSS(COUNT(前高低,最低)=3,0.5)))>C,REF(C,BARSLAST(CROSS(COUNT(前高低,最低)=3,0.5))),H);
- 基线:=REF(PP,BARSLAST(统计)),NODRAW;
- 基差:=基线-低价,NODRAW;
-
- {横线加字}
- 一0:=低价+(基差*0.618*1*POW(1.1,1-1));
- 一:IF(CURRBARSCOUNT<=CONST(KK) AND 一0<=高价,一0
- ,DRAWNULL),POINTDOT,COLORAAAAAA;
- DRAWTEXT(CURRBARSCOUNT=CONST(KK)+5,CONST(一),'一'),COLORFFFFFF;
- 二0:=低价+(基差*0.618*2*POW(1.1,2-1));
- 二:IF(CURRBARSCOUNT<=CONST(KK) AND 二0<=高价,二0
- ,DRAWNULL),POINTDOT,COLORAAAAAA;
- DRAWTEXT(CURRBARSCOUNT=CONST(KK)+5,CONST(二),'二'),COLORFFFFFF;
- 三0:=低价+(基差*0.618*3*POW(1.1,3-1));
- 三:IF(CURRBARSCOUNT<=CONST(KK) AND 三0<=高价,三0
- ,DRAWNULL),POINTDOT,COLORAAAAAA;
- DRAWTEXT(CURRBARSCOUNT=CONST(KK)+5,CONST(三),'三'),COLORFFFFFF;
- 四0:=低价+(基差*0.618*4*POW(1.1,4-1));
- 四:IF(CURRBARSCOUNT<=CONST(KK) AND 四0<=高价,四0
- ,DRAWNULL),POINTDOT,COLORAAAAAA;
- DRAWTEXT(CURRBARSCOUNT=CONST(KK)+5,CONST(四),'四'),COLORFFFFFF;
- 五0:=低价+(基差*0.618*5*POW(1.1,5-1));
- 五:IF(CURRBARSCOUNT<=CONST(KK) AND 五0<=高价,五0
- ,DRAWNULL),POINTDOT,COLORAAAAAA;
- DRAWTEXT(CURRBARSCOUNT=CONST(KK)+5,CONST(五),'五'),COLORFFFFFF;
- 六0:=低价+(基差*0.618*6*POW(1.1,6-1));
- 六:IF(CURRBARSCOUNT<=CONST(KK) AND 六0<=高价,六0
- ,DRAWNULL),POINTDOT,COLORAAAAAA;
- DRAWTEXT(CURRBARSCOUNT=CONST(KK)+5,CONST(六),'六'),COLORFFFFFF;
- 七0:=低价+(基差*0.618*7*POW(1.1,7-1));
- 七:IF(CURRBARSCOUNT<=CONST(KK) AND 七0<=高价,七0
- ,DRAWNULL),POINTDOT,COLORAAAAAA;
- DRAWTEXT(CURRBARSCOUNT=CONST(KK)+5,CONST(七),'七'),COLORFFFFFF;
- 八0:=低价+(基差*0.618*8*POW(1.1,8-1));
- 八:IF(CURRBARSCOUNT<=CONST(KK) AND 八0<=高价,八0
- ,DRAWNULL),POINTDOT,COLORAAAAAA;
- DRAWTEXT(CURRBARSCOUNT=CONST(KK)+5,CONST(八),'八'),COLORFFFFFF;
- 九0:=低价+(基差*0.618*9*POW(1.1,9-1));
- 九:IF(CURRBARSCOUNT<=CONST(KK) AND 九0<=高价,九0
- ,DRAWNULL),POINTDOT,COLORAAAAAA;
- DRAWTEXT(CURRBARSCOUNT=CONST(KK)+5,CONST(九),'九'),COLORFFFFFF;
- 十0:=低价+(基差*0.618*10*POW(1.1,10-1));
- 十:IF(CURRBARSCOUNT<=CONST(KK) AND 十0<=高价,十0
- ,DRAWNULL),POINTDOT,COLORAAAAAA;
- DRAWTEXT(CURRBARSCOUNT=CONST(KK)+5,CONST(十),'十'),COLORFFFFFF;
- II0:=低价+(基差*0.618*11*POW(1.1,11-1));
- II:IF(CURRBARSCOUNT<=CONST(KK) AND II0<=高价,II0
- ,DRAWNULL),POINTDOT,COLORAAAAAA;
-
- {竖线加字}
- STICKLINE(CURRBARSCOUNT<=CONST(KK) AND 数列!=REF(数列,1),低价,高价,0.00001,-1),COLORAAAAAA;
- DRAWTEXT(CURRBARSCOUNT=CONST(KK)+5,CONST(II),'II'),COLORFFFFFF;
- DRAWTEXT(CURRBARSCOUNT<=CONST(KK) AND 数列!=REF(数列,1)
- AND 数列=1 ,高价*0.98,'一'),COLORFFFF00;
- DRAWTEXT(CURRBARSCOUNT<=CONST(KK) AND 数列!=REF(数列,1)
- AND 数列=2 ,高价*0.98,'二'),COLORFFFF00;
- DRAWTEXT(CURRBARSCOUNT<=CONST(KK) AND 数列!=REF(数列,1)
- AND 数列=3 ,高价*0.98,'三'),COLORFFFF00;
- DRAWTEXT(CURRBARSCOUNT<=CONST(KK) AND 数列!=REF(数列,1)
- AND 数列=4 ,高价*0.98,'四'),COLORFFFF00;
- DRAWTEXT(CURRBARSCOUNT<=CONST(KK) AND 数列!=REF(数列,1)
- AND 数列=5 ,高价*0.98,'五'),COLORFFFF00;
- DRAWTEXT(CURRBARSCOUNT<=CONST(KK) AND 数列!=REF(数列,1)
- AND 数列=6 ,高价*0.98,'六'),COLORFFFF00;
- DRAWTEXT(CURRBARSCOUNT<=CONST(KK) AND 数列!=REF(数列,1)
- AND 数列=7 ,高价*0.98,'七'),COLORFFFF00;
- DRAWTEXT(CURRBARSCOUNT<=CONST(KK) AND 数列!=REF(数列,1)
- AND 数列=8 ,高价*0.98,'八'),COLORFFFF00;
- DRAWTEXT(CURRBARSCOUNT<=CONST(KK) AND 数列!=REF(数列,1)
- AND 数列=9 ,高价*0.98,'九'),COLORFFFF00;
- DRAWTEXT(CURRBARSCOUNT<=CONST(KK) AND 数列!=REF(数列,1)
- AND 数列=10 ,高价*0.98,'十'),COLORFFFF00;
- DRAWTEXT(CURRBARSCOUNT<=CONST(KK) AND 数列!=REF(数列,1)
- AND 数列=11 ,高价*0.98,'十一'),COLORFFFF00;
- DRAWTEXT(CURRBARSCOUNT<=CONST(KK) AND 数列!=REF(数列,1)
- AND 数列=12 ,高价*0.98,'十二'),COLORFFFF00;
-
-
- 斜线0:IF(低价_+CONST(斜率*5.000)*最低<=高价,低价_+CONST(斜率*5.000)*最低,DRAWNULL);
- 斜线1:IF(低价_+CONST(斜率*3.100)*最低<=高价,低价_+CONST(斜率*3.100)*最低,DRAWNULL);
- 斜线2:IF(低价_+CONST(斜率*2.000)*最低<=高价,低价_+CONST(斜率*2.000)*最低,DRAWNULL);
- 斜线3:IF(低价_+CONST(斜率*1.400)*最低<=高价,低价_+CONST(斜率*1.400)*最低,DRAWNULL);
- 斜线4:IF(低价_+CONST(斜率*1.000)*最低<=高价,低价_+CONST(斜率*1.000)*最低,DRAWNULL);
- 斜线5:IF(低价_+CONST(斜率*0.750)*最低<=高价,低价_+CONST(斜率*0.750)*最低,DRAWNULL);
- 斜线6:IF(低价_+CONST(斜率*0.500)*最低<=高价,低价_+CONST(斜率*0.500)*最低,DRAWNULL);
- 斜线7:IF(低价_+CONST(斜率*0.300)*最低<=高价,低价_+CONST(斜率*0.300)*最低,DRAWNULL);
- 斜线8:IF(低价_+CONST(斜率*0.100)*最低<=高价,低价_+CONST(斜率*0.100)*最低,DRAWNULL);
93100249.jpg
|