通达信M头W底预测主图指标公式
M前低:=0;M前高:=0;M后低:=0;M后高:=0;
W前高:=0;W前低:=0;W后高:=0;W后低:=0;自动显示根数:=5;
DRAWTEXT_FIX(1,0.92,0.01,1,'说明:双击鼠标出现十字浮标,移动浮标到选定的M或W的前高、前低、后高、后低的位置,在标题栏的“k线根数”处就可看到各点的K线数值,然后按ALT+T键,弹出参数调整窗,将m头或M底的各个点的K线数值填进相应的栏,填好后点关闭窗口即可。'),COLORYELLOW;
DRAWTEXT_FIX(1,0.40,0.06,1,'注意:M头的选点M前高(B)点>=M后高(D)点; W底的选点W前低(B)点<=W后低(D)点。'),COLORYELLOW;
AR1:=BARSCOUNT(C);
AR2:=CONst(AR1);
AR3:=AR2-AR1;
K线根数:AR3+1,NODRAW,COLORYELLOW;
{自动显示根数}
DRAWKLINE(H,O,L,C);
A13 := (REF(HIGH,自动显示根数) = HHV(HIGH,(自动显示根数 + 1)));
B13 := FILTER(A13,自动显示根数);
C1 := BacKSET(B13,(自动显示根数 + 1));
D1 := FILTER(C1,自动显示根数);
A21 := (REF(LOW,自动显示根数) = LLV(LOW,(自动显示根数 + 1)));
B21 := FILTER(A21,自动显示根数);
C21 := BACKSET(B21,(自动显示根数 + 1));
D2 := FILTER(C21,自动显示根数);
E1 := ((REF(LLV(LOW,自动显示根数),1) + REF(HHV(HIGH,自动显示根数),1)) / 2);
QL1:=REF(L,M前低-1);
QG1:=REF(H,M前高-1);
HL1:=REF(L,M后低-1);
HG1:=REF(H,M后高-1);
前低M:=QL1,COLORGREEN,NODRAW;
前高M:=QG1,COLORGREEN,NODRAW;
后低M:=HL1,COLORGREEN,NODRAW;
后高M:=HG1,COLORGREEN,NODRAW;
H11:=QG1,NODRAW;
H12:=HG1,NODRAW;
H13:=QL1,NODRAW;
H14:=HL1,NODRAW;
L22:=DRAWNULL,NODRAW;
VVH1:=IFC(QG1>=HG1,H11,L22),NODRAW;
VVH2:=IF(QG1>=HG1,H12,L22),NODRAW;
VVH3:=IF(QG1>=HG1,H13,L22),NODRAW;
VVH4:=IF(QG1>=HG1,H14,L22),NODRAW;
CL1:=VVH1 AND VVH2 AND VVH3 AND VVH4,COLOR00FFFF,NODRAW;
M头买入成立:=CL1,NODRAW;
VVL1:=IF(QG1<HG1,L22,H11),NODRAW;
VVL2:=IF(QG1<HG1,L22,H12),NODRAW;
VVL3:=IF(QG1<HG1,L22,H13),NODRAW;
VVL4:=IF(QG1>HG1,L22,H14),NODRAW;
BCL1:=VVL1 AND VVL2 AND VVL3 AND VVL4,COLOR00FFFF,NODRAW;
M头买入不成立:=BCL1,NODRAW;
QG1A:=IFC(CL1,H11,L22);
HG1A:=IFC(CL1,H12,L22);
QL1A:=IFC(CL1,H13,L22);
HL1A:=IFC(CL1,H14,L22);
VAR1:=HL1A*HL1A/HG1A,NODRAW;
VAR2:=QL1A*HL1A/QG1A,NODRAW;
VAR3:=(VAR1+VAR2)/2,NODRAW;
买E1:DRAWLINE(CURRBARSCOUNT=(M后高), CONST(VAR1), CURRBARSCOUNT=1, VAR1,1),COLORFF8800,DOTLINE;
买E2:DRAWLINE(CURRBARSCOUNT=(M后高), CONST(VAR3), CURRBARSCOUNT=1, VAR3,1),COLORFF8800,DOTLINE;
买E3:DRAWLINE(CURRBARSCOUNT=(M后高), CONST(VAR2), CURRBARSCOUNT=1, VAR2,1),COLORFF8800,DOTLINE;
DRAWTEXT(CURRBARSCOUNT=M后高,买E1,VARCAT('买E1:',VAR2STR(买E1,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=M后高,买E2,VARCAT('买E2:',VAR2STR(买E2,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=M后高,买E3,VARCAT('买E3:',VAR2STR(买E3,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=M前低,L,VARCAT('M前低【A】',VAR2STR(L,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=M前高,H,VARCAT('M前高【B】',VAR2STR(H,2))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=M后低,L,VARCAT('M后低【C】',VAR2STR(L,2))),COLORFF8800;
DRAWTEXT(CURRBARSCOUNT=M后高,H,VARCAT('M后高【D】',VAR2STR(H,2))),COLORmaGENTA;
IFC(CL1,DRAWLINE(CURRBARSCOUNT=(M前低),L,CURRBARSCOUNT=(M前高),H,0),DRAWNULL)COLORYELLOW,LINETHICK2;
IFC(CL1,DRAWLINE(CURRBARSCOUNT=(M前高),H,CURRBARSCOUNT=(M后低),L,0),DRAWNULL)COLORYELLOW,LINETHICK2;
IFC(CL1,DRAWLINE(CURRBARSCOUNT=(M后低),L,CURRBARSCOUNT=(M后高),H,0),DRAWNULL)COLORYELLOW,LINETHICK2;
IFC(CL1,DRAWLINE(CURRBARSCOUNT=(M前低),L,CURRBARSCOUNT=(M后低),L,0),DRAWNULL)COLORFF8800,DOTLINE;
IFC(CL1,DRAWLINE(CURRBARSCOUNT=(M后高),H,CURRBARSCOUNT=(M后高-12),买E3,0),DRAWNULL)COLORFF8800,DOTLINE;
DRAWLINE(CURRBARSCOUNT=(M后低),L,CURRBARSCOUNT=(M后高),(买E3),0),COLORFF8800,DOTLINE;
STICKLINE(CURRBARSCOUNT=(M后高),H,CONST(VAR2),0,-1),COLORFF8800;
DRAWICON(CURRBARSCOUNT=M前高,H,39);
DRAWICON(CURRBARSCOUNT=M前低,L,38);
DRAWICON(CURRBARSCOUNT=M后高,H,39);
DRAWICON(CURRBARSCOUNT=M后低,L,38);
QG2:=REF(H,W前高-1);
QL2:=REF(L,W前低-1);
HG2:=REF(H,W后高-1);
HL2:=REF(L,W后低-1);
前高W:=QG2,COLORLIRED,NODRAW;
前低W:=QL2,COLORLIRED,NODRAW;
后高W:=HG2,COLORLIRED,NODRAW;
后低W:=HL2,COLORLIRED,NODRAW;
H113:=QG2,NODRAW;
H121:=HG2,NODRAW;
H131:=QL2,NODRAW;
H141:=HL2,NODRAW;
L221:=DRAWNULL,NODRAW;
VVJ1:=IF(QL2<=HL2,H113,L221),NODRAW;
VVJ2:=IF(QL2<=HL2,H121,L221),NODRAW;
VVJ3:=IF(QL2<=HL2,H131,L221),NODRAW;
VVJ4:=IF(QL2<=HL2,H141,L221),NODRAW;
CL2:=VVJ1 AND VVJ2 AND VVJ3 AND VVJ4,COLOR00FFFF,NODRAW;
w底卖出成立:=CL2,NODRAW;
VVG1:=IF(QL2>HL2,L221,H113),NODRAW;
VVG2:=IF(QL2>HL2,L221,H121),NODRAW;
VVG3:=IF(QL2>HL2,L221,H131),NODRAW;
VVG4:=IF(QL2>HL2,L221,H141),NODRAW;
BCL2:=VVG1 AND VVG2 AND VVG3 AND VVG4,COLOR00FFFF,NODRAW;
W底卖出不成立:=BCL2,NODRAW;
QG2A:=IFC(CL2,H113,L221);
HG2A:=IFC(CL2,H121,L221);
QL2A:=IFC(CL2,H131,L221);
HL2A:=IFC(CL2,H141,L221);
VAR11:=HG2A*HG2A/HL2A,NODRAW;
VAR21:=QG2A*HG2A/QL2A,NODRAW;
VAR31:=(VAR11+VAR21)/2,NODRAW;
卖E1:DRAWLINE(CURRBARSCOUNT=(W后低), CONST(VAR11), CURRBARSCOUNT=1,CONST(VAR11),1),COLORMAGENTA,DOTLINE;
卖E2:DRAWLINE(CURRBARSCOUNT=(W后低), CONST(VAR31), CURRBARSCOUNT=1,CONST(VAR31),1),COLORMAGENTA,DOTLINE;
卖E3:DRAWLINE(CURRBARSCOUNT=(W后低), CONST(VAR21), CURRBARSCOUNT=1,CONST(VAR21),1),COLORMAGENTA,DOTLINE;
DRAWTEXT(CURRBARSCOUNT=W后低,卖E1,VARCAT('卖E1:',VAR2STR(卖E1,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=W后低,卖E2,VARCAT('卖E2:',VAR2STR(卖E2,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=W后低,卖E3,VARCAT('卖E3:',VAR2STR(卖E3,2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=W前高,H,VARCAT('W前高【A】',VAR2STR(H,2))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=W前低,L,VARCAT('W前低【B】',VAR2STR(L,2))),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=W后高,H,VARCAT('W后高【C】',VAR2STR(H,2))),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=W后低,L,VARCAT('W后低【D】',VAR2STR(L,2))),COLORFF8800;
IFC(CL2,DRAWLINE(CURRBARSCOUNT=(W前高),H,CURRBARSCOUNT=(W前低),L,0),DRAWNULL)COLORLIRED,LINETHICK2;
IFC(CL2,DRAWLINE(CURRBARSCOUNT=(W前低),L,CURRBARSCOUNT=(W后高),H,0),DRAWNULL)COLORLIRED,LINETHICK2;
IFC(CL2,DRAWLINE(CURRBARSCOUNT=(W后高),H,CURRBARSCOUNT=(W后低),L,0),DRAWNULL)COLORLIRED,LINETHICK2;
IFC(CL2,DRAWLINE(CURRBARSCOUNT=(W前高),H,CURRBARSCOUNT=(W后高),H,0),DRAWNULL)COLORMAGENTA,DOTLINE;
IFC(CL2,DRAWLINE(CURRBARSCOUNT=(W后低),L,CURRBARSCOUNT=(W后低-12),卖E3,0),DRAWNULL)COLORMAGENTA,DOTLINE;
DRAWLINE(CURRBARSCOUNT=(W后高),H,CURRBARSCOUNT=(W后低),(卖E3),0),COLORMAGENTA,DOTLINE;
STICKLINE(CURRBARSCOUNT=(W后低),H,CONST(VAR21),0,-1),COLORMAGENTA;
DRAWICON(CURRBARSCOUNT=W前高,H,39);
DRAWICON(CURRBARSCOUNT=W前低,L,38);
DRAWICON(CURRBARSCOUNT=W后高,H,39);
DRAWICON(CURRBARSCOUNT=W后低,L,38);
P:=14;
WW:=(LLV(H,55)+HHV(L,55))/2;
WW2:=(C*4+L*3+H*2+O)/10;obv:=WW2;
A11:=REF(OBV,P)=HHV(OBV,2*P+1);
B11:=FILTER(A11,P);
C11:=BACKSET(B11,P+1);
D11:=FILTER(C11,P);
A22:=REF(OBV,P)=LLV(OBV,2*P+1);
B22:=FILTER(A22,P);
C22:=BACKSET(B22,P+1);
D22:=FILTER(C22,P);
A111:=REF(H,3)=HHV(H,2*6+1);
B111:=FILTER(A111,3);
C111:=BACKSET(B111,3+1);
D111:=FILTER(C111,3+1);
A112:=REF(L,3)=LLV(L,2*6+1);
B112:=FILTER(A112,3+1);
C112:=BACKSET(B112,3+1);
D112:=FILTER(C112,3);
E111:=(REF(LLV(L,2*3),1)+REF(HHV(H,2*3),1))/2;
E112:=(H+L)/2;
H111:=(D111 AND NOT(D112 AND E111>=E112)) OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
L111:=(D112 AND NOT(D111 AND E111<E112));
H112:=D111 AND NOT(D112 AND E111>=E112);
X111:=REF(BArslAST(H111),1)+1;
F111:=BACKSET(H111 AND COUNT(L111,X111)>0,LLVBARS(IF(L111,LOW,10000),X111));
G111:=F111>REF(F111,1);
I111:=BACKSET(G111,2);
LD:=I111>REF(I111,1);
L112:=LD OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
X112:=REF(BARSLAST(L112),1)+1;
F112:=BACKSET(L112 AND COUNT(H112,X112)>0,HHVBARS(IF(H112,HIGH,0),X112));
G112:=F112>REF(F112,1);
I112:=BACKSET(G112,2);
HD:=I112>REF(I112,1);
NOTEXT1:DRAWLINE(LD,L,HD,H,0),LINETHICK1,DOTLINE,COLORRED;
NOTEXT2:DRAWLINE(HD,H,LD,L,0),LINETHICK1,DOTLINE,COLOR00FF00;
J111:=BACKSET(BARSTATUS=2 ,MIN(BARSLAST(HD),BARSLAST(LD))+1);
J112:=J111>REF(J111,1);
预测走势:DRAWLINE(J112,IF(HD,H,L),BARSTATUS=2,IF(BARSLAST(HD)>BARSLAST(LD),H,L),0),COLORYELLOW,DOTLINE;
K:=CURRBARSCOUNT,NODRAW;
DRAWNUMBER(HD,H,K),COLORLIRED,DRAWAbovE;
DRAWNUMBER(LD,L,K),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=5,L*0.995,'5'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=10,L*0.995,'10'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=15,L*0.995,'15'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=20,L*0.995,'20'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=25,L*0.995,'25'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=30,L*0.995,'30'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=35,L*0.995,'35'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=40,L*0.995,'40'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=45,L*0.995,'45'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=50,L*0.995,'50'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=55,L*0.995,'55'),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=60,L*0.995,'60'),COLORYELLOW;