黄金分割指标
2016-4-9 19:19:38点击:
N:=1000;P:=5;P1:=10;{N为多少天内的高低值参数,我以自已的初始K线根数定义。P1、P2为短、长支撑压力取点参数}
A1:=REF(H,P)=HHV(H,2*P+1);
B1:=FILTER(A1,P);
C1:=BACKSET(B1,P+1);
D1:=FILTER(C1,P);
E1:=BACKSET(ISLASTBAR,BARSLAST(D1)+1);
F1:=E1>REF(E1,1);
短压:DRAWLINE(D1,H,F1,H,1),COLORCYAN;
A2:=REF(L,P)=LLV(L,2*P+1);
B2:=FILTER(A2,P);
C2:=BACKSET(B2,P+1);
D2:=FILTER(C2,P);
E2:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);
F2:=E2>REF(E2,1);
短支:DRAWLINE(D2,L,F2,L,1),COLORLIRED;
AA1:=REF(H,P1)=HHV(H,2*P1+1);
BB1:=FILTER(AA1,P1);
CC1:=BACKSET(BB1,P1+1);
DD1:=FILTER(CC1,P1);
EE1:=BACKSET(ISLASTBAR,BARSLAST(DD1)+1);
FF1:=EE1>REF(EE1,1);
长压:DRAWLINE(DD1,H,FF1,H,1),COLORGREEN;
AA2:=REF(L,P1)=LLV(L,2*P1+1);
BB2:=FILTER(AA2,P1);
CC2:=BACKSET(BB2,P1+1);
DD2:=FILTER(CC2,P1);
EE2:=BACKSET(ISLASTBAR,BARSLAST(DD2)+1);
FF2:=EE2>REF(EE2,1);
长支:DRAWLINE(DD2,L,FF2,L,1),COLORRED;
STICKLINE(C>=O,C,O,3,0),COLOR000045;
STICKLINE(C>=O,C,O,2.5,0),COLOR000065;
STICKLINE(C>=O,C,O,2,0),COLOR000085;
STICKLINE(C>=O,C,O,1.5,0),COLOR0000A5;
STICKLINE(C>=O,C,O,1,0),COLOR0000C5;
STICKLINE(C>=O,C,O,0.5,0),COLOR0000E5;
STICKLINE(C>=O,H,L,0,0),COLOR0000F5;
STICKLINE(C<O,C,O,3,0),COLOR353500;
STICKLINE(C<O,C,O,2.5,0),COLOR454500;
STICKLINE(C<O,C,O,2,0),COLOR555500;
STICKLINE(C<O,C,O,1.5,0),COLOR656500;
STICKLINE(C<O,C,O,1,0),COLOR757500;
STICKLINE(C<O,C,O,0.5,0),COLOR858500;
STICKLINE(C<O,H,L,0,0),COLOR959500;
高:=REFDATE(HHV(H,N),DATE);
低:=REFDATE(LLV(L,N),DATE);
H1:=高-(高-低)*0.191;
H2:=高-(高-低)*0.382;
H3:=高-(高-低)*0.5;
H4:=高-(高-低)*0.618;
H5:=高-(高-低)*0.809;
H6:=高-(高-低)*0.764;
STICKLINE(CURRBARSCOUNT=13,高,高,100,1),COLORGREEN;
STICKLINE(CURRBARSCOUNT=13,H1,H1,100,1),COLORCYAN;
STICKLINE(CURRBARSCOUNT=13,H2,H2,100,1),COLORCCCCCC;
DRAWTEXT(CURRBARSCOUNT=1,高,' 高'),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=1,H1,'0.809'),COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=1,H2,' 0.618'),COLORFFFFFF;
DRAWTEXT(CURRBARSCOUNT=1,H3,' 中'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1,H4,' 0.382'),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=1,H6,' 0.236'),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=1,H5,' 0.191'),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=1,低,' 低'),COLORRED;
STICKLINE(CURRBARSCOUNT=13,H3,H3,100,1),COLORYELLOW;
STICKLINE(CURRBARSCOUNT=13,H4,H4,100,1),COLORLIRED;
STICKLINE(CURRBARSCOUNT=13,H6,H6,100,1),COLORLIRED;
STICKLINE(CURRBARSCOUNT=13,H5,H5,100,1),COLORMAGENTA;
STICKLINE(CURRBARSCOUNT=13,低,低,100,1),COLORRED;
DRAWTEXT(CURRBARSCOUNT=25,高*0.99,CON2STR(高,2)),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=25,H1,CON2STR(H1,2)),COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=25,H2,CON2STR(H2,2)),COLORFFFFFF;
DRAWTEXT(CURRBARSCOUNT=25,H3,CON2STR(H3,2)),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=25,H6,CON2STR(H6,2)),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=25,H4,CON2STR(H4,2)),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=25,H5,CON2STR(H5,2)),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=25,低*1.01,CON2STR(低,2)),COLORRED;
A1:=REF(H,P)=HHV(H,2*P+1);
B1:=FILTER(A1,P);
C1:=BACKSET(B1,P+1);
D1:=FILTER(C1,P);
E1:=BACKSET(ISLASTBAR,BARSLAST(D1)+1);
F1:=E1>REF(E1,1);
短压:DRAWLINE(D1,H,F1,H,1),COLORCYAN;
A2:=REF(L,P)=LLV(L,2*P+1);
B2:=FILTER(A2,P);
C2:=BACKSET(B2,P+1);
D2:=FILTER(C2,P);
E2:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);
F2:=E2>REF(E2,1);
短支:DRAWLINE(D2,L,F2,L,1),COLORLIRED;
AA1:=REF(H,P1)=HHV(H,2*P1+1);
BB1:=FILTER(AA1,P1);
CC1:=BACKSET(BB1,P1+1);
DD1:=FILTER(CC1,P1);
EE1:=BACKSET(ISLASTBAR,BARSLAST(DD1)+1);
FF1:=EE1>REF(EE1,1);
长压:DRAWLINE(DD1,H,FF1,H,1),COLORGREEN;
AA2:=REF(L,P1)=LLV(L,2*P1+1);
BB2:=FILTER(AA2,P1);
CC2:=BACKSET(BB2,P1+1);
DD2:=FILTER(CC2,P1);
EE2:=BACKSET(ISLASTBAR,BARSLAST(DD2)+1);
FF2:=EE2>REF(EE2,1);
长支:DRAWLINE(DD2,L,FF2,L,1),COLORRED;
STICKLINE(C>=O,C,O,3,0),COLOR000045;
STICKLINE(C>=O,C,O,2.5,0),COLOR000065;
STICKLINE(C>=O,C,O,2,0),COLOR000085;
STICKLINE(C>=O,C,O,1.5,0),COLOR0000A5;
STICKLINE(C>=O,C,O,1,0),COLOR0000C5;
STICKLINE(C>=O,C,O,0.5,0),COLOR0000E5;
STICKLINE(C>=O,H,L,0,0),COLOR0000F5;
STICKLINE(C<O,C,O,3,0),COLOR353500;
STICKLINE(C<O,C,O,2.5,0),COLOR454500;
STICKLINE(C<O,C,O,2,0),COLOR555500;
STICKLINE(C<O,C,O,1.5,0),COLOR656500;
STICKLINE(C<O,C,O,1,0),COLOR757500;
STICKLINE(C<O,C,O,0.5,0),COLOR858500;
STICKLINE(C<O,H,L,0,0),COLOR959500;
高:=REFDATE(HHV(H,N),DATE);
低:=REFDATE(LLV(L,N),DATE);
H1:=高-(高-低)*0.191;
H2:=高-(高-低)*0.382;
H3:=高-(高-低)*0.5;
H4:=高-(高-低)*0.618;
H5:=高-(高-低)*0.809;
H6:=高-(高-低)*0.764;
STICKLINE(CURRBARSCOUNT=13,高,高,100,1),COLORGREEN;
STICKLINE(CURRBARSCOUNT=13,H1,H1,100,1),COLORCYAN;
STICKLINE(CURRBARSCOUNT=13,H2,H2,100,1),COLORCCCCCC;
DRAWTEXT(CURRBARSCOUNT=1,高,' 高'),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=1,H1,'0.809'),COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=1,H2,' 0.618'),COLORFFFFFF;
DRAWTEXT(CURRBARSCOUNT=1,H3,' 中'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=1,H4,' 0.382'),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=1,H6,' 0.236'),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=1,H5,' 0.191'),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=1,低,' 低'),COLORRED;
STICKLINE(CURRBARSCOUNT=13,H3,H3,100,1),COLORYELLOW;
STICKLINE(CURRBARSCOUNT=13,H4,H4,100,1),COLORLIRED;
STICKLINE(CURRBARSCOUNT=13,H6,H6,100,1),COLORLIRED;
STICKLINE(CURRBARSCOUNT=13,H5,H5,100,1),COLORMAGENTA;
STICKLINE(CURRBARSCOUNT=13,低,低,100,1),COLORRED;
DRAWTEXT(CURRBARSCOUNT=25,高*0.99,CON2STR(高,2)),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=25,H1,CON2STR(H1,2)),COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=25,H2,CON2STR(H2,2)),COLORFFFFFF;
DRAWTEXT(CURRBARSCOUNT=25,H3,CON2STR(H3,2)),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=25,H6,CON2STR(H6,2)),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=25,H4,CON2STR(H4,2)),COLORLIRED;
DRAWTEXT(CURRBARSCOUNT=25,H5,CON2STR(H5,2)),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=25,低*1.01,CON2STR(低,2)),COLORRED;