通达信缠论趋势预测指标公式主图
{主图识妖}
YS1:=(HIGH+LOW+CLOSE*2)/4;
RK3:=EMA(YS1,10);
RK4:=STD(YS1,10);
RK5:=(YS1-RK3)*100/RK4;
RK6:=EMA(RK5,5);
RK7:=EMA(RK6,10);
涨:=EMA(RK6,10)+100/2-5,COLORRED;
跌:=EMA(涨,4),COLORWHITE;
决杀线:=MA(C,20),COLORFFFFFF;
VAR11D:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)
-2*SMA(SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1),3,1);
黑马线O:=EMA(VAR11D,5);
VAR12D:=(黑马线O-REF(黑马线O,1))/REF(黑马线O,1)*100;
熊线:=100*(HHV(HIGH,60)-CLOSE)/(HHV(HIGH,60)-LLV(LOW,60));
T1:=CROSS(黑马线O,熊线) AND 涨
AA:= CLOSE=OPEN AND HIGH LOW OR CLOSE=OPEN AND HIGH/LOW 1.03 OR CLOSE=OPEN AND CLOSE=LOW AND CLOSE HIGH OR REF(CLOSE,1)/REF(OPEN,1) 1.03 AND CLOSE/OPEN 0.97 AND OPEN REF(CLOSE,1) AND CLOSE REF(CLOSE,1) OR OPEN CLOSE AND OPEN/REF(C,1) = 1+4/100 AND CLOSE/OPEN =1-5/100 OR ABS(HIGH-REF(HIGH,1))/HIGH 0.001
OR OPEN =CLOSE AND ABS(HIGH-OPEN) =ABS(OPEN-LOW) OR CLOSE =OPEN AND ABS(HIGH-CLOSE) =ABS(CLOSE-LOW) OR OPEN REF(CLOSE,1) AND OPEN CLOSE ;
BB:=CLOSE =OPEN AND ABS(HIGH-OPEN) =ABS(OPEN-LOW) OR CLOSE =OPEN AND ABS(HIGH-CLOSE) =ABS(CLOSE-LOW);
CCB:=AA OR BB;
DDB:=涨 REF(涨,1) AND C O AND C/REF(C,1) 1.099;
王五:=涨 170 AND CCB AND DDB AND COUNT(C/REF(C,1) 1.090 AND C O,20) =4
麻子:=涨 170 AND COUNT(C/REF(C,1) 1.093,15) =5 OR BARSLASTCOUNT(C/REF(C,1) =1.093) =5 AND C O;
K3:= ABS(L-O) ABS(O-C) AND C/REF(C,1) 1.093 AND REF(C,1)/REF(C,2) 1.093 AND REF(C,2)/REF(C,3) 1.093 AND REF(C,3)/REF(C,4) 1.093 AND REF(C,4)/REF(C,5) 1.093 AND REF(C,5)/REF(C,6) 1.093 AND NOT(C=O AND C/REF(C,1) 1.099) ;
K4:=C/REF(C,1) 1.093 AND V REF(V,1) AND REF(C,1)/REF(C,2) 1.093 AND COUNT(C/REF(C,1) 1.093,20)
VVR1:=王五 OR 麻子 AND C MA(C,5) AND C MA(C,30) AND MA(C,5) MA(C,10) AND C MA(C,60) AND REF(C,1)/REF(C,2) 1.08 AND C/REF(C,1) C/REF(O,1);
VVR2:=(HIGH-LLV(L,90))/LLV(L,90)*100 120 AND 黑马线O =REF(黑马线O,1) AND 黑马线O 95 AND C/REF(C,1) 1.099;
VVR3:=黑马线O 100 AND C O AND C/REF(C,1) C/REF(O,1);
VDR:=VVR1 OR VVR2 OR VVR3;
VDT:=K3 OR K4 AND COUNT(C/REF(C,1) 1.05,10) =4 AND SUM(VDR,12)
DRAWICON(K3 OR K4 AND COUNT(C/REF(C,1) 1.05,10) =4 AND SUM(VDR,12) 1 AND SUM(VDT,20) 2 ,O,23);
{近期顶底COLORLIBLUE}
N:=(L,10),COLORGREEN,LINETHICK2;
TS:=BARSLAST(CURRBARSCOUNT=11);
IF(TS =0,CONST(REF(C,N)),DRAWNULL);
IF(TS 0,CONST(REF(C,N)),DRAWNULL);
N1:=150;判断高低:=5;
高H:=REF(HHV(H,N1),判断高低);
近期顶:REFDATE(高H,DATE),COLORRED,LINETHICK1,DOTLINE;
最顶:=REFDATE(近期顶,DATE),NODRAW;
{近期顶底2}
出:=最顶=H AND ((C-L) (O-C) OR (O-L) (C-O)),NODRAW;
STICKLINE(出,C,O,3,0),COLORLIBLUE;
STICKLINE(出,C,O,2,0),COLORLIBLUE;
低H:=REF(LLV(L,N),判断高低);
近期底:REFDATE(低H,DATE),COLORYELLOW,LINETHICK1,DOTLINE;
{预测赢家主图}
A1:=REF(H,3)=HHV(H,2*6+1);
B1:=FILTER(A1,3);
C1:=BACKSET(B1,3+1);
D1:=FILTER(C1,3+1);
A2:=REF(L,3)=LLV(L,2*10+1);
B2:=FILTER(A2,3+1);
C2:=BACKSET(B2,3+1);
D2:=FILTER(C2,3);
E1:=(REF(LLV(L,2*3),1)+REF(HHV(H,2*3),1))/2;
E2:=(H+L)/2;
H1:=(D1 AND NOT(D2 AND E1 =E2)) OR BARSTATUS=2 OR BARSCOUNT(C)=1;
L1:=(D2 AND NOT(D1 AND E1 E2));
H2:= D1 AND NOT(D2 AND E1 =E2);
X1:=REF(BARSLAST(H1),1)+1;
F1:=BACKSET(H1 AND COUNT(L1,X1) 0,LLVBARS(IF(L1,L,10000),X1));
G1:=F1 REF(F1,1);
I1:=BACKSET(G1,2);
LD:=I1 REF(I1,1);
L2:=LD OR BARSTATUS=2 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);
DRAWLINE(LD,L,HD,H,0),COLORRED;
DRAWLINE(HD,H,LD,L,0),COLORGREEN;
J1:=BACKSET(BARSTATUS=2 ,MIN(BARSLAST(HD),BARSLAST(LD))+1);
J2:=J1 REF(J1,1);
DRAWLINE(J2,IF(HD,H,L),BARSTATUS=2 ,IF(BARSLAST(HD) BARSLAST(LD),H,L),0),DOTLINE,COLORWHITE;{=========}
C点:=BARSLAST(LD);
DRAWTEXT(LD AND BARSLAST(HD) BARSLAST(REF(LD,1)) ,L-0.1,'A'),COLORRED;
DRAWTEXT(HD,H+0..058,'B'),COLORGREEN;
高:=5 ;
低:=10;
高选:=1 ;
低选:=1 ;
波2:=1 ;
PURC:=CONST(FINDHIGH(H,0,高*5,高选));
PLZ :=CONST(BARSLAST(PURC=H))+1;
顶X :=CONST(IF(PLZ=1,H,REF(H,PLZ-1)));
QQT :=CONST(FINDLOW(L,0,低*10,低选));
PLL :=CONST(BARSLAST(QQT=L))+1;
低X :=CONST(IF(PLL=1,L,REF(L,PLL-1)));
DRAWKLINE(H,O,L,C);
顶点:=顶X,COLORRED;
底点:=低X,COLORRED;
波动速率:=100*((顶X-低X)/(IF(PLL PLZ,低X,顶X)))/(PLL-PLZ),NODRAW,COLORMAGENTA;
波动幅度:=((顶X-低X)/(IF(PLL PLZ,低X,顶X)))*100;
波动价位:=(顶X-低X)*(IF(PLL PLZ,1,-1));
BPURC :=CONST(FINDHIGH(H,0,(IF(波1 0,波1,IF(PLZ PLL,高,低)))*5,波2));BPLZ:=CONST(BARSLAST(BPURC=H))+1;
BQQT :=CONST(FINDLOW (L,0,(IF(波1 0,波1,IF(PLZ PLL,高,低)))*5,波2));BPLL:=CONST(BARSLAST(BQQT =L))+1;
BLC1 :=CONST(FINDHIGH(H,0,(IF(波1 0,波1,IF(PLZ PLL,高,低)))*5,波2));BLC2:=CONST(BARSLAST(BPURC=H))+1;
BLC顶X:=CONST(IF(BPLZ=1,H,REF(H,BPLZ-1)));
BLC3 :=CONST(FINDLOW(L,0,(IF(波1 0,波1,IF(PLZ PLL,高,低)))*5,波2));
B6C4 :=CONST(BARSLAST(BQQT=L))+1;
BLC低X:=CONST(IF(BPLL=1,L,REF(L,BPLL-1)));
BASE:=IF(波动速率 0,BLC顶X,BLC低X),COLORRED;
BLCX:=IF(波动速率 0,-1,1);
BLCZ:=(顶点-底点)*(IF(PLL PLZ,1,-1));
B12 :=BASE+(BLCZ*0.775),COLORRED;
B14 :=BASE+(BLCZ*0.868),COLORRED;
B200:=BASE+(BLCZ*1 ),COLORRED;
XZDD:=IF(PLL PLZ,BPLL,BPLZ);
STICKLINE(CURRBARSCOUNT=XZDD ,BASE,B200,0,0),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=XZDD,B12 ,'---------------------------C1'),COLORC0FF7F;
DRAWTEXT(CURRBARSCOUNT=XZDD,B14 ,'---------------------------C2'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=XZDD,B200,'---------------------------C3'),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=10,B12 ,CON2STR(B12 ,2)),COLORC0FF7F;
DRAWTEXT(CURRBARSCOUNT=10,B14 ,CON2STR(B14 ,2)),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=10,B200,CON2STR(B200,2)),COLORGREEN;
{买卖变色}
BC:=ZIG(3,7.877)*250;
G:=MA(BC,2);
D:=CROSS(BC,G);
W:=CROSS(G,BC);
E:=REF(INDEXC,1);
F:=SMA(MAX(INDEXC-E,0),3,1)/SMA(ABS(INDEXC-E),3,1);
VAR10:=F AND F
VAR11:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
VAR12:=SMA(VAR11,3,1);
VAR13:=SMA(VAR12,3,1);
VAR14:=VAR13 AND VAR13
DRAWTEXT(FILTER(D=1,5),LOW-0.1,' '),COLORYELLOW;
DRAWTEXT(W=1,HIGH*1.02,' '),COLORGREEN;
STICKLINE(W=1,O,C,3,0),COLORBLUE;
STICKLINE(D=1,O,C,3,0),COLORYELLOW;
{变色K线5.242;7.877;3.1872}
VAR1:=SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),26);
VAR2:=HIGH-REF(HIGH,1);
VAR3:=REF(LOW,1)-LOW;
VAR4:=SUM(IF(VAR2 0 AND VAR2 VAR3,VAR2,0),26);
VAR5:=SUM(IF(VAR3 0 AND VAR3 VAR2,VAR3,0),26);
VAR6:=VAR4*100/VAR1;
VAR7:=VAR5*100/VAR1;
VAR8:=MA(ABS(VAR7-VAR6)/(VAR7+VAR6)*100,15);
VAR9:=(VAR8+REF(VAR8,15))/2;
BUY1:=ZIG(3,7.877);
SELL1:=MA(BUY1,2);
DRAWICON(CROSS(BUY1,SELL1),LOW*1,1);
DRAWICON(CROSS(SELL1,BUY1),H*1.03.0,2);
STICKLINE(BUY1 SELL1 AND O =C,C,O,-1,0),COLOR000091;
STICKLINE(BUY1 SELL1 AND O =C,L,H,0,0), COLOR000091;
STICKLINE(BUY1 SELL1 AND O =C,O,C,-1,1),COLOR468C00;
STICKLINE(BUY1 SELL1 AND O =C,O,L,0,1), COLOR468C00;
STICKLINE(BUY1 SELL1 AND O =C,C,H,0,1), COLOR468C00;
系统最高价:REFDATE(HHV(H,92.99),DATE),DOTLINE,COLORGREEN;
系统最低价:REFDATE(LLV(L,92.99),DATE),DOTLINE,COLORRED;
GD:=CONST(FINDHIGH(H,0,系统最高价*30,1));
DD:=REFDATE(LLV(L,92.99),DATE)COLORWHITE,NODRAW;
GT:=CONST(BARSLAST(GD=H))+1;
DT:=CONST(BARSLAST(DD=L))+1;
DRAWTEXT(CURRBARSCOUNT=DT,系统最低价*0.988,STRCAT('----低',CON2STR(系统最低价,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=GT,系统最高价*0.988,STRCAT('----高',CON2STR(系统最高价,2))),COLORYELLOW;
{ }
NM:=350;
VAR1Z:=130;
VAR2Z:=0.191;
VAR3Z:=BARSLAST(CROSS(BACKSET(ISLASTBAR,LLVBARS(LOW,VAR1Z)+1),0.5));
VAR4Z:=REFV(LOW,VAR3Z);
VAR5Z:=ABS(LOW/VAR4Z-1)*100 VAR2Z;
前期低点:IF(VAR3Z =0,REF(LOW,VAR3Z),DRAWNULL),COLORGREEN,LINETHICK2;
STICKLINE(CROSS(BACKSET(ISLASTBAR,LLVBARS(LOW,VAR1Z)+1),0.5),CLOSE,OPEN,2,0),COLORYELLOW;
DRAWICON(VAR5Z,L*1.01,13);