通達信牛金角線主圖看支撐與壓力指標公式
- 指標類別: 通達信指標公式
- 授權方式: 免費版
- 指標評級: ★★★★★
- 指標分類: 圖表
- 畫線方法: 主圖
- 日期:2024-09-13 來源:互聯網
通達信牛金角線主圖看支撐與壓力指標公式:
HDAY:=15;LDAY:=15;調點:=3;角度:=200;之字幅度:=25;橫向調節:=1;
局部低點預選A:=BACKSET(LLV(L,5) 局部低點預選B:=BACKSET(局部低點預選A=0 AND REF(局部低點預選A,1)=1,2);
局部低點預選C:=IF(局部低點預選B=1 AND REF(局部低點預選B,1)=0,-1,0);
局部高點預選A:=BACKSET(HHV(H,5)>REF(HHV(H,4),1),4);
局部高點預選B:=BACKSET(局部高點預選A=0 AND REF(局部高點預選A,1)=1,2);
局部高點預選C:=IF(局部高點預選B=1 AND REF(局部高點預選B,1)=0,1,0);
缺口判斷:=IF(L>REF(H,1),1,IF(H 距前高天:=BARSLAST(局部高點預選C=1);
距前低天:=BARSLAST(局部低點預選C=-1);
小值周期:=LOWRANGE(L);
大值周期:=TOPRANGE(H);
低保留AA:=IF(局部低點預選C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1) 低保留AB:=IF(局部低點預選C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判斷,距前高天)=-1 OR LLV(L,距前低天+2) 低保留S:=IF((低保留AA=-1 OR 低保留AB=-1) AND L 預判:=IF((距前低天<4 AND HHV(缺口判斷,距前低天)!=1) OR REF(低保留S,距前低天)=0,1,0);
判斷:=IF(局部高點預選C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND 預判=1 AND 大值周期>REF(小值周期,距前低天+1) AND 大值周期>REF(小值周期,距前低天) AND 大值周期>REF(大值周期,距前高天),1,0);
高保留A:=IF(局部高點預選C=1 AND REF(距前低天,1)>REF(距前高天,1) AND HHV(H,距前低天+1)>REF(HHV(H,距前低天+1),1),1,0);
高保留B:=IF(局部高點預選C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND REF(低保留S,距前低天)=-1 AND (距前低天>=4 OR HHV(缺口判斷,距前低天)=1),1,0);
高保留:=IF((高保留A=1 OR 高保留B=1 OR 判斷=1) AND H>REF(L,距前低天+1),1,0);
預判A:=IF((距前高天<4 AND HHV(缺口判斷,距前高天)!=1) OR REF(高保留,距前高天)=0,1,0);
判斷A:=IF(局部低點預選C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND 預判A=1 AND 小值周期>REF(大值周期,距前高天+1) AND 小值周期>REF(大值周期,距前高天) AND 小值周期>REF(小值周期,距前低天),-1,0);
低保留A:=IF(局部低點預選C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1) 低保留B:=IF(局部低點預選C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判斷,距前高天)=-1 OR 判斷A=-1),-1,0);
低保留:=IF((低保留A=-1 OR 低保留B=-1) AND L 距前高天A:=BARSLAST(高保留=1);
距前低天A:=BARSLAST(低保留=-1);
預判X:=IF((距前低天A<4 AND HHV(缺口判斷,距前低天A)!=1) OR REF(低保留,距前低天A)=0,1,0);
判斷X:=IF(局部高點預選C=1 AND REF(距前低天A,1)<=REF(距前高天A,1) AND 預判X=1 AND 大值周期>REF(小值周期,距前低天A+1) AND 大值周期>REF(小值周期,距前低天A) AND 大值周期>REF(大值周期,距前高天A),1,0);
高保留XA:=IF(局部高點預選C=1 AND REF(距前低天A,1)>REF(距前高天A,1) AND HHV(H,距前低天A+1)>REF(HHV(H,距前低天A+1),1),1,0);
高保留XB:=IF(局部高點預選C=1 AND REF(距前低天A,1)<=REF(距前高天A,1) AND REF(低保留,距前低天A)=-1 AND (距前低天A>=4 OR HHV(缺口判斷,距前低天A)=1),1,0);
高保留X:=IF((高保留XA=1 OR 高保留XB=1 OR 判斷X=1) AND H>REF(L,距前低天A+1),1,0);
預判XA:=IF((距前高天A<4 AND HHV(缺口判斷,距前高天A)!=1) OR REF(高保留XA,距前高天A)=0,1,0);
判斷XA:=IF(局部低點預選C=-1 AND REF(距前高天A,1)<=REF(距前低天A,1) AND 預判XA=1 AND 小值周期>REF(大值周期,距前高天A+1) AND 小值周期>REF(大值周期,距前高天A) AND 小值周期>REF(小值周期,距前低天A),-1,0);
低保留XA:=IF(局部低點預選C=-1 AND REF(距前高天A,1)>REF(距前低天A,1) AND LLV(L,距前高天A+1) 低保留XB:=IF(局部低點預選C=-1 AND REF(距前高天A,1)<=REF(距前低天A,1) AND (距前高天A>=4 OR LLV(缺口判斷,距前高天A)=-1 OR 判斷XA=-1),-1,0);
低保留X:=IF((低保留XA=-1 OR 低保留XB=-1) AND L 距前高天YA:=BARSLAST(高保留X=1);
距前低天YA:=BARSLAST(低保留X=-1);
預判YX:=IF((距前低天YA<4 AND HHV(缺口判斷,距前低天YA)!=1) OR REF(低保留X,距前低天YA)=0,1,0);
判斷YX:=IF(局部高點預選C=1 AND REF(距前低天YA,1)<=REF(距前高天YA,1) AND 預判YX=1 AND 大值周期>REF(小值周期,距前低天YA+1) AND 大值周期>REF(小值周期,距前低天YA) AND 大值周期>REF(大值周期,距前高天YA),1,0);
高保留YXA:=IF(局部高點預選C=1 AND REF(距前低天YA,1)>REF(距前高天YA,1) AND HHV(H,距前低天YA+1)>REF(HHV(H,距前低天YA+1),1),1,0);
高保留YXB:=IF(局部高點預選C=1 AND REF(距前低天YA,1)<=REF(距前高天YA,1) AND REF(低保留X,距前低天YA)=-1 AND (距前低天YA>=4 OR HHV(缺口判斷,距前低天YA)=1),1,0);
高保留YX:=IF((高保留YXA=1 OR 高保留YXB=1 OR 判斷YX=1) AND H>REF(L,距前低天YA+1),1,0);
預判YXA:=IF((距前高天YA<4 AND HHV(缺口判斷,距前高天YA)!=1) OR REF(高保留YXA,距前高天YA)=0,1,0);
判斷YXA:=IF(局部低點預選C=-1 AND REF(距前高天YA,1)<=REF(距前低天YA,1) AND 預判YXA=1 AND 小值周期>REF(大值周期,距前高天YA+1) AND 小值周期>REF(大值周期,距前高天YA) AND 小值周期>REF(小值周期,距前低天YA),-1,0);
低保留YXA:=IF(局部低點預選C=-1 AND REF(距前高天YA,1)>REF(距前低天YA,1) AND LLV(L,距前高天YA+1) 低保留YXB:=IF(局部低點預選C=-1 AND REF(距前高天YA,1)<=REF(距前低天YA,1) AND (距前高天YA>=4 OR LLV(缺口判斷,距前高天YA)=-1 OR 判斷YXA=-1),-1,0);
低保留YX:=IF((低保留YXA=-1 OR 低保留YXB=-1) AND L AAAD:=IF(高保留YX=1 AND 低保留YX=-1 AND H>REF(H,REF(距前高天YA,1)+2),1,IF(高保留YX=1 AND 低保留YX=-1 AND L 極點保留:=IF(AAAD=0,高保留YX+低保留YX,AAAD);
高低點:IF(極點保留=-1,L,IF(極點保留=1,H,DRAWNULL)),CIRCLEDOT,COLORYELLOW,LINETHICK5;
XA:=DRAWLINE(極點保留=-1,L,REF(極點保留,1)=-1,REF(L,1),1);
XB:=DRAWLINE(極點保留=1,H,REF(極點保留,1)=1,REF(H,1),1);
XAS:=DRAWLINE(極點保留=-1,XB,REF(極點保留,1)=-1,REF(XB,1),1);
XBS:=DRAWLINE(極點保留=1,XA,REF(極點保留,1)=1,REF(XA,1),1);
XA45:=(XA+XAS)/2;
XB45:=(XB+XBS)/2;
XA63:=(XAS-XA)*3/4+XA;
XB63:=XB-(XB-XBS)*3/4;
DRAWBAND(XA45,RGB(0,150,100),XA63,RGB(0,150,100));
DRAWBAND(XB45,RGB(185,96,9),XB63,RGB(185,96,9));
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
CURR:=CURRBARSCOUNT;
TCH:=CONST(FINDHIGH(H,0,HDAY*10,1));
GTT:=CONST(BARSLAST(TCH=H))+1;
SX跌H:=CONST(IF(GTT=1,H,REF(H,GTT-1)));
BCL:=CONST(FINDLOW(L,0,LDAY*10,1));
DTT:=CONST(BARSLAST(BCL=L))+1;
SX漲L:=CONST(IF(DTT=1,L,REF(L,DTT-1)));
漲點:=BARSSINCE(BACKSET(ISLASTBAR,BARSLAST(L=SX漲L)+1));
跌點:=BARSSINCE(BACKSET(ISLASTBAR,BARSLAST(H=SX跌H)+1));
最低:=IF(調點=1,跌點,IF(調點=2,漲點,IF(調點=3,漲點,跌點)));
L斜率:=角度/IF(C<300,1000,10);
最高:=IF(調點=1,跌點,IF(調點=2,漲點,IF(調點=3,跌點,漲點)));
H斜率:=角度/IF(C<300,1000,10);
IM68:=((SX跌H-SX漲L)/6-(SX跌H-SX漲L)/8);
GH跌X:=SX跌H+(SX跌H-SX漲L)/8;
DL漲X:=SX漲L-(SX跌H-SX漲L)/8;
GTHT:=IF(DTT>GTT,DTT,GTT);
R:=ABS(GTT-DTT);
DRAWBAND(IF(CURR<=GTHT+R/8,SX跌H,DRAWNULL),RGB(8,168,168),SX跌H,RGB(8,168,168));
DRAWBAND(IF(CURR<=GTHT+R/8,SX漲L,DRAWNULL),RGB(8,168,168),SX漲L,RGB(8,168,168));
DRAWBAND(IF(CURR<=GTHT+R/8,(SX跌H+SX漲L)/2,DRAWNULL),RGB(8,168,168),(SX跌H+SX漲L)/2,RGB(8,168,168));
{DRAWTEXT(CURR=GTHT,SX漲L-IM68,'牛金畫線'),COLOR8899AA;}
天線:=SX跌H;
地線:=SX漲L;
K:=(天線-地線)/(IF(跌點>=漲點,跌點,漲點)-IF(跌點>=漲點,漲點,跌點));
上斜線1:=IF(地線+CONST(L斜率*1.618)*最低>=地線,地線+CONST(L斜率*1.618)*最低,DRAWNULL);
上斜線2:=IF(地線+CONST(L斜率*1.000)*最低>=地線,地線+CONST(L斜率*1.000)*最低,DRAWNULL);
上斜線3:=IF(地線+CONST(L斜率*0.618)*最低>=地線,地線+CONST(L斜率*0.618)*最低,DRAWNULL);
上斜線4:=IF(地線+CONST(L斜率*0.382)*最低>=地線,地線+CONST(L斜率*0.382)*最低,DRAWNULL);
上斜線5:=IF(地線+CONST(L斜率*0.316)*最低>=地線,地線+CONST(L斜率*0.316)*最低,DRAWNULL);
上斜線6:=IF(地線+CONST(L斜率*0.250)*最低>=地線,地線+CONST(L斜率*0.250)*最低,DRAWNULL);
上斜線7:=IF(地線+CONST(L斜率*0.156)*最低>=地線,地線+CONST(L斜率*0.156)*最低,DRAWNULL);
上斜線8:=IF(地線+CONST(L斜率*0.092)*最低>=地線,地線+CONST(L斜率*0.092)*最低,DRAWNULL);
上斜線9:=IF(地線+CONST(L斜率*0.055)*最低>=地線,地線+CONST(L斜率*0.055)*最低,DRAWNULL);
上9:IF(上斜線9<=天線*1.05,上斜線9,DRAWNULL)COLOR8B2368;
上8:IF(上斜線8<=天線*1.05,上斜線8,DRAWNULL)COLOR8B2368;
上7:IF(上斜線7<=天線*1.05,上斜線7,DRAWNULL)COLOR8B2368;
上6:IF(上斜線6<=天線*1.05,上斜線6,DRAWNULL)COLOR8B2368;
上5:IF(上斜線5<=天線*1.05,上斜線5,DRAWNULL)COLORYELLOW;
上4:IF(上斜線4<=天線*1.05,上斜線4,DRAWNULL)COLOR8B2368;
上3:IF(上斜線3<=天線*1.05,上斜線3,DRAWNULL)COLOR8B2368;
上2:IF(上斜線2<=天線*1.05,上斜線2,DRAWNULL)COLOR8B2368;
上1:IF(上斜線1<=天線*1.05,上斜線1,DRAWNULL)COLOR8B2368;
下斜線1:=IF(天線-CONST(H斜率*1.618)*最高<=天線,天線-CONST(H斜率*1.618)*最高,DRAWNULL);
下斜線2:=IF(天線-CONST(H斜率*1.000)*最高<=天線,天線-CONST(H斜率*1.000)*最高,DRAWNULL);
下斜線3:=IF(天線-CONST(H斜率*0.618)*最高<=天線,天線-CONST(H斜率*0.618)*最高,DRAWNULL);
下斜線4:=IF(天線-CONST(H斜率*0.382)*最高<=天線,天線-CONST(H斜率*0.382)*最高,DRAWNULL);
下斜線5:=IF(天線-CONST(H斜率*0.316)*最高<=天線,天線-CONST(H斜率*0.316)*最高,DRAWNULL);
下斜線6:=IF(天線-CONST(H斜率*0.250)*最高<=天線,天線-CONST(H斜率*0.250)*最高,DRAWNULL);
下斜線7:=IF(天線-CONST(H斜率*0.156)*最高<=天線,天線-CONST(H斜率*0.156)*最高,DRAWNULL);
下斜線8:=IF(天線-CONST(H斜率*0.092)*最高<=天線,天線-CONST(H斜率*0.092)*最高,DRAWNULL);
下斜線9:=IF(天線-CONST(H斜率*0.055)*最高<=天線,天線-CONST(H斜率*0.055)*最高,DRAWNULL);
下9:IF(下斜線9>=地線*0.95,下斜線9,DRAWNULL),COLOR996600;
下8:IF(下斜線8>=地線*0.95,下斜線8,DRAWNULL),COLOR996600;
下7:IF(下斜線7>=地線*0.95,下斜線7,DRAWNULL),COLOR996600;
下6:IF(下斜線6>=地線*0.95,下斜線6,DRAWNULL),COLOR996600;
下5:IF(下斜線5>=地線*0.95,下斜線5,DRAWNULL),COLORYELLOW;
下4:IF(下斜線4>=地線*0.95,下斜線4,DRAWNULL),COLOR996600;
下3:IF(下斜線3>=地線*0.95,下斜線3,DRAWNULL),COLOR996600;
下2:IF(下斜線2>=地線*0.95,下斜線2,DRAWNULL),COLOR996600;
下1:IF(下斜線1>=地線*0.95,下斜線1,DRAWNULL),COLOR996600;
最低1:=TROUGHBARS(L,之字幅度,1);
P:=橫向調節;
N:=最低1;
數列:=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(最低1=0));
高價:=CONST(HHV(H,最低1))*1.05;
前低:DRAWLINE(最低1=0,L,ISLASTBAR,低價,0)COLORLIMAGENTA,DOTLINE;
前高低:=HHV(H,最低1+1)=H;
統計:=CROSS(COUNT(前高低,最低1)=4,0.5);
KK:=BARSLAST(統計);
PP:=IF(REF(C,BARSLAST(CROSS(COUNT(前高低,最低1)=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),DOTLINE,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),DOTLINE,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),DOTLINE,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),DOTLINE,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),DOTLINE,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),DOTLINE,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),DOTLINE,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),DOTLINE,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),DOTLINE,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),DOTLINE,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),DOTLINE,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;};
通達信牛金角線主圖看支撐與壓力指標公式實例圖解:
通達信牛金角線主圖看支撐與壓力指標公式