通达信微调半对数主图指标 源码 附图
周期微调:=3;
高位C:=0;
低位D:=0;
手动开关:=1;
趋势线开关:=1;
顶底开关:=1;
DRAWTEXT_FIX(1,0.72,0.003,1,'说明: 如果自动选点不对,可按ALT+T键弹出参数调整窗,进行周期微调到符合点位,缺省值为“3”;顶底开关是开启或关闭黄色顶和蓝色底的信号之用。
高位C、低位D是手动输入K线根数,进行手动预测。'),COLORYELLOW;
AR1:=BARSCOUNT(C);
AR2:=CONST(AR1);
AR3:=AR2-AR1;
K线根数:AR3+1,NODRAW,COLORYELLOW;
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,2.5,0),COLOR0088FF;
STICKLINE(顶底开关>0 AND (KDJA >=90),H,L,0,0),COLOR0088FF;
STICKLINE(顶底开关>0 AND (KDJA <=10),CLOSE,OPEN,2.5,0),COLORFF0000;
STICKLINE(顶底开关>0 AND (KDJA <=10),H,L,0,0),COLORFF0000;
A1:=REF(HIGH,周期微调)=HHV(HIGH,2*3+1);
B1:=FILTER(A1,周期微调);
C1:=BACKSET(B1,周期微调+1);
D1:=FILTER(C1,周期微调);
A2:=REF(LOW,周期微调)=LLV(LOW,2*3+1);
B2:=FILTER(A2,周期微调);
C2:=BACKSET(B2,周期微调+1);
D2:=FILTER(C2,周期微调);
E1:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),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);
高点:=BARSLAST(HD);
低点:=BARSLAST(LD);
J1:=BACKSET(ISLASTBAR,MIN(高点,低点)+1);
J2:=J1>REF(J1,1);
IF(趋势线开关=1,DRAWLINE(LD,L,HD,H,0),DRAWNULL)LINETHICK1,DOTLINE,COLOR0000FF;
IF(趋势线开关=1,DRAWLINE(HD,H,LD,L,0),DRAWNULL)LINETHICK1,DOTLINE,COLORYELLOW;
K:=CURRBARSCOUNT,NODRAW;
DRAWNUMBER(趋势线开关=1 AND HD,H,K),COLORLIRED,DRAWABOVE;
DRAWNUMBER(趋势线开关=1 AND LD,L,K),COLORFFFF00;
高位价:REF(REF(H,高点),1),COLORRED,NODRAW;
低位价:REF(REF(L,低点),1),COLORGREEN,NODRAW;
GGA:=IFC(高点<低点 AND 高位价>低位价 AND LOW>=低位价,高位价,DRAWNULL);
LLA:=IFC(高点<低点 AND 高位价>低位价,低位价,DRAWNULL);
PB1A:=POW(LLA,0.382)*POW(GGA,0.618);
PB2A:=SQRT(LLA*GGA);
PB3A:=POW(LLA,0.618)*POW(GGA,0.382);
PB4A:=POW(LLA,0.875)*POW(GGA,0.125);
PB1:DRAWLINE(VV2,CONST(PB1A),CURRBARSCOUNT=1,CONST(PB1A),1),COLORFF8800,DOTLINE;
PB2:DRAWLINE(VV2,CONST(PB2A),CURRBARSCOUNT=1,CONST(PB2A),1),COLORFF8800,DOTLINE;
PB3:DRAWLINE(VV2,CONST(PB3A),CURRBARSCOUNT=1,CONST(PB3A),1),COLORFF8800,DOTLINE;
PB4:DRAWLINE(VV2,CONST(PB4A),CURRBARSCOUNT=1,CONST(PB4A),1),COLORFF8800,DOTLINE;
DRAWTEXT(VV2,CONST(PB1A),VARCAT('PB1=',VAR2STR(CONST(PB1A),2))),COLORWHITE;
DRAWTEXT(VV2,CONST(PB2A),VARCAT('PB2=',VAR2STR(CONST(PB2A),2))),COLORWHITE;
DRAWTEXT(VV2,CONST(PB3A),VARCAT('PB3=',VAR2STR(CONST(PB3A),2))),COLORWHITE;
DRAWTEXT(VV2,CONST(PB4A),VARCAT('PB4=',VAR2STR(CONST(PB4A),2))),COLORWHITE;
DRAWTEXT(VV,L,VARCAT('低位【A】',VAR2STR(L,2))),COLORGREEN;
DRAWTEXT(VV2,H,VARCAT('高位【B】',VAR2STR(H,2))),COLORRED;
STICKLINE(VV2,H,CONST(PB4A),0,0),COLORFF8800;
IFC(高点<低点 AND 高位价>低位价 AND LOW>=低位价,DRAWLINE(VV,L,VV2,H,0),DRAWNULL),COLORFF8800,LINETHICK2;
DRAWLINE(VV2,H,CURRBARSCOUNT=1,CONST(PB4A),0),COLORFF8800,DOTLINE;
DRAWICON(CURRBARSCOUNT=XX,L,38);
DRAWICON(CURRBARSCOUNT=VV2,H,39);
反弹高位:=REF(REF(H,高点),1),COLORRED,NODRAW;
反弹低位:=REF(REF(L,低点),1),COLORGREEN,NODRAW;
GGB:=IFC(高点>低点 AND 反弹高位>反弹低位 AND HIGH<=反弹高位,反弹高位,DRAWNULL);
LLB:=IFC(高点>低点 AND 反弹高位>反弹低位,反弹低位,DRAWNULL);
PS1B:=POW(GGB,0.382)*POW(LLB,0.618);
PS2B:=SQRT(GGB*LLB);
PS3B:=POW(GGB,0.618)*POW(LLB,0.382);
PS4B:=POW(GGB,0.875)*POW(LLB,0.125);
PS1:DRAWLINE(VV,CONST(PS1B),CURRBARSCOUNT=1,CONST(PS1B),1),COLORMAGENTA,DOTLINE;
PS2:DRAWLINE(VV,CONST(PS2B),CURRBARSCOUNT=1,CONST(PS2B),1),COLORMAGENTA,DOTLINE;
PS3:DRAWLINE(VV,CONST(PS3B),CURRBARSCOUNT=1,CONST(PS3B),1),COLORMAGENTA,DOTLINE;
PS4:DRAWLINE(VV,CONST(PS4B),CURRBARSCOUNT=1,CONST(PS4B),1),COLORMAGENTA,DOTLINE;
DRAWTEXT(VV,CONST(PS1B),VARCAT('PS1=',VAR2STR(CONST(PS1B),2))),COLORYELLOW;
DRAWTEXT(VV,CONST(PS2B),VARCAT('PS2=',VAR2STR(CONST(PS2B),2))),COLORYELLOW;
DRAWTEXT(VV,CONST(PS3B),VARCAT('PS3=',VAR2STR(CONST(PS3B),2))),COLORYELLOW;
DRAWTEXT(VV,CONST(PS4B),VARCAT('PS4=',VAR2STR(CONST(PS4B),2))),COLORYELLOW;
DRAWLINE(VV,L,CURRBARSCOUNT=1,CONST(PS4B),0),COLORMAGENTA,DOTLINE;
STICKLINE(VV,L,CONST(PS4B),0,0),COLORMAGENTA;
IFC(高点>低点 AND 反弹高位>反弹低位 AND HIGH<=反弹高位,DRAWLINE(VV2,H,VV,L,0),DRAWNULL),COLORMAGENTA,LINETHICK2;
DRAWICON(VV,L,38);
DRAWICON(VV2,H,39);
前高2:=BARSLAST(XX2),NODRAW;
低位2:=BARSLAST(VV),NODRAW;
次高2:=BARSLAST(VV2),NODRAW;
前低2:=BARSLAST(XX),NODRAW;
前高价:=REF(REF(H,前高2),1),COLORLIRED,NODRAW;
低价:=REF(REF(L,低位2),1),COLORGREEN,NODRAW;
次高价:=REF(REF(H,次高2),1),COLORYELLOW,NODRAW;
MH11:=前高价,NODRAW;
MH21:=低价,NODRAW;
MH31:=次高价,NODRAW;
LY11:=前高价=0,NODRAW;
LY21:=低价=0,NODRAW;
LY31:=次高价=0,NODRAW;
VVM11:=IF(前高2>低位2,MH11,LY11)NODRAW;
VVM21:=IF(低位2>次高2,MH21,LY21)NODRAW;
VVM41:=IF(前高价>次高价,MH31,LY31)NODRAW;
VVM51:=IF(LOW<=MH21,MH21,LY21)NODRAW;
CL4:=VVM11 AND VVM21 AND VVM41 AND VVM51,COLOR00FFFF,NODRAW;
三点买入成立:=CL4,COLORRED,NODRAW;
GGC:=IFC(CL4,MH11,LY11);
LLC:=IFC(CL4,MH21,LY21);
GDC:=IFC(CL4,MH31,LY31);
VAR1:=(LLC/GGC);
HB1C:=POW(VAR1,0.618)*GDC;
HB2C:=(LLC/GGC)*GDC;
HB3C:=POW(VAR1,1.382)*GDC;
HB4C:=POW(VAR1,1.875)*GDC;
HB1:DRAWLINE(VV2,CONST(HB1C),CURRBARSCOUNT=1,CONST(HB1C),1),COLORGREEN,DOTLINE;
HB2:DRAWLINE(VV2,CONST(HB2C),CURRBARSCOUNT=1,CONST(HB2C),1),COLORGREEN,DOTLINE;
HB3:DRAWLINE(VV2,CONST(HB3C),CURRBARSCOUNT=1,CONST(HB3C),1),COLORGREEN,DOTLINE;
HB4:DRAWLINE(VV2,CONST(HB4C),CURRBARSCOUNT=1,CONST(HB4C),1),COLORGREEN,DOTLINE;
DRAWTEXT(VV2,CONST(HB1C),VARCAT('HB1=',VAR2STR(CONST(HB1C),2))),COLORWHITE;
DRAWTEXT(VV2,CONST(HB2C),VARCAT('HB2=',VAR2STR(CONST(HB2C),2))),COLORWHITE;
DRAWTEXT(VV2,CONST(HB3C),VARCAT('HB3=',VAR2STR(CONST(HB3C),2))),COLORWHITE;
DRAWTEXT(VV2,CONST(HB4C),VARCAT('HB4=',VAR2STR(CONST(HB4C),2))),COLORWHITE;
DRAWTEXT(XX2,H,VARCAT('3点(前高)',VAR2STR(H,2))),COLORLIRED;
STICKLINE(VV2,H,CONST(HB4C),0,-1),COLORGREEN;
IFC(CL4,DRAWLINE(XX2,H,VV,L,0),DRAWNULL)COLORFF8080,LINETHICK2;
IFC(CL4,DRAWLINE(VV,L,VV2,H,0),DRAWNULL)COLORFF8080,LINETHICK2;
DRAWLINE(VV2,H,CURRBARSCOUNT=1,CONST(HB4C),1),COLORGREEN,DOTLINE;
DRAWICON(XX2,H,39);
前低:=BARSLAST(XX),NODRAW;
高位:=BARSLAST(VV2),NODRAW;
次低:=BARSLAST(VV),NODRAW;
前低价3:=REF(REF(L,前低),1),COLORGREEN,NODRAW;
高位价3:=REF(REF(H,高位),1),COLORRED,NODRAW;
次低价3:=REF(REF(L,次低),1),COLORFFFF00,NODRAW;
HH11:=前低价3,NODRAW;
HH21:=高位价3,NODRAW;
H131:=次低价3,NODRAW;
LH21:=前低价3=0,NODRAW;
L231:=高位价3=0,NODRAW;
L241:=次低价3=0,NODRAW;
VVA11:=IF(前低>高位,HH11,LH21)NODRAW;
VVA21:=IF(高位>次低,HH21,LH21)NODRAW;
VVA41:=IF(高位价3>前低价3 AND 前低价3<次低价3,HH11,LH21)NODRAW;
VVA51:=IF(HIGH>=HH21,HH11,LH21)NODRAW;
CL2:=VVA11 AND VVA21 AND VVA41 AND VVA51,COLOR00FFFF,NODRAW;
三点卖出成立:=CL2,NODRAW;
GGD:=IFC(CL2,HH21,LH21);
LLD:=IFC(CL2,HH11,LH21);
LDD:=IFC(CL2,H131,L241);
VAR2:=(GGD/LLD);
HS1C:=VAR2*LDD;
HS2C:=POW(VAR2,1.382)*LDD;
HS3C:=POW(VAR2,1.618)*LDD;
HS4C:=POW(VAR2,1.875)*LDD;
HS1:DRAWLINE(VV,CONST(HS1C),CURRBARSCOUNT=1,CONST(HS1C),1),COLORLIRED,DOTLINE;
HS2:DRAWLINE(VV,CONST(HS2C),CURRBARSCOUNT=1,CONST(HS2C),1),COLORLIRED,DOTLINE;
HS3:DRAWLINE(VV,CONST(HS3C),CURRBARSCOUNT=1,CONST(HS3C),1),COLORLIRED,DOTLINE;
HS4:DRAWLINE(VV,CONST(HS4C),CURRBARSCOUNT=1,CONST(HS4C),1),COLORLIRED,DOTLINE;
DRAWTEXT(VV,CONST(HS1C),VARCAT('HS1=',VAR2STR(CONST(HS1C),2))),COLORYELLOW;
DRAWTEXT(VV,CONST(HS2C),VARCAT('HS2=',VAR2STR(CONST(HS2C),2))),COLORYELLOW;
DRAWTEXT(VV,CONST(HS3C),VARCAT('HS3=',VAR2STR(CONST(HS3C),2))),COLORYELLOW;
DRAWTEXT(VV,CONST(HS4C),VARCAT('HS4=',VAR2STR(CONST(HS4C),2))),COLORYELLOW;
DRAWTEXT(XX,L,VARCAT('3点(前低)',VAR2STR(L,2))),COLORFFFF00;
STICKLINE(VV,L,CONST(HS4C),0,-1),COLORLIRED;
IFC(CL2,DRAWLINE(XX,L,VV2,H,0),DRAWNULL),COLORYELLOW,LINETHICK2;
IFC(CL2,DRAWLINE(VV2,H,VV,L,0),DRAWNULL),COLORYELLOW,LINETHICK2;
DRAWLINE(VV,L,CURRBARSCOUNT=1,CONST(HS4C),1),COLORLIRED,DOTLINE;
DRAWICON(XX2,H,39);
DRAWICON(XX,L,38);
DRAWICON(VV,L,38);
DRAWICON(VV2,H,39);
GB2:=IF(手动开关=1,CONST(REF(H,高位C-1)),DRAWNULL),NODRAW;
LB2:=IF(手动开关=1,CONST(REF(L,低位D-1)),DRAWNULL),NODRAW;
手动高位:GB2,COLORLIRED,NODRAW;
手动低位:LB2,COLORFFFF00,NODRAW;
VVB1:=IF(高位C>低位D,GB2,DRAWNULL)NODRAW;
VVB2:=IF(高位C>低位D,LB2,DRAWNULL)NODRAW;
VVB3:=IF(GB2>LB2,GB2,DRAWNULL)NODRAW;
VVB4:=IF(GB2>LB2,LB2,DRAWNULL)NODRAW;
CB1:=VVB1 AND VVB2 AND VVB3 AND VVB4,NODRAW;
GB3:=IFC(CB1,GB2,DRAWNULL);
LB3:=IFC(CB1,LB2,DRAWNULL);
PSC1:=POW(GB3,0.382)*POW(LB3,0.618);
PSC2:=SQRT(GB3*LB3);
PSC3:=POW(GB3,0.618)*POW(LB3,0.382);
PSC4:=POW(GB3,0.875)*POW(LB3,0.125);
DRAWLINE(CURRBARSCOUNT=(低位D),CONST(PSC1),CURRBARSCOUNT=低位D-5,CONST(PSC1),0),COLORLIRED,DOTLINE;
DRAWLINE(CURRBARSCOUNT=(低位D),CONST(PSC2),CURRBARSCOUNT=低位D-6,CONST(PSC2),0),COLORLIRED,DOTLINE;
DRAWLINE(CURRBARSCOUNT=(低位D),CONST(PSC3),CURRBARSCOUNT=低位D-7,CONST(PSC3),0),COLORLIRED,DOTLINE;
DRAWLINE(CURRBARSCOUNT=(低位D),CONST(PSC4),CURRBARSCOUNT=低位D-9,CONST(PSC4),0),COLORLIRED,DOTLINE;
DRAWTEXT(CURRBARSCOUNT=低位D,CONST(PSC1),VARCAT('PS1=',VAR2STR(CONST(PSC1),2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=低位D,CONST(PSC2),VARCAT('PS2=',VAR2STR(CONST(PSC2),2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=低位D,CONST(PSC3),VARCAT('PS3=',VAR2STR(CONST(PSC3),2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=低位D,CONST(PSC4),VARCAT('PS4=',VAR2STR(CONST(PSC4),2))),COLORYELLOW;
DRAWTEXT(CURRBARSCOUNT=高位C,H,VARCAT('高位【C】',VAR2STR(H,2))),COLORRED;
DRAWTEXT(CURRBARSCOUNT=低位D,L,VARCAT('低位【D】',VAR2STR(L,2))),COLORGREEN;
DRAWLINE(CURRBARSCOUNT=低位D,L,CURRBARSCOUNT=低位D-8,CONST(PSC4),0),COLORLIRED,DOTLINE;
IF(手动开关=1 AND GB2>LB2,DRAWLINE(CURRBARSCOUNT=高位C,H,CURRBARSCOUNT=低位D,L,0),DRAWNULL),COLORFF0080,LINETHICK3;
STICKLINE(CURRBARSCOUNT=低位D,L,CONST(PSC4),0,-1),COLORLIRED;
DRAWICON(CURRBARSCOUNT=高位C,H,39);
DRAWICON(CURRBARSCOUNT=低位D,L,38);
GC1:=IF(手动开关=1,CONST(REF(H,高位C-1)),DRAWNULL),NODRAW;
LC1:=IF(手动开关=1,CONST(REF(L,低位D-1)),DRAWNULL),NODRAW;
VVC5:=IF(高位C<低位D,GC1,DRAWNULL)NODRAW;
VVC6:=IF(高位C<低位D,LC1,DRAWNULL)NODRAW;
VVC7:=IF(GC1>LC1,GC1,DRAWNULL)NODRAW;
VVC8:=IF(GC1>LC1,LC1,DRAWNULL)NODRAW;
CC2:=VVC5 AND VVC6 AND VVC7 AND VVC8, NODRAW;
GC5:=IFC(CC2,GC1,DRAWNULL);
LC5:=IFC(CC2,LC1,DRAWNULL);
PBD1:=POW(LC5,0.382)*POW(GC5,0.618);
PBD2:=SQRT(LC5*GC5);
PBD3:=POW(LC5,0.618)*POW(GC5,0.382);
PBD4:=POW(LC5,0.875)*POW(GC5,0.125);
DRAWLINE(CURRBARSCOUNT=高位C,CONST(PBD1),CURRBARSCOUNT=高位C-5,CONST(PBD1),0),COLORGREEN,DOTLINE;
DRAWLINE(CURRBARSCOUNT=高位C,CONST(PBD2),CURRBARSCOUNT=高位C-6,CONST(PBD2),0),COLORGREEN,DOTLINE;
DRAWLINE(CURRBARSCOUNT=高位C,CONST(PBD3),CURRBARSCOUNT=高位C-7,CONST(PBD3),0),COLORGREEN,DOTLINE;
DRAWLINE(CURRBARSCOUNT=高位C,CONST(PBD4),CURRBARSCOUNT=高位C-9,CONST(PBD4),0),COLORGREEN,DOTLINE;
DRAWTEXT(CURRBARSCOUNT=高位C,CONST(PBD1),VARCAT('PB1=',VAR2STR(CONST(PBD1),2))),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=高位C,CONST(PBD2),VARCAT('PB2=',VAR2STR(CONST(PBD2),2))),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=高位C,CONST(PBD3),VARCAT('PB3=',VAR2STR(CONST(PBD3),2))),COLORWHITE;
DRAWTEXT(CURRBARSCOUNT=高位C,CONST(PBD4),VARCAT('PB4=',VAR2STR(CONST(PBD4),2))),COLORWHITE;
DRAWLINE(CURRBARSCOUNT=高位C,H,CURRBARSCOUNT=高位C-8,CONST(PBD4),0),COLORGREEN,DOTLINE;
STICKLINE(CURRBARSCOUNT=高位C,H,CONST(PBD4),0,-1),COLORGREEN;
IF(手动开关=1 AND GC1>LC1,DRAWLINE(CURRBARSCOUNT=低位D,L,CURRBARSCOUNT=高位C,H,0),DRAWNULL),COLORLIRED,LINETHICK3;
预测走势:IF(趋势线开关=1,DRAWLINE(J2,IF(HD,H,L),ISLASTBAR,IF(高点>低点,H,L),0),DRAWNULL)DOTLINE,COLORFFFFFF;
未来函数检测结果如下:
该公式包含未来函数:BACKSET
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
周期微调赋值:3
高位C赋值:0
低位D赋值:0
手动开关赋值:1
趋势线开关赋值:1
顶底开关赋值:1
当满足条件1时,在横轴0.72纵轴0.003位置书写文字
AR1赋值:C的有效数据周期数
AR2赋值:CONST(AR1)
AR3赋值:AR2-AR1
输出K线根数:AR3+1,NODRAW,COLORYELLOW
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),收盘价,开盘价,2.5,0),COLOR0088FF
STICKLINE(顶底开关>0 AND (KDJA >=90),H,L,0,0),COLOR0088FF
STICKLINE(顶底开关>0 AND (KDJA <=10),收盘价,开盘价,2.5,0),COLORFF0000
STICKLINE(顶底开关>0 AND (KDJA <=10),H,L,0,0),COLORFF0000
A1赋值:周期微调日前的最高价=2*3+1日内最高价最高值
B1赋值:A1的周期微调过滤
C1赋值:BACKSET(B1,周期微调+1)
D1赋值:C1的周期微调过滤
A2赋值:周期微调日前的最低价=2*3+1日内最低价最低值
B2赋值:A2的周期微调过滤
C2赋值:BACKSET(B2,周期微调+1)
D2赋值:C2的周期微调过滤
E1赋值:(REF(2*3日内最低价最低值,1)+REF(2*3日内最高价最高值,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
高点赋值:上次HD距今天数
低点赋值:上次LD距今天数
J1赋值:BACKSET(ISLASTBAR,高点和低点的较小值+1)
J2赋值:J1>1日前的J1
IF(趋势线开关=1,DRAWLINE(LD,L,HD,H,0),DRAWNULL)LINETHICK1,DOTLINE,COLOR0000FF
IF(趋势线开关=1,DRAWLINE(HD,H,LD,L,0),DRAWNULL)LINETHICK1,DOTLINE,COLORYELLOW
K赋值: 到最后交易的周期,NODRAW
DRAWNUMBER(趋势线开关=1 AND HD,H,K),COLORLIRED,DRAWABOVE
DRAWNUMBER(趋势线开关=1 AND LD,L,K),COLORFFFF00
输出高位价:高点日前的H,1),画红色,NODRAW
输出低位价:低点日前的L,1),画绿色,NODRAW
GGA赋值:IFC(高点<低点 AND 高位价>低位价 AND 最低价>=低位价,高位价,DRAWNULL)
LLA:=IFC(高点<低点 AND 高位价>低位价,低位价,DRAWNULL)
PB1A:=POW(LLA,0.382)*POW(GGA,0.618)
PB2A:=SQRT(LLA*GGA)
PB3A:=POW(LLA,0.618)*POW(GGA,0.382)
PB4A:=POW(LLA,0.875)*POW(GGA,0.125)
P输出B1:DRAWLINE(VV2,CONST(PB1A), 到最后交易的周期=1,CONST(PB1A),1),COLORFF8800,DOTLINE
P输出B2:DRAWLINE(VV2,CONST(PB2A), 到最后交易的周期=1,CONST(PB2A),1),COLORFF8800,DOTLINE
P输出B3:DRAWLINE(VV2,CONST(PB3A), 到最后交易的周期=1,CONST(PB3A),1),COLORFF8800,DOTLINE
P输出B4:DRAWLINE(VV2,CONST(PB4A), 到最后交易的周期=1,CONST(PB4A),1),COLORFF8800,DOTLINE
DRAWTEXT(VV2,CONST(PB1A),VARCAT('PB1=',VAR2STR(CONST(PB1A),2))),画白色
DRAWTEXT(VV2,CONST(PB2A),VARCAT('PB2=',VAR2STR(CONST(PB2A),2))),画白色
DRAWTEXT(VV2,CONST(PB3A),VARCAT('PB3=',VAR2STR(CONST(PB3A),2))),画白色
DRAWTEXT(VV2,CONST(PB4A),VARCAT('PB4=',VAR2STR(CONST(PB4A),2))),画白色
DRAWTEXT(VV,L,VARCAT('低位【A】',VAR2STR(L,2))),画绿色
DRAWTEXT(VV2,H,VARCAT('高位【B】',VAR2STR(H,2))),画红色
STICKLINE(VV2,H,CONST(PB4A),0,0),COLORFF8800
IFC(高点<低点 AND 高位价>低位价 AND 最低价>=低位价,DRAWLINE(VV,L,VV2,H,0),DRAWNULL),COLORFF8800,LINETHICK2
DRAWLINE(VV2,H, 到最后交易的周期=1,CONST(PB4A),0),COLORFF8800,DOTLINE
当满足条件 到最后交易的周期=XX时,在L和38之间画图标
当满足条件 到最后交易的周期=VV2时,在H和39之间画图标
反弹高位赋值:高点日前的H,1),画红色,NODRAW
反弹低位赋值:低点日前的L,1),画绿色,NODRAW
GGB赋值:IFC(高点>低点 AND 反弹高位>反弹低位 AND 最高价<=反弹高位,反弹高位,DRAWNULL)
LLB:=IFC(高点>低点 AND 反弹高位>反弹低位,反弹低位,DRAWNULL)
PS1B赋值:POW(GGB,0.382)*POW(LLB,0.618)
PS2B赋值:SQRT(GGB*LLB)
PS3B赋值:POW(GGB,0.618)*POW(LLB,0.382)
PS4B赋值:POW(GGB,0.875)*POW(LLB,0.125)
输出PS1:DRAWLINE(VV,CONST(PS1B), 到最后交易的周期=1,CONST(PS1B),1),画洋红色,DOTLINE
输出PS2:DRAWLINE(VV,CONST(PS2B), 到最后交易的周期=1,CONST(PS2B),1),画洋红色,DOTLINE
输出PS3:DRAWLINE(VV,CONST(PS3B), 到最后交易的周期=1,CONST(PS3B),1),画洋红色,DOTLINE
输出PS4:DRAWLINE(VV,CONST(PS4B), 到最后交易的周期=1,CONST(PS4B),1),画洋红色,DOTLINE
DRAWTEXT(VV,CONST(PS1B),VARCAT('PS1=',VAR2STR(CONST(PS1B),2))),COLORYELLOW
DRAWTEXT(VV,CONST(PS2B),VARCAT('PS2=',VAR2STR(CONST(PS2B),2))),COLORYELLOW
DRAWTEXT(VV,CONST(PS3B),VARCAT('PS3=',VAR2STR(CONST(PS3B),2))),COLORYELLOW
DRAWTEXT(VV,CONST(PS4B),VARCAT('PS4=',VAR2STR(CONST(PS4B),2))),COLORYELLOW
DRAWLINE(VV,L, 到最后交易的周期=1,CONST(PS4B),0),画洋红色,DOTLINE
STICKLINE(VV,L,CONST(PS4B),0,0),画洋红色
IFC(高点>低点 AND 反弹高位>反弹低位 AND 最高价<=反弹高位,DRAWLINE(VV2,H,VV,L,0),DRAWNULL),画洋红色,LINETHICK2
当满足条件VV时,在L和38之间画图标
当满足条件VV2时,在H和39之间画图标
前高2赋值:上次XX2距今天数,NODRAW
低位2赋值:上次VV距今天数,NODRAW
次高2赋值:上次VV2距今天数,NODRAW
前低2赋值:上次XX距今天数,NODRAW
前高价赋值:前高2日前的H,1),COLORLIRED,NODRAW
低价赋值:低位2日前的L,1),画绿色,NODRAW
次高价赋值:次高2日前的H,1),COLORYELLOW,NODRAW
MH11:=前高价,NODRAW
MH21:=低价,NODRAW
MH31:=次高价,NODRAW
LY11赋值:前高价=0,NODRAW
LY21赋值:低价=0,NODRAW
LY31赋值:次高价=0,NODRAW
如果前高2>低位2返回MH11否则返回LY11
如果低位2>次高2返回MH21否则返回LY21
如果前高价>次高价返回MH31否则返回LY31
如果最低价<=MH21返回MH21否则返回LY21
CL4赋值:VVM11 AND VVM21 AND VVM41 AND VVM51,COLOR00FFFF,NODRAW
三点买入成立赋值:CL4,画红色,NODRAW
GGC赋值:IFC(CL4,MH11,LY11)
LLC:=IFC(CL4,MH21,LY21)
GDC赋值:IFC(CL4,MH31,LY31)
VAR1赋值:(LLC/GGC)
HB1C:=POW(VAR1,0.618)*GDC
HB2C:=(LLC/GGC)*GDC
HB3C:=POW(VAR1,1.382)*GDC
HB4C:=POW(VAR1,1.875)*GDC
H输出B1:DRAWLINE(VV2,CONST(HB1C), 到最后交易的周期=1,CONST(HB1C),1),画绿色,DOTLINE
H输出B2:DRAWLINE(VV2,CONST(HB2C), 到最后交易的周期=1,CONST(HB2C),1),画绿色,DOTLINE
H输出B3:DRAWLINE(VV2,CONST(HB3C), 到最后交易的周期=1,CONST(HB3C),1),画绿色,DOTLINE
H输出B4:DRAWLINE(VV2,CONST(HB4C), 到最后交易的周期=1,CONST(HB4C),1),画绿色,DOTLINE
DRAWTEXT(VV2,CONST(HB1C),VARCAT('HB1=',VAR2STR(CONST(HB1C),2))),画白色
DRAWTEXT(VV2,CONST(HB2C),VARCAT('HB2=',VAR2STR(CONST(HB2C),2))),画白色
DRAWTEXT(VV2,CONST(HB3C),VARCAT('HB3=',VAR2STR(CONST(HB3C),2))),画白色
DRAWTEXT(VV2,CONST(HB4C),VARCAT('HB4=',VAR2STR(CONST(HB4C),2))),画白色
DRAWTEXT(XX2,H,VARCAT('3点(前高)',VAR2STR(H,2))),COLORLIRED
STICKLINE(VV2,H,CONST(HB4C),0,-1),画绿色
IFC(CL4,DRAWLINE(XX2,H,VV,L,0),DRAWNULL)COLORFF8080,LINETHICK2
IFC(CL4,DRAWLINE(VV,L,VV2,H,0),DRAWNULL)COLORFF8080,LINETHICK2
DRAWLINE(VV2,H, 到最后交易的周期=1,CONST(HB4C),1),画绿色,DOTLINE
当满足条件XX2时,在H和39之间画图标
前低赋值:上次XX距今天数,NODRAW
高位赋值:上次VV2距今天数,NODRAW
次低赋值:上次VV距今天数,NODRAW
前低价3:=前低日前的L,1),画绿色,NODRAW
高位价3:=高位日前的H,1),画红色,NODRAW
次低价3:=次低日前的L,1),COLORFFFF00,NODRAW
HH11:=前低价3,NODRAW
HH21:=高位价3,NODRAW
H131:=次低价3,NODRAW
LH21:=前低价3=0,NODRAW
L231:=高位价3=0,NODRAW
L241:=次低价3=0,NODRAW
如果前低>高位返回HH11否则返回LH21
如果高位>次低返回HH21否则返回LH21
如果高位价3>前低价3 AND 前低价3<次低价3返回HH11否则返回LH21
如果最高价>=HH21返回HH11否则返回LH21
CL2赋值:VVA11 AND VVA21 AND VVA41 AND VVA51,COLOR00FFFF,NODRAW
三点卖出成立赋值:CL2,NODRAW
GGD赋值:IFC(CL2,HH21,LH21)
LLD赋值:IFC(CL2,HH11,LH21)
LDD:=IFC(CL2,H131,L241)
VAR2赋值:(GGD/LLD)
HS1C赋值:VAR2*LDD
HS2C赋值:POW(VAR2,1.382)*LDD
HS3C赋值:POW(VAR2,1.618)*LDD
HS4C赋值:POW(VAR2,1.875)*LDD
输出HS1:DRAWLINE(VV,CONST(HS1C), 到最后交易的周期=1,CONST(HS1C),1),COLORLIRED,DOTLINE
输出HS2:DRAWLINE(VV,CONST(HS2C), 到最后交易的周期=1,CONST(HS2C),1),COLORLIRED,DOTLINE
输出HS3:DRAWLINE(VV,CONST(HS3C), 到最后交易的周期=1,CONST(HS3C),1),COLORLIRED,DOTLINE
输出HS4:DRAWLINE(VV,CONST(HS4C), 到最后交易的周期=1,CONST(HS4C),1),COLORLIRED,DOTLINE
DRAWTEXT(VV,CONST(HS1C),VARCAT('HS1=',VAR2STR(CONST(HS1C),2))),COLORYELLOW
DRAWTEXT(VV,CONST(HS2C),VARCAT('HS2=',VAR2STR(CONST(HS2C),2))),COLORYELLOW
DRAWTEXT(VV,CONST(HS3C),VARCAT('HS3=',VAR2STR(CONST(HS3C),2))),COLORYELLOW
DRAWTEXT(VV,CONST(HS4C),VARCAT('HS4=',VAR2STR(CONST(HS4C),2))),COLORYELLOW
DRAWTEXT(XX,L,VARCAT('3点(前低)',VAR2STR(L,2))),COLORFFFF00
STICKLINE(VV,L,CONST(HS4C),0,-1),COLORLIRED
IFC(CL2,DRAWLINE(XX,L,VV2,H,0),DRAWNULL),COLORYELLOW,LINETHICK2
IFC(CL2,DRAWLINE(VV2,H,VV,L,0),DRAWNULL),COLORYELLOW,LINETHICK2
DRAWLINE(VV,L, 到最后交易的周期=1,CONST(HS4C),1),COLORLIRED,DOTLINE
当满足条件XX2时,在H和39之间画图标
当满足条件XX时,在L和38之间画图标
当满足条件VV时,在L和38之间画图标
当满足条件VV2时,在H和39之间画图标
GB2赋值:IF(手动开关=1,CONST(高位C-1日前的H),DRAWNULL),NODRAW
LB2赋值:IF(手动开关=1,CONST(低位D-1日前的L),DRAWNULL),NODRAW
手动输出高位:GB2,COLORLIRED,NODRAW
输出手动低位:LB2,COLORFFFF00,NODRAW
如果高位C>低位D返回GB2否则返回DRAWNULL
如果高位C>低位D返回LB2否则返回DRAWNULL
如果GB2>LB2返回GB2否则返回DRAWNULL
如果GB2>LB2返回LB2否则返回DRAWNULL
CB1赋值:VVB1 AND VVB2 AND VVB3 AND VVB4,NODRAW
GB3赋值:IFC(CB1,GB2,DRAWNULL)
LB3赋值:IFC(CB1,LB2,DRAWNULL)
PSC1赋值:POW(GB3,0.382)*POW(LB3,0.618)
PSC2赋值:SQRT(GB3*LB3)
PSC3赋值:POW(GB3,0.618)*POW(LB3,0.382)
PSC4赋值:POW(GB3,0.875)*POW(LB3,0.125)
DRAWLINE( 到最后交易的周期=(低位D),CONST(PSC1), 到最后交易的周期=低位D-5,CONST(PSC1),0),COLORLIRED,DOTLINE
DRAWLINE( 到最后交易的周期=(低位D),CONST(PSC2), 到最后交易的周期=低位D-6,CONST(PSC2),0),COLORLIRED,DOTLINE
DRAWLINE( 到最后交易的周期=(低位D),CONST(PSC3), 到最后交易的周期=低位D-7,CONST(PSC3),0),COLORLIRED,DOTLINE
DRAWLINE( 到最后交易的周期=(低位D),CONST(PSC4), 到最后交易的周期=低位D-9,CONST(PSC4),0),COLORLIRED,DOTLINE
DRAWTEXT( 到最后交易的周期=低位D,CONST(PSC1),VARCAT('PS1=',VAR2STR(CONST(PSC1),2))),COLORYELLOW
DRAWTEXT( 到最后交易的周期=低位D,CONST(PSC2),VARCAT('PS2=',VAR2STR(CONST(PSC2),2))),COLORYELLOW
DRAWTEXT( 到最后交易的周期=低位D,CONST(PSC3),VARCAT('PS3=',VAR2STR(CONST(PSC3),2))),COLORYELLOW
DRAWTEXT( 到最后交易的周期=低位D,CONST(PSC4),VARCAT('PS4=',VAR2STR(CONST(PSC4),2))),COLORYELLOW
DRAWTEXT( 到最后交易的周期=高位C,H,VARCAT('高位【C】',VAR2STR(H,2))),画红色
DRAWTEXT( 到最后交易的周期=低位D,L,VARCAT('低位【D】',VAR2STR(L,2))),画绿色
DRAWLINE( 到最后交易的周期=低位D,L, 到最后交易的周期=低位D-8,CONST(PSC4),0),COLORLIRED,DOTLINE
IF(手动开关=1 AND GB2>LB2,DRAWLINE( 到最后交易的周期=高位C,H, 到最后交易的周期=低位D,L,0),DRAWNULL),COLORFF0080,LINETHICK3
STICKLINE( 到最后交易的周期=低位D,L,CONST(PSC4),0,-1),COLORLIRED
当满足条件 到最后交易的周期=高位C时,在H和39之间画图标
当满足条件 到最后交易的周期=低位D时,在L和38之间画图标
GC1赋值:IF(手动开关=1,CONST(高位C-1日前的H),DRAWNULL),NODRAW
LC1赋值:IF(手动开关=1,CONST(低位D-1日前的L),DRAWNULL),NODRAW
如果高位C<低位D返回GC1否则返回DRAWNULL
如果高位C<低位D返回LC1否则返回DRAWNULL
如果GC1>LC1返回GC1否则返回DRAWNULL
如果GC1>LC1返回LC1否则返回DRAWNULL
CC2赋值:VVC5 AND VVC6 AND VVC7 AND VVC8, NODRAW
GC5赋值:IFC(CC2,GC1,DRAWNULL)
LC5赋值:IFC(CC2,LC1,DRAWNULL)
PBD1赋值:POW(LC5,0.382)*POW(GC5,0.618)
PBD2赋值:SQRT(LC5*GC5)
PBD3赋值:POW(LC5,0.618)*POW(GC5,0.382)
PBD4赋值:POW(LC5,0.875)*POW(GC5,0.125)
DRAWLINE( 到最后交易的周期=高位C,CONST(PBD1), 到最后交易的周期=高位C-5,CONST(PBD1),0),画绿色,DOTLINE
DRAWLINE( 到最后交易的周期=高位C,CONST(PBD2), 到最后交易的周期=高位C-6,CONST(PBD2),0),画绿色,DOTLINE
DRAWLINE( 到最后交易的周期=高位C,CONST(PBD3), 到最后交易的周期=高位C-7,CONST(PBD3),0),画绿色,DOTLINE
DRAWLINE( 到最后交易的周期=高位C,CONST(PBD4), 到最后交易的周期=高位C-9,CONST(PBD4),0),画绿色,DOTLINE
DRAWTEXT( 到最后交易的周期=高位C,CONST(PBD1),VARCAT('PB1=',VAR2STR(CONST(PBD1),2))),画白色
DRAWTEXT( 到最后交易的周期=高位C,CONST(PBD2),VARCAT('PB2=',VAR2STR(CONST(PBD2),2))),画白色
DRAWTEXT( 到最后交易的周期=高位C,CONST(PBD3),VARCAT('PB3=',VAR2STR(CONST(PBD3),2))),画白色
DRAWTEXT( 到最后交易的周期=高位C,CONST(PBD4),VARCAT('PB4=',VAR2STR(CONST(PBD4),2))),画白色
DRAWLINE( 到最后交易的周期=高位C,H, 到最后交易的周期=高位C-8,CONST(PBD4),0),画绿色,DOTLINE
STICKLINE( 到最后交易的周期=高位C,H,CONST(PBD4),0,-1),画绿色
IF(手动开关=1 AND GC1>LC1,DRAWLINE( 到最后交易的周期=低位D,L, 到最后交易的周期=高位C,H,0),DRAWNULL),COLORLIRED,LINETHICK3
输出预测走势:IF(趋势线开关=1,DRAWLINE(J2,IF(HD,H,L),ISLASTBAR,IF(高点>低点,H,L),0),DRAWNULL)DOTLINE,COLORFFFFFF