通达信自动手动机构操盘变色带
结构带开关:=1;
顶底开关:=10;
自动预测周期:=5;
全画开关 :=6;
微调开关:=5;
AR1:=BARSCOUNT(C);
AR2:=CONST(AR1);
AR3:=AR2-AR1;
K线计数:AR3+1,NODRAW,COLORYELLOW;
XA:=(3*CLOSE+LOW+OPEN+HIGH)/6;
XA_1:=IF(结构带开关=1,XA,DRAWNULL);
B:(20*XA_1+19*REF(XA_1,1)+18*REF(XA_1,2)+17*REF(XA_1,3)+16*REF(XA_1,4)+15*REF(XA_1,5)+14*REF(XA_1,6)+13*REF(XA_1,7)+12*REF(XA_1,8)+11*REF(XA_1,9)+10*REF(XA_1,10)+9*REF(XA_1,11)+8*REF(XA_1,12)+7*REF(XA_1,13)+6*REF(XA_1,14)+5*REF(XA_1,15)+4*REF(XA_1,16)+3*REF(XA_1,17)+2*REF(XA_1,18)+REF(XA_1,20))/210,COLORMAGENTA,LINETHICK3;
D:MA(B,15),COLORFFFF00,LINETHICK3;
DRAWBAND(B,RGB(190,94,245),D,RGB(69,201,11));
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
KDJA :=3*SMA((CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100,3,1)-2*SMA(SMA((CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100,3,1),3,1),NODRAW;
STICKLINE(顶底开关>0 AND (KDJA >=90),CLOSE,OPEN,3,0),COLORYELLOW;
STICKLINE(顶底开关>0 AND (KDJA <=10),CLOSE,OPEN,3,0),COLORBLUE;
XD:=B>D;
XY:=H>=B AND C>O AND L>D AND L<=B;
STICKLINE(XD AND XY,OPEN,CLOSE,3,0),COLORLIRED;
DRAWICON(XY AND XD,LOW,23);
A1:=(REF(HIGH,自动预测周期)=HHV(HIGH,(自动预测周期+1)));
B1:=FILTER(A1,自动预测周期);
C1:=BACKSET(B1,(自动预测周期+1));
D1:=FILTER(C1,自动预测周期);
A2:=(REF(LOW,自动预测周期)=LLV(LOW,(自动预测周期+1)));
B2:=FILTER(A2,自动预测周期);
C2:=BACKSET(B2,(自动预测周期+1));
D2:=FILTER(C2,自动预测周期);
E1:=(REF(LLV(LOW,自动预测周期),1)+REF(HHV(HIGH,自动预测周期),1))/2;
E2:=(HIGH+LOW)/2;
H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;
H2:=D1 AND NOT(D2 AND E1>=E2);
L1:=D2 AND NOT(D1 AND E1=E2);
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);
A3:=H;
B3:=REF(H,REF(BARSLAST(HD),1)+1)>REF(H,REF(BARSLAST(HD),1)+2+REF(BARSLAST(HD),REF(BARSLAST(HD),1)+2));
D3:=A3 AND B3 AND HD;
E3:=BACKSET(D3,REF(BARSLAST(HD),1)+2);
HH:=E3>REF(E3,1);
A4:=L>REF(L,REF(BARSLAST(LD),1)+1);
B4:=REF(L,REF(BARSLAST(LD),1)+1); D4:=A4 AND B4 AND LD;
E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2);
LL:=E4>REF(E4,1);
H3:=HH OR ISLASTBAR OR BARSCOUNT(C)=1;
X3:=REF(BARSLAST(H3),1)+1;
F3:=BACKSET(H3 AND COUNT(LL,X3)>0,LLVBARS(IF(LL,L,POW(10,20)),X3));
G3:=F3>REF(F3,1);
I3:=BACKSET(G3,2);
LZ:=I3>REF(I3,1);
L4:=LZ OR ISLASTBAR OR BARSCOUNT(C)=1;
X4:=REF(BARSLAST(L4),1)+1;
F4:=BACKSET(L4 AND COUNT(HH,X4)>0,HHVBARS(IF(HH,H,-POW(10,20)),X4));
G4:=F4>REF(F4,1);
I4:=BACKSET(G4,2);
HZ:=I4>REF(I4,1);
K1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HZ),BARSLAST(LZ))+1);
K2:=K1>REF(K1,1);
UU:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);
VV:=UU>REF(UU,1);
WW:=BACKSET(VV,REF(BARSLAST(LD),1)+2);
XX:=WW>REF(WW,1);
UU2:=BACKSET(ISLASTBAR,BARSLAST(HD)+1);
VV2:=UU2>REF(UU2,1);
WW2:=BACKSET(VV2,REF(BARSLAST(HD),1)+2);
XX2:=WW2>REF(WW2,1);
{全画}
IF(全画开关=1,DRAWLINE(LD,L,HD,H,0),DRAWNULL)LINETHICK1,DOTLINE,COLOR0000FF;
IF(全画开关=1,DRAWLINE(HD,H,LD,L,0),DRAWNULL)LINETHICK1,DOTLINE,COLOR00FF00;
K:=CURRBARSCOUNT,NODRAW;
DRAWNUMBER(全画开关=1 AND HD,H,K),COLORLIRED,DRAWABOVE;
DRAWNUMBER(全画开关=1 AND LD,L,K),COLORFFFF00;
高点:=BARSLAST(HD);
低点:=BARSLAST(LD);
J1:=BACKSET(ISLASTBAR,MIN(高点,低点)+1);
J2:=J1>REF(J1,1);
高位价:=IF(微调开关=1,REF(REF(H,高点),1),DRAWNULL)COLORRED,NODRAW;
低位价:=IF(微调开关=1,REF(REF(L,低点),1),DRAWNULL)COLORGREEN,NODRAW;
H11:=高位价,NODRAW;
H12:=低位价,NODRAW;
L22:=DRAWNULL,NODRAW;
VVC1:=IF(高点<低点,H11,L22),NODRAW;
VVC2:=IF(LOW>低位价,H11,L22),NODRAW;
CL3:=VVC1 AND VVC2,COLOR00FFFF,NODRAW;
两点买入成立:=CL3,NODRAW;
高位价1:=IFC(CL3,H11,L22);
低位价1:=IFC(CL3,H12,L22);
VAR1:=高位价1/低位价1;
VAR2:=SQRT(SQRT(VAR1));
VAR3:=SQRT(VAR1);
VAR4:=VAR3+VAR2-1;
VAR5:=高位价1/VAR2;
VAR6:=高位价1/VAR3;
VAR7:=高位价1/VAR4;
VAR8:=REFDATE(HHV(H,高点+1),DATE);
VAR9:=REFDATE(LLV(L,低点+1),DATE);
买C1:=CONST(VAR5),NODRAW;
买C2:=CONST(VAR6),NODRAW;
买C3:=CONST(VAR7),NODRAW;
买入C1:DRAWLINE(VV2,CONST(买C1),CURRBARSCOUNT=1,买C1,1),COLORFF8800,DOTLINE;
买入C2:DRAWLINE(VV2,CONST(买C2),CURRBARSCOUNT=1,买C2,1),COLORFF8800,DOTLINE;
买入C3:DRAWLINE(VV2,CONST(买C3),CURRBARSCOUNT=1,买C3,1),COLORFF8800,DOTLINE;
DRAWTEXT(VV2,买C1,VARCAT('买C1=',VAR2STR(买C1,2))),COLORWHITE;
DRAWTEXT(VV2,买C2,VARCAT('买C2=',VAR2STR(买C2,2))),COLORWHITE;
DRAWTEXT(VV2,买C3,VARCAT('买C3=',VAR2STR(买C3,2))),COLORWHITE;
DRAWTEXT(VV,L,VARCAT('(低位)',VAR2STR(L,2))),COLORGREEN;
DRAWTEXT(VV2,H,VARCAT('(高位)',VAR2STR(H,2))),COLORRED;
STICKLINE(VV2,H,CONST(VAR7),0,-1),COLORFF8800;
IFC(CL3,DRAWLINE(VV,L,VV2,H,0),DRAWNULL),COLORFF8800,LINETHICK3;
未来函数检测结果如下:
该公式包含未来函数:BACKSET
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
结构带开关赋值:1
顶底开关赋值:10
自动预测周期赋值:5
全画开关 :=6
微调开关赋值:5
AR1赋值:C的有效数据周期数
AR2赋值:CONST(AR1)
AR3赋值:AR2-AR1
输出K线计数:AR3+1,NODRAW,COLORYELLOW
XA赋值:(3*收盘价+最低价+开盘价+最高价)/6
如果结构带开关=1返回XA否则返回DRAWNULL
输出B:(20*XA_1+19*1日前的XA_1+18*2日前的XA_1+17*3日前的XA_1+16*4日前的XA_1+15*5日前的XA_1+14*6日前的XA_1+13*7日前的XA_1+12*8日前的XA_1+11*9日前的XA_1+10*10日前的XA_1+9*11日前的XA_1+8*12日前的XA_1+7*13日前的XA_1+6*14日前的XA_1+5*15日前的XA_1+4*16日前的XA_1+3*17日前的XA_1+2*18日前的XA_1+20日前的XA_1)/210,画洋红色,LINETHICK3
输出D:B的15日简单移动平均,COLORFFFF00,LINETHICK3
DRAWBAND(B,RGB(190,94,245),D,RGB(69,201,11))
DRAWKLINE(最高价,开盘价,最低价,收盘价)
KDJA :=3*SMA((收盘价-9日内最低价最低值)/(9日内最高价最高值-9日内最低价最低值)*100,3,1)-2*SMA(SMA((收盘价-9日内最低价最低值)/(9日内最高价最高值-9日内最低价最低值)*100,3,1),3,1),NODRAW
STICKLINE(顶底开关>0 AND (KDJA >=90),收盘价,开盘价,3,0),COLORYELLOW
STICKLINE(顶底开关>0 AND (KDJA <=10),收盘价,开盘价,3,0),COLORBLUE
XD赋值:B>D
XY赋值:H>=B AND C>O AND L>D AND L<=B
当满足条件XD AND XY时,在开盘价和收盘价之间画柱状线
当满足条件XY AND XD时,在最低价和23之间画图标
A1赋值:(自动预测周期日前的最高价=HHV(最高价,(自动预测周期+1)))
B1:=A1的自动预测周期过滤
C1赋值:BACKSET(B1,(自动预测周期+1))
D1:=C1的自动预测周期过滤
A2赋值:(自动预测周期日前的最低价=LLV(最低价,(自动预测周期+1)))
B2:=A2的自动预测周期过滤
C2赋值:BACKSET(B2,(自动预测周期+1))
D2:=C2的自动预测周期过滤
E1赋值:(REF(自动预测周期日内最低价最低值,1)+REF(自动预测周期日内最高价最高值,1))/2
E2赋值:(最高价+最低价)/2
H1赋值:(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR 收盘价的有效数据周期数=1
H2赋值:D1 AND NOT(D2 AND E1>=E2)
L1赋值:D2 AND NOT(D1 AND E1=E2)
X1赋值:REF(上次H1距今天数,1)+1
如果L1返回最低价否则返回10000
G1赋值:F1>1日前的F1
I1赋值:BACKSET(G1,2)
LD赋值:I1>1日前的I1
L2赋值:LD OR ISLASTBAR OR 收盘价的有效数据周期数=1
X2赋值:REF(上次L2距今天数,1)+1
如果H2返回最高价否则返回0
G2赋值:F2>1日前的F2
I2赋值:BACKSET(G2,2)
HD赋值:I2>1日前的I2
A3赋值:H
B3:=REF(H,REF(上次HD距今天数,1)+1)>REF(H,REF(上次HD距今天数,1)+2+REF(上次HD距今天数,REF(上次HD距今天数,1)+2))
D3:=A3 AND B3 AND HD
E3赋值:BACKSET(D3,REF(上次HD距今天数,1)+2)
HH赋值:E3>1日前的E3
A4赋值:L>REF(L,REF(上次LD距今天数,1)+1)
B4:=REF(L,REF(上次LD距今天数,1)+1)
D4:=A4 AND B4 AND LD
E4赋值:BACKSET(D4,REF(上次LD距今天数,1)+2)
LL赋值:E4>1日前的E4
H3赋值:HH OR ISLASTBAR OR C的有效数据周期数=1
X3赋值:REF(上次H3距今天数,1)+1
F3赋值:BACKSET(H3 AND 统计X3日满足LL的天数>0,LLVBARS(IF(LL,L,POW(10,20)),X3))
G3赋值:F3>1日前的F3
I3赋值:BACKSET(G3,2)
LZ赋值:I3>1日前的I3
L4赋值:LZ OR ISLASTBAR OR C的有效数据周期数=1
X4赋值:REF(上次L4距今天数,1)+1
F4赋值:BACKSET(L4 AND 统计X4日满足HH的天数>0,HHVBARS(IF(HH,H,-POW(10,20)),X4))
G4赋值:F4>1日前的F4
I4赋值:BACKSET(G4,2)
HZ赋值:I4>1日前的I4
K1赋值:BACKSET(ISLASTBAR,MIN(上次HZ距今天数,BARSLAST(LZ))+1)
K2赋值:K1>1日前的K1
UU赋值:BACKSET(ISLASTBAR,上次LD距今天数+1)
VV赋值:UU>1日前的UU
WW赋值:BACKSET(VV,REF(上次LD距今天数,1)+2)
XX赋值:WW>1日前的WW
UU2:=BACKSET(ISLASTBAR,上次HD距今天数+1)
VV2:=UU2>1日前的UU2
WW2:=BACKSET(VV2,REF(上次HD距今天数,1)+2)
XX2赋值:WW2>1日前的WW2
{全画}
IF(全画开关=1,DRAWLINE(LD,L,HD,H,0),DRAWNULL)LINETHICK1,DOTLINE,COLOR0000FF
IF(全画开关=1,DRAWLINE(HD,H,LD,L,0),DRAWNULL)LINETHICK1,DOTLINE,COLOR00FF00
K赋值:CURRBARSCOUNT,NODRAW
DRAWNUMBER(全画开关=1 AND HD,H,K),COLORLIRED,DRAWABOVE
DRAWNUMBER(全画开关=1 AND LD,L,K),COLORFFFF00
高点赋值:上次HD距今天数
低点赋值:上次LD距今天数
J1赋值:BACKSET(ISLASTBAR,高点和低点的较小值+1)
J2赋值:J1>1日前的J1
高位价赋值:IF(微调开关=1,高点日前的H,1),DRAWNULL)COLORRED,NODRAW
低位价赋值:IF(微调开关=1,低点日前的L,1),DRAWNULL)画绿色,NODRAW
H11:=高位价,NODRAW
H12:=低位价,NODRAW
L22:=DRAWNULL,NODRAW
如果高点<低点返回H11否则返回L22
如果最低价>低位价返回H11否则返回L22
CL3赋值:VVC1 AND VVC2,COLOR00FFFF,NODRAW
两点买入成立赋值:CL3,NODRAW
高位价1:=IFC(CL3,H11,L22)
低位价1:=IFC(CL3,H12,L22)
VAR1赋值:高位价1/低位价1
VAR2赋值:SQRT(SQRT(VAR1))
VAR3赋值:SQRT(VAR1)
VAR4赋值:VAR3+VAR2-1
VAR5赋值:高位价1/VAR2
VAR6赋值:高位价1/VAR3
VAR7赋值:高位价1/VAR4
VAR8赋值:REFDATE(高点+1日内H最高值,DATE)
VAR9赋值:REFDATE(低点+1日内L最低值,DATE)
买C1赋值:CONST(VAR5),NODRAW
买C2赋值:CONST(VAR6),NODRAW
买C3赋值:CONST(VAR7),NODRAW
买入输出C1:DRAWLINE(VV2,CONST(买C1),CURRBARSCOUNT=1,买C1,1),COLORFF8800,DOTLINE
买入输出C2:DRAWLINE(VV2,CONST(买C2),CURRBARSCOUNT=1,买C2,1),COLORFF8800,DOTLINE
输出买入C3:DRAWLINE(VV2,CONST(买C3),CURRBARSCOUNT=1,买C3,1),COLORFF8800,DOTLINE
DRAWTEXT(VV2,买C1,VARCAT('买C1=',VAR2STR(买C1,2))),画白色
DRAWTEXT(VV2,买C2,VARCAT('买C2=',VAR2STR(买C2,2))),画白色
DRAWTEXT(VV2,买C3,VARCAT('买C3=',VAR2STR(买C3,2))),画白色
DRAWTEXT(VV,L,VARCAT('(低位)',VAR2STR(L,2))),画绿色
DRAWTEXT(VV2,H,VARCAT('(高位)',VAR2STR(H,2))),COLORRED
STICKLINE(VV2,H,CONST(VAR7),0,-1),COLORFF8800
IFC(CL3,DRAWLINE(VV,L,VV2,H,0),DRAWNULL),COLORFF8800,LINETHICK3