反转上升结构趋势,波段类(通达信公式 副图 源码 测试图)一个很好的划线主图,新趋势筹码峰+60天内最高低点黄金分割
通达信免费指标
10-28
阅读:514
评论:0
{新趋势筹码峰+60天内最高低点黄金分割主图}
通达信公式 主图 源码 测试图)
通达信公式 主图 源码 测试图)
DA:=100;
HI:=REFDATE(HHV(H,DA),DATE);
LO:=REFDATE(LLV(L,DA),DATE);
C1:=IF(CURRBARSCOUNT<=DA,C,DRAWNULL);
GZ:=EXP(LN(HI/LO)/10);
LH1:=SUM(IF(C1>=(HI/GZ),V,0),DA);
LH2:=SUM(IF(C1>=(HI/POW(GZ,2)) AND C1<(HI/GZ),V,0),DA);
LH3:=SUM(IF(C1>=(HI/POW(GZ,3)) AND C1<(HI/POW(GZ,2)),V,0),DA);
LH4:=SUM(IF(C1>=(HI/POW(GZ,4)) AND C1<(HI/POW(GZ,3)),V,0),DA);
LH5:=SUM(IF(C1>=(HI/POW(GZ,5)) AND C1<(HI/POW(GZ,4)),V,0),DA);
LH6:=SUM(IF(C1>=(HI/POW(GZ,6)) AND C1<(HI/POW(GZ,5)),V,0),DA);
LH7:=SUM(IF(C1>=(HI/POW(GZ,7)) AND C1<(HI/POW(GZ,6)),V,0),DA);
LH8:=SUM(IF(C1>=(HI/POW(GZ,8)) AND C1<(HI/POW(GZ,7)),V,0),DA);
LH9:=SUM(IF(C1>=(LO*GZ) AND C1<LO*POW(GZ,2),V,0),DA);
LH10:=SUM(IF(C1>=LO AND C1<LO*GZ,V,0),DA);
L1:=REFDATE(HHV(LH1,DA),DATE);
L2:=REFDATE(HHV(LH2,DA),DATE);
L3:=REFDATE(HHV(LH3,DA),DATE);
L4:=REFDATE(HHV(LH4,DA),DATE);
L5:=REFDATE(HHV(LH5,DA),DATE);
L6:=REFDATE(HHV(LH6,DA),DATE);
L7:=REFDATE(HHV(LH7,DA),DATE);
L8:=REFDATE(HHV(LH8,DA),DATE);
L9:=REFDATE(HHV(LH9,DA),DATE);
L10:=REFDATE(HHV(LH10,DA),DATE);
SS:=(L1+L2+L3+L4+L5+L6+L7+L8+L9+L10);
STICKLINE(CEILING(DA*L1/SS)*3>=CURRBARSCOUNT,HI*0.98,HI/GZ,9,0),COLOR3C3C3A;
STICKLINE(CEILING(DA*L2/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,1)*0.98,HI/POW(GZ,2),9,0),COLOR3C3C3A;
STICKLINE(CEILING(DA*L3/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,2)*0.98,HI/POW(GZ,3),9,0),COLOR3C3C3A;
STICKLINE(CEILING(DA*L4/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,3)*0.98,HI/POW(GZ,4),9,0),COLOR7C7C3A;
STICKLINE(CEILING(DA*L5/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,4)*0.98,HI/POW(GZ,5),9,0),COLOR3C3C3A;
STICKLINE(CEILING(DA*L6/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,5)*0.98,HI/POW(GZ,6),9,0),COLOR3C3C3A;
STICKLINE(CEILING(DA*L7/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,6)*0.98,HI/POW(GZ,7),9,0),COLOR3C3C3A;
STICKLINE(CEILING(DA*L8/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,2),LO*POW(GZ,3)*0.98,9,0),COLOR3C3C3A;
STICKLINE(CEILING(DA*L9/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,1),LO*POW(GZ,2)*0.98,9,0),COLOR3C3C3A;
STICKLINE(CEILING(DA*L10/SS)*3>=CURRBARSCOUNT,LO,LO*POW(GZ,1)*0.98,9,0),COLOR3C3C3A;
{HD LD ZIG}
HD:=FILTER(BACKSET(FILTER(REF(H,5)=HHV(H,13),5),5+1),6);{高点}
LD:=FILTER(BACKSET(FILTER(REF(L,5)=LLV(L,21),6),6),5);{低点}
DRAWLINE(LD,L,HD,H,0),COLORRED,LINETHICK2;
DRAWLINE(HD,H,LD,L,0),COLORGREEN;
{A B }
J1:=BACKSET(CURRBARSCOUNT=2 ,MIN(BARSLAST(HD),BARSLAST(LD))+1);
J2:=J1>REF(J1,1);
DRAWLINE(J2,IF(HD,H,L),CURRBARSCOUNT=2 ,IF(BARSLAST(HD)>BARSLAST(LD),H,L),1),COLORYELLOW,LINETHICK3;
DRAWLINE(J2,IF(LD,H,L),CURRBARSCOUNT=2 ,IF(BARSLAST(LD)>BARSLAST(HD),H,L),1),COLORGREEN,LINETHICK3;
{60天内最高低点黄金分割}
CURR:CURRBARSCOUNT,NODRAW;
GTT:=CONST(BARSLAST(CONST(FINDHIGH(H,0,60,1))=H))+1;
SX跌H:CONST(IF(GTT=1,H,REF(H,GTT-1))),COLORGREEN;
DTT:=CONST(BARSLAST(CONST(FINDLOW(L,0,60,1))=L))+1;
SX涨L:CONST(IF(DTT=1,L,REF(L,DTT-1))),COLORGREEN;
X191:IF(CURRBARSCOUNT<=50,SX跌H-(SX跌H-SX涨L)*0.191,DRAWNULL),COLORGREEN,LINETHICK1;
DRAWTEXT(CURR=50,(X191)*1.015,STRCAT(STRCAT('0.806 ',CON2STR(X191,3)),'元')),COLORGREEN;
X382:IF(CURR<=50,SX跌H-(SX跌H-SX涨L)*0.382,DRAWNULL),COLORGREEN,LINETHICK1;
DRAWTEXT(CURR=50,(X382)*1.015,STRCAT(STRCAT('0.618% ',CON2STR(X382,3)),'元')),COLORGREEN;
X500:IF(CURR<=50,SX跌H-(SX跌H-SX涨L)*0.500,DRAWNULL),COLORGREEN,LINETHICK3;
DRAWTEXT(CURR=50,(X500)*1.015,STRCAT(STRCAT('0.500% ',CON2STR(X500,3)),'元')),COLORGREEN;
X618:IF(CURR<=50,SX跌H-(SX跌H-SX涨L)*0.618,DRAWNULL),COLORGREEN,LINETHICK1;
DRAWTEXT(CURR=50,(X618)*1.015,STRCAT(STRCAT('0.382 ',CON2STR(X618,3)),'元')),COLORGREEN;
X809:IF(CURR<=50,SX跌H-(SX跌H-SX涨L)*0.809,DRAWNULL),COLORGREEN,LINETHICK1;
DRAWTEXT(CURR=50,(X809)*1.015,STRCAT(STRCAT('0.191% ',CON2STR(X809,3)),'元')),COLORGREEN;
STICKLINE(CURR=51,SX涨L,SX跌H,1,0),COLORGREEN;
DRAWTEXT(CURR=50,SX跌H*1.008,'60天内黄金分割最高点'),COLORGREEN;
DRAWTEXT(CURR=50,SX涨L*1.008,'60天内黄金分割最低点'),COLORGREEN;
{60日KX}
AAA:=CURRBARSCOUNT<=60;
STICKLINE(AAA AND C>=O,C,O,3.4,0),COLOR0000AA;
STICKLINE(AAA AND C>=O,C,O,3.0,0),COLOR0000BB ;
STICKLINE(AAA AND C>=O,C,O,2.4,0),COLOR0000CC;
STICKLINE(AAA AND C>=O,C,O,2.0,0),COLOR0000DD ;
STICKLINE(AAA AND C>=O,C,O,1.6,0),COLOR0000EE;
STICKLINE(AAA AND C>=O,C,O,1.2,0),COLOR0000FF;
STICKLINE(AAA AND C>=O,C,O,0.6,0),COLOR0000FF;
STICKLINE(AAA AND C>=O,H,L,0,0),COLORRED;
STICKLINE(AAA AND C<=O,C,O,3.4,0),COLORAAAA00;
STICKLINE(AAA AND C<=O,C,O,3.0,0),COLORBBBB00;
STICKLINE(AAA AND C<=O,C,O,2.4,0),COLORCCCC00;
STICKLINE(AAA AND C<=O,C,O,2.0,0),COLORDDDD00;
STICKLINE(AAA AND C<=O,C,O,1.6,0),COLOREEEE00;
STICKLINE(AAA AND C<=O,C,O,1.2,0),COLORFFFF00;
STICKLINE(AAA AND C<=O,C,O,0.6,0),COLORFFFF00;
STICKLINE(AAA AND C<=O,H,L,0,0),COLORFFFF00;
版权声明
本文版权归掌上指标所有。
未经许可,不得转载,转载请注明出处!