自动画通道线指标源码主图贴图无未来
{自动画通道线}
N:=33;
UR:=6;
LR:=6;
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,COLORFFFFFF;{近点}
LR2:=SLOPE(C,NOD+1);
LR3:=CONST(IF(MIN(TC2,BC2)=1,LR2,REF(LR2,MIN(TC2,BC2)-1)));
FP:NP-LR3*(NOD),POINTDOT,COLORFFFFFF;{远点}
EQU:(NP+FP)/2,POINTDOT,COLORFFFFFF;{中点}
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)),COLORRED;}{中轨画线}
IF(NP>FP,IF(ATL<=RH,ATL,DRAWNULL),IF(ATL>=RL,ATL,DRAWNULL)),COLORYELLOW;{上轨画线}
IF(NP>FP,IF(UTL<=RH,UTL,DRAWNULL),IF(UTL>=RL,UTL,DRAWNULL)),COLORFFFFFF;{下轨画线};
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
{自动画通道线}
N赋值:33
UR赋值:6
LR赋值:6
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=LOWER
{低点定位}
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,COLORFFFFFF
{近点}
LR2:=SLOPE(C,NOD+1)
LR3:=CONST(IF(TC2和BC2的较小值=1,LR2,REF(LR2,TC2和BC2的较小值-1)))
输出FP:NP-LR3*(NOD),POINTDOT,COLORFFFFFF
输出{远点}
EQU:(NP+FP)/2,POINTDOT,COLORFFFFFF
{中点}
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)),画红色
}{中轨画线}
IF(NP>FP,IF(ATL<=RH,ATL,DRAWNULL),IF(ATL>=RL,ATL,DRAWNULL)),画黄色
{上轨画线}
IF(NP>FP,IF(UTL<=RH,UTL,DRAWNULL),IF(UTL>=RL,UTL,DRAWNULL)),COLORFFFFFF
{下轨画线}