一个很好的划线主图新趋势筹码峰+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;
未来函数检测结果如下:
该公式包含未来函数:ZIG
该公式包含未来函数:BACKSET
该公式包含未来函数:DHIGH
该公式包含未来函数:DLOW
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
DA赋值:100
HI赋值:REFDATE(DA日内H最高值,DATE)
LO赋值:REFDATE(DA日内L最低值,DATE)
如果 到最后交易的周期<=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如果C1>=LO AND C1
L1赋值:REFDATE(DA日内LH1最高值,DATE)
L2赋值:REFDATE(DA日内LH2最高值,DATE)
L3赋值:REFDATE(DA日内LH3最高值,DATE)
L4赋值:REFDATE(DA日内LH4最高值,DATE)
L5赋值:REFDATE(DA日内LH5最高值,DATE)
L6赋值:REFDATE(DA日内LH6最高值,DATE)
L7赋值:REFDATE(DA日内LH7最高值,DATE)
L8赋值:REFDATE(DA日内LH8最高值,DATE)
L9赋值:REFDATE(DA日内LH9最高值,DATE)
L10:=REFDATE(DA日内LH10最高值,DATE)
SS赋值:(L1+L2+L3+L4+L5+L6+L7+L8+L9+L10)
STICKLINE(CEILING(DA*L1/SS)*3>= 到最后交易的周期,HI*0.98,HI/GZ,9,0),COLOR3C3C3A
STICKLINE(CEILING(DA*L2/SS)*3>= 到最后交易的周期,HI/POW(GZ,1)*0.98,HI/POW(GZ,2),9,0),COLOR3C3C3A
STICKLINE(CEILING(DA*L3/SS)*3>= 到最后交易的周期,HI/POW(GZ,2)*0.98,HI/POW(GZ,3),9,0),COLOR3C3C3A
STICKLINE(CEILING(DA*L4/SS)*3>= 到最后交易的周期,HI/POW(GZ,3)*0.98,HI/POW(GZ,4),9,0),COLOR7C7C3A
STICKLINE(CEILING(DA*L5/SS)*3>= 到最后交易的周期,HI/POW(GZ,4)*0.98,HI/POW(GZ,5),9,0),COLOR3C3C3A
STICKLINE(CEILING(DA*L6/SS)*3>= 到最后交易的周期,HI/POW(GZ,5)*0.98,HI/POW(GZ,6),9,0),COLOR3C3C3A
STICKLINE(CEILING(DA*L7/SS)*3>= 到最后交易的周期,HI/POW(GZ,6)*0.98,HI/POW(GZ,7),9,0),COLOR3C3C3A
STICKLINE(CEILING(DA*L8/SS)*3>= 到最后交易的周期,LO*POW(GZ,2),LO*POW(GZ,3)*0.98,9,0),COLOR3C3C3A
STICKLINE(CEILING(DA*L9/SS)*3>= 到最后交易的周期,LO*POW(GZ,1),LO*POW(GZ,2)*0.98,9,0),COLOR3C3C3A
STICKLINE(CEILING(DA*L10/SS)*3>= 到最后交易的周期,LO,LO*POW(GZ,1)*0.98,9,0),COLOR3C3C3A
{HD LD ZIG}
HD赋值:FILTER(BACKSET(FILTER(5日前的H=13日内H最高值,5),5+1),6)
{高点}
LD赋值:FILTER(BACKSET(FILTER(5日前的L=21日内L最低值,6),6),5)
{低点}
DRAWLINE(LD,L,HD,H,0),COLORRED,LINETHICK2
DRAWLINE(HD,H,LD,L,0),COLORGREEN
{A B }
J1赋值:BACKSET( 到最后交易的周期=2 ,MIN(上次HD距今天数,BARSLAST(LD))+1)
J2赋值:J1>1日前的J1
如果HD返回H否则返回L
如果LD返回H否则返回L
输出{60天内最高低点黄金分割}
CURR: 到最后交易的周期,NODRAW
GTT赋值:CONST(上次CONST(FINDHIGH(H,0,60,1距今天数)=H))+1
输出SX跌H:CONST(IF(GTT=1,H,GTT-1日前的H)),COLORGREEN
DTT赋值:CONST(上次CONST(FINDLOW(L,0,60,1距今天数)=L))+1
输出SX涨L:CONST(IF(DTT=1,L,DTT-1日前的L)),COLORGREEN
输出X191:IF( 到最后交易的周期<=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
当满足条件CURR=51时,在SX涨L和SX跌H之间画柱状线
当满足条件CURR=50时,在SX跌H*1.008和'60天内黄金分割最高点'位置书写文字
当满足条件CURR=50时,在SX涨L*1.008和'60天内黄金分割最低点'位置书写文字
{60日KX}
AAA赋值: 到最后交易的周期<=60
当满足条件AAA AND C>=O时,在C和O之间画柱状线
当满足条件AAA AND C>=O时,在C和O之间画柱状线
当满足条件AAA AND C>=O时,在C和O之间画柱状线
当满足条件AAA AND C>=O时,在C和O之间画柱状线
当满足条件AAA AND C>=O时,在C和O之间画柱状线
当满足条件AAA AND C>=O时,在C和O之间画柱状线
当满足条件AAA AND C>=O时,在C和O之间画柱状线
当满足条件AAA AND C>=O时,在H和L之间画柱状线
当满足条件AAA AND C<=O时,在C和O之间画柱状线
当满足条件AAA AND C<=O时,在C和O之间画柱状线
当满足条件AAA AND C<=O时,在C和O之间画柱状线
当满足条件AAA AND C<=O时,在C和O之间画柱状线
当满足条件AAA AND C<=O时,在C和O之间画柱状线
当满足条件AAA AND C<=O时,在C和O之间画柱状线
当满足条件AAA AND C<=O时,在C和O之间画柱状线
当满足条件AAA AND C<=O时,在H和L之间画柱状线