神奇指标网
神奇指标网

通达信非常好用的黄金分割指标公式—通达信指标公式

浏览 234次浏览
标签: 黄金分割
来源:神奇指标网 编辑:神奇指标网 发布日期:2024-01-15

以下是通达信非常好用的黄金分割指标公式源码和截图


通达信非常好用的黄金分割指标公式源码:

   N:=16;

   N1:=N*10;

   CY:=BArslAst(CURRBARSCOUNT=N1);

   GD:=CONST(IF(ISLASTBAR=1,HHV(H,CY),0));

   DD:=CONST(IF(ISLASTBAR=1,LLV(L,CY),0));

   预顶百分比%:(GD-C)/C*100,NODRAW;

   H5:=GD-(GD-DD)*0.191;

   H4:=GD-(GD-DD)*0.382;

   H3:=GD-(GD-DD)*0.5;

   H2:=GD-(GD-DD)*0.618;

   H1:=GD-(GD-DD)*0.809;

   DH5:=STRCAT(STRCAT('80.9%',CON2STR(H5,3)),'');

   DH4:=STRCAT(STRCAT('61.8%',CON2STR(H4,3)),'');

   DH3:=STRCAT(STRCAT('50.0%',CON2STR(H3,3)),'');

   DH2:=STRCAT(STRCAT('38.2%',CON2STR(H2,3)),'');

   DH1:=STRCAT(STRCAT('19.1%',CON2STR(H1,3)),'');

   BASE:=STRCAT(STRCAT('BASE',CON2STR(DD,3)),'随浪飞扬');

   %100:=STRCAT(STRCAT('100%',CON2STR(GD,3)),'');

   DRAWBAND(IF(CURRBARSCOUNT<=1,DD,DRAWNULL),

   RGB(16,36,46),IF(CURRBARSCOUNT<=N1,DD,DRAWNULL)-(H4-H3)/2,RGB(0,0,0));

   {DRAWBAND(IF(CURRBARSCOUNT<=N1,GD,DRAWNULL)+(H4-H3)/2,

   RGB(16,36,46),IF(CURRBARSCOUNT<=N1,DD,DRAWNULL)-(H4-H3)/2,RGB(0,0,0));}{背景}

   DRAWKLINE(H,O,L,C);

   DRAWBAND(IF(CURRBARSCOUNT<=N1,H1,DRAWNULL),RGB(200,0,200),H1,RGB(0,0,0));

   DRAWBAND(IF(CURRBARSCOUNT<=N1,H2,DRAWNULL),RGB(200,0,200),H2,RGB(0,0,0));

   DRAWBAND(IF(CURRBARSCOUNT<=N1,H3,DRAWNULL),RGB(200,0,200),H3,RGB(0,0,0));

   DRAWBAND(IF(CURRBARSCOUNT<=N1,H4,DRAWNULL),RGB(200,0,200),H4,RGB(0,0,0));

   DRAWBAND(IF(CURRBARSCOUNT<=N1,H5,DRAWNULL),RGB(200,0,200),H5,RGB(0,0,0));

   DRAWBAND(IF(CURRBARSCOUNT<=N1,GD,DRAWNULL),RGB(200,0,200),GD,RGB(0,0,0));

   DRAWBAND(IF(CURRBARSCOUNT<=N1,DD,DRAWNULL),RGB(200,0,200),DD,RGB(0,0,0));

   DRAWTEXT(CURRBARSCOUNT=N1-1,H5,DH5),COLORAA99AA;

   DRAWTEXT(CURRBARSCOUNT=N1-1,H4,DH4),COLORAA99AA;

   DRAWTEXT(CURRBARSCOUNT=N1-1,H3,DH3),COLORAA99AA;

   DRAWTEXT(CURRBARSCOUNT=N1-1,H2,DH2),COLORAA99AA;

   DRAWTEXT(CURRBARSCOUNT=N1-1,H1,DH1),COLORAA99AA;

   DRAWTEXT(CURRBARSCOUNT=N1-1,DD,BASE),COLORAA99AA;

   DRAWTEXT(CURRBARSCOUNT=N1-1,GD,%100),COLORAA99AA;

   input:K(1,1,3);

   A:=BARSLAST(DISPSTATUS=1)+1;

   HH:=HHV(H,A);

   LL:=LLV(L,A);

   上涨:BARSSINCE(BACKSET(DISPSTATUS=2,BARSLAST(L=LL)+1)),COLOR0000FF,linethick0;

   ↑空间%:(C/REF(L,上涨)-1)*100,COLOR00FFFF,linethick0;

   最高%:(HHVALL(HH)/REF(L,上涨)-1)*100,COLORFF00FF,linethick0;

   下跌:BARSSINCE(BACKSET(DISPSTATUS=2,BARSLAST(H=HH)+1)),COLOR00FF00,linethick0;

   ↓空间%:(C/REF(H,下跌)-1)*100,COLOR998888,linethick0;

   最低%:(LLVALL(LL)/REF(H,下跌)-1)*100,COLORFF0000,linethick0;

   高:REF(H,下跌),COLOR0000FF,DOTLINE;

   低:REF(L,上涨),COLOR00FF00,DOTLINE;

   VERTLINE(上涨=0,4),COLOR0000FF;

   VERTLINE(下跌=0,3),COLOR00FF00;

   {DRAWTEXT(上涨=0,HHVALL(HH)*0.99,'-最高'),COLOR0000FF;

   DRAWTEXT(下跌=0,LLVALL(LL)*1.01,'-最低'),COLOR00FF00;}

   DRAWTEXT(上涨=0AND最高%>10,LL*1.1,'-10%'),COLORYELLOW;

   DRAWTEXT(上涨=0AND最高%>10,LL*1.15,'-15%'),COLORFFFFFF;

   DRAWTEXT(上涨=0AND最高%>20,LL*1.2,'-20%'),COLOR00FF00;

   DRAWTEXT(上涨=0AND最高%>25,LL*1.25,'-25%'),COLORFF00FF;

   DRAWTEXT(上涨=0AND最高%>30,LL*1.3,'-30%'),COLOR0000FF;

   DRAWTEXT(上涨=0AND最高%>40,LL*1.4,'-40%'),COLOR00FFFF;

   DRAWTEXT(上涨=0AND最高%>50,LL*1.5,'-50%'),COLOR00FFFF;

   DRAWTEXT(上涨=0AND最高%>60,LL*1.6,'-60%'),COLOR00FFFF;

   DRAWTEXT(上涨=0AND最高%>70,LL*1.7,'-70%'),COLOR00FFFF;

   DRAWTEXT(上涨=0AND最高%>80,LL*1.8,'-80%'),COLOR00FFFF;

   DRAWTEXT(上涨=0AND最高%>90,LL*1.9,'-90%'),COLOR00FFFF;

   DRAWTEXT(上涨=0AND最高%>100,LL*2,'-100%'),COLOR00FFFF;

   DRAWTEXT(上涨=0AND最高%>125,LL*2.25,'-125%'),COLOR00FFFF;

   DRAWTEXT(上涨=0AND最高%>150,LL*2.5,'-150%'),COLOR00FFFF;

   DRAWTEXT(上涨=0AND最高%>180,LL*2.8,'-180%'),COLOR00FFFF;

   DRAWTEXT(上涨=0AND最高%>200,LL*3,'-200%'),COLOR00FFFF;

   DRAWTEXT(上涨=0AND最高%>250,LL*3.5,'-250%'),COLOR00FFFF;

   DRAWTEXT(下跌=0AND最低%<-10,HH*0.9,'-10%'),COLORYELLOW;

   DRAWTEXT(下跌=0AND最低%<-15,HH*0.85,'-15%'),COLORFFFFFF;

   DRAWTEXT(下跌=0AND最低%<-20,HH*0.8,'-20%'),COLOR00FF00;

   DRAWTEXT(下跌=0AND最低%<-25,HH*0.75,'-25%'),COLORFF00FF;

   DRAWTEXT(下跌=0AND最低%<-30,HH*0.7,'-30%'),COLORFF0000;

   DRAWTEXT(下跌=0AND最低%<-40,HH*0.6,'-40%'),COLORFFFFFF;

   DRAWTEXT(下跌=0AND最低%<-50,HH*0.5,'-50%'),COLORFFFFFF;

   DRAWTEXT(下跌=0AND最低%<-60,HH*0.4,'-60%'),COLORFFFFFF;

   DRAWTEXT(下跌=0AND最低%<-70,HH*0.3,'-70%'),COLORFFFFFF;

   DRAWTEXT(下跌=0AND最低%<-80,HH*0.2,'-80%'),COLORFFFFFF;

   DRAWTEXT(下跌=0AND最低%<-90,HH*0.1,'-90%'),COLORFFFFFF;

   DRAWTEXT(上涨=2,L,'3天'),COLOR00FFFF;

   DRAWTEXT(上涨=4,L,'5天'),COLOR00FFFF;

   DRAWTEXT(上涨=7,L,'8天'),COLOR00FFFF;

   DRAWTEXT(上涨=12,L,'13天'),COLOR00FFFF;

   DRAWTEXT(上涨=20,L,'21天'),COLOR00FFFF;

   DRAWTEXT(上涨=33,L,'34天'),COLOR00FFFF;

   DRAWTEXT(上涨=54,L,'55天'),COLOR00FFFF;

   DRAWTEXT(上涨=88,L,'89天'),COLOR00FFFF;

   DRAWTEXT(上涨=143,L,'144天'),COLOR00FFFF;

   DRAWTEXT(上涨=179,L,'180天'),COLOR00FFFF;

   DRAWTEXT(上涨=249,L,'250天'),COLOR00FFFF;

   DRAWTEXT(下跌=2,L,'-3天'),COLOR00FF00;

   DRAWTEXT(下跌=4,L,'-5天'),COLOR00FF00;

   DRAWTEXT(下跌=7,L,'-8天'),COLOR00FF00;

   DRAWTEXT(下跌=12,L,'-13天'),COLOR00FF00;

   DRAWTEXT(下跌=20,L,'-21天'),COLOR00FF00;

   DRAWTEXT(下跌=33,L,'-34天'),COLOR00FF00;

   DRAWTEXT(下跌=54,L,'-55天'),COLOR00FF00;

   DRAWTEXT(下跌=88,L,'-89天'),COLOR00FF00;

   DRAWTEXT(下跌=143,L,'-144天'),COLOR00FF00;

   DRAWTEXT(下跌=179,L,'-180天'),COLOR00FF00;

   DRAWTEXT(下跌=249,L,'-250天'),COLOR00FF00;

   T:=BARSLAST(DISPSTATUS=1)+1;

   Aa:=DISPSTATUS=2;

   HH1:=HHV(H,T);

   LL1:=LLV(L,T);

   HL:=HH1-LL1;

   wH:=HHVBARS(H,T);

   wL:=LLVBARS(L,T);

   KK:=wH-wL;

   mHL:=HH-HL*0.5;

   ifK=1thenbegin

   HL191:=(HH1-LL1)*0.191;

   HL382:=(HH1-LL1)*0.382;

   HL618:=(HH1-LL1)*0.618;

   HL809:=(HH1-LL1)*0.809;

   ifKK<0thenbegin

   a1:=HH1-HL191;

   a2:=HH1-HL382;

   a3:=HH1-HL618;

   a4:=HH1-HL809;

   endelsebegin

   a1:=LL1+HL191;

   a2:=LL1+HL382;

   a3:=LL1+HL618;

   a4:=LL1+HL809;

   end

   end

   ifk=1thenbegin

   HL125:=(HH1-LL1)*0.125;

   HL250:=(HH1-LL1)*0.25;

   HL375:=(HH1-LL1)*0.375;

   HL625:=(HH1-LL1)*0.625;

   HL750:=(HH1-LL1)*0.75;

   HL875:=(HH1-LL1)*0.875;

   ifkk<0thenbegin

   b1:=HH1-HL125;

   b2:=HH1-HL250;

   b3:=HH1-HL375;

   b4:=HH1-HL625;

   b5:=HH1-HL750;

   b6:=HH1-HL875;

   endelsebegin

   b1:=LL1+HL125;

   b2:=LL1+HL250;

   b3:=LL1+HL375;

   b4:=LL1+HL625;

   b5:=LL1+HL750;

   b6:=LL1+HL875;

   end

   end

   DRAWTEXT(AaandK<>3,HH1,'最高价:'+HH1),ALIGN2,colorgreen;

   DRAWTEXT(AaandK<>3,LL1,'最低价:'+ll1),ALIGN2,VALIGN2,colorgreen;

   DRAWTEXT(AaandK<>3,mHL,'50%:'+mH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aandK=1,a1,'﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊'),ALIGN2,color208FFF,linethick0;

   DRAWTEXT(AaandK=1,a2,'﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊'),ALIGN2,color208FFF,linethick0;

   DRAWTEXT(AaandK=1,a3,'﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊'),ALIGN2,color208FFF,linethick0;

   DRAWTEXT(AaandK=1,a4,'﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊﹊'),ALIGN2,color208FFF,linethick0;

   HH:=IF(BETWEEN(DATE,1150601,1150630),H,-999);

   T:=HHVBARS(HH,0);

   TT:=BARSLAST(L=LLV(L,T+1));

   T1:=BARSLAST(CURRBARSCOUNT=CONST(TT)+1);

   XL:=REFX(MIN(C,O),BARSNEXT(T1=0));

   高位价:DRAWLINE(CURRBARSCOUNT=CONST(T)+1,HH,ISLASTBAR,REF(HH,T),0),COLORYELLOW;

   NOTEXT1:DRAWLINE(CURRBARSCOUNT=CONST(T)-3,XL*1.08,ISLASTBAR,REF(XL*1.08,T),0),DOTLINE,COLORGREEN;

   NOTEXT2:DRAWLINE(CURRBARSCOUNT=CONST(T)-3,XL*1.21,ISLASTBAR,REF(XL*1.21,T),0),DOTLINE,COLORRED;

   NOTEXT3:DRAWLINE(CURRBARSCOUNT=CONST(T)-3,XL*1.34,ISLASTBAR,REF(XL*1.34,T),0),DOTLINE,COLORBLUE;

   NOTEXT4:DRAWLINE(CURRBARSCOUNT=CONST(T)-3,XL*1.55,ISLASTBAR,REF(XL*1.55,T),0),DOTLINE,COLORWHITE;

   NOTEXT5:DRAWLINE(CURRBARSCOUNT=CONST(T)-3,XL*1.89,ISLASTBAR,REF(XL*1.89,T),0),DOTLINE,COLORBROWN;

   NOTEXT6:DRAWLINE(CURRBARSCOUNT=CONST(T)-3,XL*2.44,ISLASTBAR,REF(XL*2.44,T),0),DOTLINE,COLORMAGENTA;

   DRAWTEXT(CURRBARSCOUNT=CONST(T)+1,XL*1.03,VARCAT(VARCAT('涨8%价:',VAR2STR(XL*1.08,2)),'元')),COLORGREEN;

   DRAWTEXT(CURRBARSCOUNT=CONST(T)+1,XL*1.21,VARCAT(VARCAT('涨21%价:',VAR2STR(XL*1.21,2)),'元')),COLORRED;

   DRAWTEXT(CURRBARSCOUNT=CONST(T)+1,XL*1.34,VARCAT(VARCAT('涨34%价:',VAR2STR(XL*1.34,2)),'元')),COLORBLUE;

   DRAWTEXT(CURRBARSCOUNT=CONST(T)+1,XL*1.55,VARCAT(VARCAT('涨55%价:',VAR2STR(XL*1.55,2)),'元')),COLORWHITE;

   DRAWTEXT(CURRBARSCOUNT=CONST(T)+1,XL*1.89,VARCAT(VARCAT('涨89%价:',VAR2STR(XL*1.89,2)),'元')),COLORBROWN;

   DRAWTEXT(CURRBARSCOUNT=CONST(T)+1,XL*2.44,VARCAT(VARCAT('涨144%价:',VAR2STR(XL*2.44,2)),'元')),COLORMAGENTA;




通达信非常好用的黄金分割指标公式截图

神奇指标网(https://www.shenqizhibiao.com/)所有指标公式及文章来源于网络仅供学习研究

神奇指标收藏 收藏
神奇指标分享 分享

网友评论

已有0人评论

清除 发表评论