通达信连续九周画矩形
T:=BARSLAST(WEEKOFYEAR!=REF(WEEKOFYEAR,1));
L0:=LLV(L,T+1);
L1:=REF(L0,T+1);
L2:=REF(L1,T+1);
L3:=REF(L2,T+1);
L4:=REF(L3,T+1);
L5:=REF(L4,T+1);
L6:=REF(L5,T+1);
L7:=REF(L6,T+1);
L8:=REF(L7,T+1);
H0:=HHV(H,T+1);
H1:=REF(H0,T+1);
H2:=REF(H1,T+1);
H3:=REF(H2,T+1);
H4:=REF(H3,T+1);
H5:=REF(H4,T+1);
H6:=REF(H5,T+1);
H7:=REF(H6,T+1);
H8:=REF(H7,T+1);
TJ:=WEEKOFYEAR!=REF(WEEKOFYEAR,1);
TJ1:=COUNT(TJ,TOTALBARSCOUNT);
T0:=BARSLAST(CROSS(CONST(TJ1)-TJ1=0,0.5));
T1:=BARSLAST(CROSS(CONST(TJ1)-TJ1=1,0.5));
T2:=BARSLAST(CROSS(CONST(TJ1)-TJ1=2,0.5));
T3:=BARSLAST(CROSS(CONST(TJ1)-TJ1=3,0.5));
T4:=BARSLAST(CROSS(CONST(TJ1)-TJ1=4,0.5));
T5:=BARSLAST(CROSS(CONST(TJ1)-TJ1=5,0.5));
T6:=BARSLAST(CROSS(CONST(TJ1)-TJ1=6,0.5));
T7:=BARSLAST(CROSS(CONST(TJ1)-TJ1=7,0.5));
T8:=BARSLAST(CROSS(CONST(TJ1)-TJ1=8,0.5));
NOTEXT1:IF(CONST(TJ1)-TJ1=0,CONST(H0),DRAWNULL),COLORYELLOW;
NOTEXT2:IF(CONST(TJ1)-TJ1=0,CONST(L0),DRAWNULL),COLORYELLOW;
STICKLINE(T0=0 OR BARSTATUS=2,CONST(H0),CONST(L0),0,0),COLORYELLOW;
NOTEXT3:IF(CONST(TJ1)-TJ1=1,CONST(H1),DRAWNULL),COLORYELLOW;
NOTEXT4:IF(CONST(TJ1)-TJ1=1,CONST(L1),DRAWNULL),COLORYELLOW;
STICKLINE(T1=0 OR REFX(T0=0,1),CONST(H1),CONST(L1),0,0),COLORYELLOW;
NOTEXT5:IF(CONST(TJ1)-TJ1=2,CONST(H2),DRAWNULL),COLORYELLOW;
NOTEXT6:IF(CONST(TJ1)-TJ1=2,CONST(L2),DRAWNULL),COLORYELLOW;
STICKLINE(T2=0 OR REFX(T1=0,1),CONST(H2),CONST(L2),0,0),COLORYELLOW;
NOTEXT7:IF(CONST(TJ1)-TJ1=3,CONST(H3),DRAWNULL),COLORYELLOW;
NOTEXT8:IF(CONST(TJ1)-TJ1=3,CONST(L3),DRAWNULL),COLORYELLOW;
STICKLINE(T3=0 OR REFX(T2=0,1),CONST(H3),CONST(L3),0,0),COLORYELLOW;
NOTEXT9:IF(CONST(TJ1)-TJ1=4,CONST(H4),DRAWNULL),COLORYELLOW;
NOTEXT10:IF(CONST(TJ1)-TJ1=4,CONST(L4),DRAWNULL),COLORYELLOW;
STICKLINE(T4=0 OR REFX(T3=0,1),CONST(H4),CONST(L4),0,0),COLORYELLOW;
NOTEXT11:IF(CONST(TJ1)-TJ1=5,CONST(H5),DRAWNULL),COLORYELLOW;
NOTEXT12:IF(CONST(TJ1)-TJ1=5,CONST(L5),DRAWNULL),COLORYELLOW;
STICKLINE(T5=0 OR REFX(T4=0,1),CONST(H5),CONST(L5),0,0),COLORYELLOW;
NOTEXT13:IF(CONST(TJ1)-TJ1=6,CONST(H6),DRAWNULL),COLORYELLOW;
NOTEXT14:IF(CONST(TJ1)-TJ1=6,CONST(L6),DRAWNULL),COLORYELLOW;
STICKLINE(T6=0 OR REFX(T5=0,1),CONST(H6),CONST(L6),0,0),COLORYELLOW;
NOTEXT15:IF(CONST(TJ1)-TJ1=7,CONST(H7),DRAWNULL),COLORYELLOW;
NOTEXT16:IF(CONST(TJ1)-TJ1=7,CONST(L7),DRAWNULL),COLORYELLOW;
STICKLINE(T7=0 OR REFX(T6=0,1),CONST(H7),CONST(L7),0,0),COLORYELLOW;
NOTEXT17:IF(CONST(TJ1)-TJ1=8,CONST(H8),DRAWNULL),COLORYELLOW;
NOTEXT18:IF(CONST(TJ1)-TJ1=8,CONST(L8),DRAWNULL),COLORYELLOW;
STICKLINE(T8=0 OR REFX(T7=0,1),CONST(H8),CONST(L8),0,0),COLORYELLOW;
DRAWTEXT(T0=0,NOTEXT1*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H0),2)),'元'))COLORYELLOW;
DRAWTEXT(T0=0,NOTEXT2*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L0),2)),'元'))COLORYELLOW;
DRAWTEXT(T1=0,NOTEXT3*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H1),2)),'元'))COLORYELLOW;
DRAWTEXT(T1=0,NOTEXT4*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L1),2)),'元'))COLORYELLOW;
DRAWTEXT(T2=0,NOTEXT5*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H2),2)),'元'))COLORYELLOW;
DRAWTEXT(T2=0,NOTEXT6*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L2),2)),'元'))COLORYELLOW;
DRAWTEXT(T3=0,NOTEXT7*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H3),2)),'元'))COLORYELLOW;
DRAWTEXT(T3=0,NOTEXT8*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L3),2)),'元'))COLORYELLOW;
DRAWTEXT(T4=0,NOTEXT9*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H4),2)),'元'))COLORYELLOW;
DRAWTEXT(T4=0,NOTEXT10*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L4),2)),'元'))COLORYELLOW;
DRAWTEXT(T5=0,NOTEXT11*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H5),2)),'元'))COLORYELLOW;
DRAWTEXT(T5=0,NOTEXT12*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L5),2)),'元'))COLORYELLOW;
DRAWTEXT(T6=0,NOTEXT13*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H6),2)),'元'))COLORYELLOW;
DRAWTEXT(T6=0,NOTEXT14*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L6),2)),'元'))COLORYELLOW;
DRAWTEXT(T7=0,NOTEXT15*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H7),2)),'元'))COLORYELLOW;
DRAWTEXT(T7=0,NOTEXT16*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L7),2)),'元'))COLORYELLOW;
DRAWTEXT(T8=0,NOTEXT17*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H8),2)),'元'))COLORYELLOW;
DRAWTEXT(T8=0,NOTEXT18*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L8),2)),'元'))COLORYELLOW;
未来函数检测结果如下:
该公式包含未来函数:REFX
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
T赋值:上次WEEKOFYEAR!=1日前的WEEKOFYEAR距今天数
L0赋值:T+1日内L最低值
L1赋值:T+1日前的L0
L2赋值:T+1日前的L1
L3赋值:T+1日前的L2
L4赋值:T+1日前的L3
L5赋值:T+1日前的L4
L6赋值:T+1日前的L5
L7赋值:T+1日前的L6
L8赋值:T+1日前的L7
H0赋值:T+1日内H最高值
H1赋值:T+1日前的H0
H2赋值:T+1日前的H1
H3赋值:T+1日前的H2
H4赋值:T+1日前的H3
H5赋值:T+1日前的H4
H6赋值:T+1日前的H5
H7赋值:T+1日前的H6
H8赋值:T+1日前的H7
TJ:=WEEKOFYEAR!=1日前的WEEKOFYEAR
TJ1:=统计TOTALBARSCOUNT日满足TJ的天数
T0:=上次CROSS(CONST(TJ1距今天数-TJ1=0,0.5))
T1:=上次CROSS(CONST(TJ1距今天数-TJ1=1,0.5))
T2:=上次CROSS(CONST(TJ1距今天数-TJ1=2,0.5))
T3:=上次CROSS(CONST(TJ1距今天数-TJ1=3,0.5))
T4:=上次CROSS(CONST(TJ1距今天数-TJ1=4,0.5))
T5:=上次CROSS(CONST(TJ1距今天数-TJ1=5,0.5))
T6:=上次CROSS(CONST(TJ1距今天数-TJ1=6,0.5))
T7:=上次CROSS(CONST(TJ1距今天数-TJ1=7,0.5))
T8:=上次CROSS(CONST(TJ1距今天数-TJ1=8,0.5))
NOTEXT1:IF(CONST(TJ1)-TJ1=0,CONST(H0),DRAWNULL),画黄色
NOTEXT2:IF(CONST(TJ1)-TJ1=0,CONST(L0),DRAWNULL),画黄色
STICKLINE(T0=0 OR BARSTATUS=2,CONST(H0),CONST(L0),0,0),画黄色
NOTEXT3:IF(CONST(TJ1)-TJ1=1,CONST(H1),DRAWNULL),画黄色
NOTEXT4:IF(CONST(TJ1)-TJ1=1,CONST(L1),DRAWNULL),画黄色
STICKLINE(T1=0 OR REFX(T0=0,1),CONST(H1),CONST(L1),0,0),画黄色
NOTEXT5:IF(CONST(TJ1)-TJ1=2,CONST(H2),DRAWNULL),画黄色
NOTEXT6:IF(CONST(TJ1)-TJ1=2,CONST(L2),DRAWNULL),画黄色
STICKLINE(T2=0 OR REFX(T1=0,1),CONST(H2),CONST(L2),0,0),画黄色
NOTEXT7:IF(CONST(TJ1)-TJ1=3,CONST(H3),DRAWNULL),画黄色
NOTEXT8:IF(CONST(TJ1)-TJ1=3,CONST(L3),DRAWNULL),画黄色
STICKLINE(T3=0 OR REFX(T2=0,1),CONST(H3),CONST(L3),0,0),画黄色
NOTEXT9:IF(CONST(TJ1)-TJ1=4,CONST(H4),DRAWNULL),画黄色
NOTEXT10:IF(CONST(TJ1)-TJ1=4,CONST(L4),DRAWNULL),画黄色
STICKLINE(T4=0 OR REFX(T3=0,1),CONST(H4),CONST(L4),0,0),画黄色
NOTEXT11:IF(CONST(TJ1)-TJ1=5,CONST(H5),DRAWNULL),画黄色
NOTEXT12:IF(CONST(TJ1)-TJ1=5,CONST(L5),DRAWNULL),画黄色
STICKLINE(T5=0 OR REFX(T4=0,1),CONST(H5),CONST(L5),0,0),画黄色
NOTEXT13:IF(CONST(TJ1)-TJ1=6,CONST(H6),DRAWNULL),画黄色
NOTEXT14:IF(CONST(TJ1)-TJ1=6,CONST(L6),DRAWNULL),画黄色
STICKLINE(T6=0 OR REFX(T5=0,1),CONST(H6),CONST(L6),0,0),画黄色
NOTEXT15:IF(CONST(TJ1)-TJ1=7,CONST(H7),DRAWNULL),画黄色
NOTEXT16:IF(CONST(TJ1)-TJ1=7,CONST(L7),DRAWNULL),画黄色
STICKLINE(T7=0 OR REFX(T6=0,1),CONST(H7),CONST(L7),0,0),画黄色
NOTEXT17:IF(CONST(TJ1)-TJ1=8,CONST(H8),DRAWNULL),画黄色
NOTEXT18:IF(CONST(TJ1)-TJ1=8,CONST(L8),DRAWNULL),画黄色
STICKLINE(T8=0 OR REFX(T7=0,1),CONST(H8),CONST(L8),0,0),画黄色
DRAWTEXT(T0=0,NOTEXT1*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H0),2)),'元'))画黄色
DRAWTEXT(T0=0,NOTEXT2*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L0),2)),'元'))画黄色
DRAWTEXT(T1=0,NOTEXT3*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H1),2)),'元'))画黄色
DRAWTEXT(T1=0,NOTEXT4*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L1),2)),'元'))画黄色
DRAWTEXT(T2=0,NOTEXT5*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H2),2)),'元'))画黄色
DRAWTEXT(T2=0,NOTEXT6*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L2),2)),'元'))画黄色
DRAWTEXT(T3=0,NOTEXT7*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H3),2)),'元'))画黄色
DRAWTEXT(T3=0,NOTEXT8*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L3),2)),'元'))画黄色
DRAWTEXT(T4=0,NOTEXT9*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H4),2)),'元'))画黄色
DRAWTEXT(T4=0,NOTEXT10*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L4),2)),'元'))画黄色
DRAWTEXT(T5=0,NOTEXT11*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H5),2)),'元'))画黄色
DRAWTEXT(T5=0,NOTEXT12*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L5),2)),'元'))画黄色
DRAWTEXT(T6=0,NOTEXT13*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H6),2)),'元'))画黄色
DRAWTEXT(T6=0,NOTEXT14*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L6),2)),'元'))画黄色
DRAWTEXT(T7=0,NOTEXT15*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H7),2)),'元'))画黄色
DRAWTEXT(T7=0,NOTEXT16*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L7),2)),'元'))画黄色
DRAWTEXT(T8=0,NOTEXT17*1.02,STRCAT(STRCAT('周高',VAR2STR(CONST(H8),2)),'元'))画黄色
DRAWTEXT(T8=0,NOTEXT18*0.98,STRCAT(STRCAT('周低',VAR2STR(CONST(L8),2)),'元'))画黄色