通达信自动画通道主图
N:=13;
UR:=6;
LR:=2;
TC1:=IF(H=HHV(H,8*UR),H,DRAWNULL);
TC2:=CONST(BARSLAST(TC1=H))+1;
UPPER:=CONST(IF(TC2=1,H,REF(H,TC2-1)));
BC1:=IF(L=LLV(L,8*LR),L,DRAWNULL);
BC2:=CONST(BARSLAST(BC1=L))+1;
LOWER:=CONST(IF(BC2=1,L,REF(L,BC2-1)));
LP:=CURRBARSCOUNT<=BC2 AND L=LOWER;{低点定位}
HP:=CURRBARSCOUNT<=TC2 AND H=UPPER;{高点定位}
STICKLINE(IF(BC2>TC2,HP,LP),LOWER,UPPER,0,0),COLOR628962;
STICKLINE(IF(BC2>TC2,LP,HP),LOWER,UPPER,0,0),COLOR628962;
NOD:=(IF(TC2>BC2,TC2,BC2)-IF(TC2>BC2,BC2,TC2));{用时}
LR1:=FORCAST(C,NOD+1);
NP:IF(CURRBARSCOUNT<=MAX(BC2,TC2),CONST(IF(MIN(TC2,BC2)=1,LR1,REF(LR1,MIN(TC2,BC2)-1))),DRAWNULL),POINTDOT,COLOR93BDA8;{近点}{股票指标网www88gscom}
LR2:=SLOPE(C,NOD+1);
LR3:=CONST(IF(MIN(TC2,BC2)=1,LR2,REF(LR2,MIN(TC2,BC2)-1)));
FP:NP-LR3*(NOD),POINTDOT,COLOR93BDA8;{远点}
EQU:(NP+FP)/2,POINTDOT,COLOR93BDA8;
AD:=ABS(NP-FP);{高差};
DBL:=BARSLAST(BC1!=DRAWNULL)+1;
DBH:=BARSLAST(TC1!=DRAWNULL)+1;
BSP:=IF(BC2>TC2,DBL,DBH)-1;
LRL:=IF(NP>FP,FP+AD/NOD*BSP,FP-AD/NOD*BSP);
AT1:=IF(BETWEEN(CURRBARSCOUNT,BC2,TC2) AND H>LRL,H,LRL);
AT2:=HHV(AT1-LRL,MAX(BC2,TC2));
AT3:=CONST(BARSLAST(AT1-LRL=AT2));
AT4:=CONST(IF(AT3=0,H,REF(H,AT3)));
AT5:=CONST(IF(AT3=0,AT1-LRL,REF(AT1-LRL,AT3)));
ATL:=LRL+AT5;
UT1:=IF(BETWEEN(CURRBARSCOUNT,BC2,TC2) AND L<LRL,L,LRL);
UT2:=HHV(LRL-UT1,MAX(BC2,TC2));
UT3:=CONST(BARSLAST(LRL-UT1=UT2));
UT4:=CONST(IF(UT3=0,H,REF(H,UT3)));
UT5:=CONST(IF(UT3=0,LRL-UT1,REF(LRL-UT1,UT3)));
UTL:=LRL-UT5;
RH:=IF(CURRBARSCOUNT>=MIN(BC2,TC2)-10,ATL,CONST(REF(ATL,MIN(BC2,TC2)-11)));{限制高}
RL:=IF(CURRBARSCOUNT>=MIN(BC2,TC2)-10,UTL,CONST(REF(UTL,MIN(BC2,TC2)-11)));{限制低}
中轨:IF(NP>FP,IF(LRL<=RH,LRL,DRAWNULL),IF(LRL>=RL,LRL,DRAWNULL)),COLOR628962;
上轨:IF(NP>FP,IF(ATL<=RH,ATL,DRAWNULL),IF(ATL>=RL,ATL,DRAWNULL)),COLOR628962;
下轨:IF(NP>FP,IF(UTL<=RH,UTL,DRAWNULL),IF(UTL>=RL,UTL,DRAWNULL)),COLOR628962;
{极品波浪指标,有此公式必发达}
A1:=REF(HIGH,3)=HHV(HIGH,2*3+1);
B1:=FILTER(A1,3);
C1:=BACKSET(B1,3+1);
D1:=FILTER(C1,3);{高点}
A2:=REF(LOW,3)=LLV(LOW,2*3+1);
B2:=FILTER(A2,3);
C2:=BACKSET(B2,3+1);
D2:=FILTER(C2,3);{低点}
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;
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,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);{过滤后高点}
DRAWLINE(LD,L,HD,H,0),COLORMAGENTA,LINETHICK1;
DRAWLINE(HD,H,LD,L,0),COLORMAGENTA,LINETHICK1;
J1:=BACKSET(ISLASTBAR ,MIN(BARSLAST(HD),BARSLAST(LD))+1);
J2:=J1>REF(J1,1);
DRAWLINE(J2,IF(HD,H,L),ISLASTBAR ,IF(BARSLAST(HD)>BARSLAST(LD),H,L),0),COLORWHITE,LINETHICK1;
未来函数检测结果如下:
该公式包含未来函数:BACKSET
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
N赋值:13
UR赋值:6
LR赋值:2
TC1赋值:IF(H=8*UR日内H最高值,H,DRAWNULL)
TC2赋值:CONST(上次TC1=H距今天数)+1
UPPER赋值:CONST(IF(TC2=1,H,TC2-1日前的H))
BC1赋值:IF(L=8*LR日内L最低值,L,DRAWNULL)
BC2赋值:CONST(上次BC1=L距今天数)+1
LOWER赋值:CONST(IF(BC2=1,L,BC2-1日前的L))
LP赋值:CURRBARSCOUNT<=BC2 AND L=最低价ER
{低点定位}
HP赋值:CURRBARSCOUNT<=TC2 AND H=UPPER
如果BC2>TC2返回HP否则返回LP
如果BC2>TC2返回LP否则返回HP
如果TC2>BC2返回TC2否则返回BC2
{用时}
LR1:=FORCAST(C,NOD+1)
NP:IF(CURRBARSCOUNT<=BC2和TC2较大值,CONST(IF(TC2和BC2的较小值=1,LR1,REF(LR1,TC2和BC2的较小值-1))),DRAWNULL),POINTDOT,COLOR93BDA8
{近点}{股票指标网WWW88GSCOM}
LR2:=SLOPE(C,NOD+1)
LR3:=CONST(IF(TC2和BC2的较小值=1,LR2,REF(LR2,TC2和BC2的较小值-1)))
输出
FP:NP-LR3*(NOD),POINTDOT,COLOR93BDA8
输出{远点}
EQU:(NP+FP)/2,POINTDOT,COLOR93BDA8
AD赋值:NP-FP的绝对值
{高差}
DBL赋值:上次BC1!=DRAWNULL距今天数+1
DBH赋值:上次TC1!=DRAWNULL距今天数+1
如果BC2>TC2返回DBL否则返回DBH
如果NP>FP返回FP+AD/NOD*BSP否则返回FP-AD/NOD*BSP
AT1赋值:IF(BETWEEN(CURRBARSCOUNT,BC2,TC2) AND H>LRL,H,LRL)
AT2赋值:BC2和TC2较大值日内AT1-LRL最高值
AT3赋值:CONST(上次AT1-LRL=AT2距今天数)
AT4赋值:CONST(IF(AT3=0,H,AT3日前的H))
AT5赋值:CONST(IF(AT3=0,AT1-LRL,AT3日前的AT1-LRL))
ATL赋值:LRL+AT5
UT1赋值:IF(BETWEEN(CURRBARSCOUNT,BC2,TC2) AND L
UT2赋值:BC2和TC2较大值日内LRL-UT1最高值
UT3赋值:CONST(上次LRL-UT1=UT2距今天数)
UT4赋值:CONST(IF(UT3=0,H,UT3日前的H))
UT5赋值:CONST(IF(UT3=0,LRL-UT1,UT3日前的LRL-UT1))
UTL赋值:LRL-UT5
RH赋值:IF(CURRBARSCOUNT>=BC2和TC2的较小值-10,ATL,CONST(REF(ATL,BC2和TC2的较小值-11)))
{限制高}
RL赋值:IF(CURRBARSCOUNT>=BC2和TC2的较小值-10,UTL,CONST(REF(UTL,BC2和TC2的较小值-11)))
输出{限制低}
中轨:IF(NP>FP,IF(LRL<=RH,LRL,DRAWNULL),IF(LRL>=RL,LRL,DRAWNULL)),COLOR628962
输出
上轨:IF(NP>FP,IF(ATL<=RH,ATL,DRAWNULL),IF(ATL>=RL,ATL,DRAWNULL)),COLOR628962
输出
下轨:IF(NP>FP,IF(UTL<=RH,UTL,DRAWNULL),IF(UTL>=RL,UTL,DRAWNULL)),COLOR628962
{极品波浪指标,有此公式必发达}
A1赋值:3日前的最高价=2*3+1日内最高价最高值
B1赋值:A1的3过滤
C1赋值:BACKSET(B1,3+1)
D1赋值:C1的3过滤
{高点}
A2赋值:3日前的最低价=2*3+1日内最低价最低值
B2赋值:A2的3过滤
C2赋值:BACKSET(B2,3+1)
D2赋值:C2的3过滤
{低点}
E1赋值:(REF(2*3日内最低价最低值,1)+REF(2*3日内最高价最高值,1))/2
E2赋值:(最高价+最低价)/2
H1赋值:(D1 AND NOT((D2 AND E1>=E2))) OR ISLASTBAR OR 收盘价的有效数据周期数=1
L1赋值:(D2 AND NOT((D1 AND E1
H2赋值:D1 AND NOT((D2 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
{过滤后高点}
DRAWLINE(LD,L,HD,H,0),COLORMAGENTA,LINETHICK1
DRAWLINE(HD,H,LD,L,0),COLORMAGENTA,LINETHICK1
J1赋值:BACKSET(ISLASTBAR ,MIN(上次HD距今天数,BARSLAST(LD))+1)
J2赋值:J1>1日前的J1
如果HD返回H否则返回L