通達信關于混沌分形公式 附圖源碼, A1:=REF(H,2)=HHV(H,7) AND REF(H,2)>MAX(REF(H,1),H); B1:=FILTER(A1,2); C1:=BACKSET(B1,3); D1:=FILTER(C1,2);{高點} A2:=REF(L,2)=LLV(L,7) AND REF(L,2)<MIN(REF(L,1),L); B2:=FILTER(A2,2); C2:=BACKSET(B2,3); D2:=FILTER(C2,2);{低點} DRAWICON(D1,H*1.005,1); DRAWICON(D2,L*0.995,2); ================================================================ 主圖源碼,
A1:=REF(H,2)=HHV(H,7) AND REF(H,2)>MAX(REF(H,1),H); B1:=FILTER(A1,2); C1:=BACKSET(B1,3); D1:=FILTER(C1,2);{高點} A2:=REF(L,2)=LLV(L,7) AND REF(L,2)<MIN(REF(L,1),L); B2:=FILTER(A2,2); C2:=BACKSET(B2,3); D2:=FILTER(C2,2);{低點} --------------------------------------------------------------------------- E1:=(REF(LLV(LOW,2*2),1)+REF(HHV(HIGH,2*2),1))/2; E02:=(HIGH+LOW)/2; {高低點出現(xiàn)在同一K線上時可作取舍} H1:=(D1 AND NOT((D2 AND E1>=E02))) OR ISLASTBAR OR BARSCOUNT(CLOSE)=1; L1:=(D2 AND NOT((D1 AND E1<E02))); H2:=D1 AND NOT((D2 AND E1>=E02)); X1:=REF(BARSLAST(H1),1)+1; F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,LOW,10000),X1)); G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF(I1,1);{過濾后低點} L2:=LD OR ISLASTBAR OR BARSCOUNT(CLOSE)=1; X2:=REF(BARSLAST(L2),1)+1; F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2)); G2:=F2>REF(F2,1); I2:=BACKSET(G2,2); HD:=I2>REF(I2,1);{過濾后高點} ---所謂的過濾條件 ----------------------------------------------------------------------------- DRAWICON(HD,H*1.01,1); DRAWICON(LD,L*0.99,2); ----------------------------------------------------------------------------- 通達信關于混沌分形公式
|