黄金汇聚
源码:
input:n(14,1,100), n1(37,1,200);
A:=BACKSET(BARSTATUS=2,HHVBARS(H,N)+1);
B:=COUNT(A,N)=1;
前高:REF(H,BARSLAST(B)),COLORGREEN,linethick1;
DRAWTEXT(BARSTATUS=2,前高,''+NUMTOSTRN(前高,2)),COLORGREEN;
A2:=BACKSET(BARSTATUS=2,LLVBARS(L,N)+1);
B2:=A2>REF(A2,1);
前低:REF(L,BARSLAST(B2)) ,COLORGREEN,linethick1;
DRAWTEXT(BARSTATUS=2,前低,''+NUMTOSTRN(前低,2)),COLORYELLOW;
F2:((前高-前低)*0.382)+前低,COLORGREEN,DOTLINE;
DRAWTEXT(BARSTATUS=2,F2,''+NUMTOSTRN(F2,2)),COLORGREEN,align2;
DRAWTEXT(BARSLAST(B)>BARSLAST(B2) and BARSTATUS=2,F2,'(0.382)'),COLORGREEN;
DRAWTEXT(BARSLAST(B)<BARSLAST(B2) and BARSTATUS=2,F2,'(0.618)'),COLORGREEN;
F4:((前高-前低)*0.618)+前低,COLORGREEN,DOTLINE;
DRAWTEXT(BARSTATUS=2,F4,''+NUMTOSTRN(F4,2)),COLORGREEN,align2;
DRAWTEXT(BARSLAST(B)>BARSLAST(B2) and BARSTATUS=2,F4,'(0.618)'),COLORGREEN;
DRAWTEXT(BARSLAST(B)<BARSLAST(B2) and BARSTATUS=2,F4,'(0.382)'),COLORGREEN;
A1:=BACKSET(BARSTATUS=2,HHVBARS(H,N1)+1);
B1:=COUNT(A1,N1)=1;
前高1:REF(H,BARSLAST(B1)),COLORff00ff,linethick2;
A12:=BACKSET(BARSTATUS=2,LLVBARS(L,N1)+1);
B12:=A12>REF(A12,1);
前低1:REF(L,BARSLAST(B12)),COLORff00ff,linethick2;
DRAWTEXT(BARSTATUS=2,前低1,''+NUMTOSTRN(前低1,2)),COLORWHITE;
F12:((前高1-前低1)*0.382)+前低1,COLORff00ff,DOTLINE{LINEDASHDOT};
DRAWTEXT(BARSTATUS=2,F12,''+NUMTOSTRN(F12,2)),COLORff00ff,align2;
DRAWTEXT(BARSLAST(B1)>BARSLAST(B12) and BARSTATUS=2,F12,'(0.382)'),COLORff00ff;
DRAWTEXT(BARSLAST(B1)<BARSLAST(B12) and BARSTATUS=2,F12,'(0.618)'),COLORff00ff;
F13:((前高1-前低1)*0.5)+前低1,COLORRED;
DRAWTEXT(BARSTATUS=2,F13,''+NUMTOSTRN(F13,2)),COLORff00ff,align2;
F14:((前高1-前低1)*0.618)+前低1,COLORff00ff,DOTLINE{LINEDASHDOT};
DRAWTEXT(BARSTATUS=2,F14,''+NUMTOSTRN(F14,2)),COLORff00ff,align2;
DRAWTEXT(BARSLAST(B1)>BARSLAST(B12) and BARSTATUS=2,F14,'(0.618)'),COLORff00ff;
DRAWTEXT(BARSLAST(B1)<BARSLAST(B12) and BARSTATUS=2,F14,'(0.382)'),COLORff00ff;
MM1:=REF(EMA(C,3),3);
MM2:=REF(EMA(C,7),5);
MM3:=REF(EMA(C,25),5);
D3×3:MM1,COLORC08000,LINETHICK1;
D7×5:MM2,COLORRED,LINETHICK1;
D25×5:MM3,COLORBLUE,LINETHICK1;
|