通达信情绪空间指标 可以显示连板高度、股票代码、连板个数,以及涨停个数 源码附图
{参数B1:控制"股票代码"的显示位置,可以根据显示情况调节
参数B2:控制"连板个数"的显示位置,可以根据显示情况调节
参数X1:如果X1=1,显示"涨停数"曲线以及对应的取值;
如果X1=0,则只显示曲线,不显示取值;默认X1=0;
参数X2:如果X2=1,显示"连板个数"曲线以及对应的取值;
如果X2=0,则只显示曲线,不显示取值;默认X2=0;
}
B1:=1.15;
B2:=0.06;
X1:=0;
X2:=0;
下跌:"880003$DECLINE",COLORGREEN NODRAW;
上涨:"880003$ADVANCE",COLORRED NODRAW;
跌停数:SCJYVALUE(24,2,0),COLORGREEN NODRAW;
涨停数:SCJYVALUE(24,1,0), COLOR5E409B NODRAW ;
连板高度:SCJYVALUE(30,1,0)COLORWHITE NODRAW;
连板个数:SCJYVALUE(23,2,0), COLOR808080,NODRAW;
LBGD:=连板高度;
TJ1:=LBGD;
TJ2:=REFX(TJ1,1);
NOTEXTLBGD1:IF(TJ1<2 AND TJ2>2,TJ2-1,TJ1),COLORD6A82E LINETHICK2;
NOTEXTLBGD2:IF(LBGD>1,LBGD,DRAWNULL), CIRCLEDOT COLORC0C0C0 ;
NOTEXTLBGD3:IF(LBGD>1 AND LBGD<REF(LBGD,1),LBGD,DRAWNULL),COLOR408000 LINETHICK2;{ COLOR32BC39}
NOTEXTLBGD4:IF(LBGD>1 AND LBGD>REFX(LBGD,1),LBGD,DRAWNULL),COLOR408000 LINETHICK2;
NOTEXTLBGD5:IF(LBGD>1 AND LBGD>REF(LBGD,1),LBGD,DRAWNULL),COLOR3AABDC LINETHICK2;
NOTEXTLBGD6:IF(LBGD>1 AND LBGD<REFX(LBGD,1),LBGD,DRAWNULL),COLOR3AABDC LINETHICK2;
NOTEXTLBGD7:IF(LBGD>1 AND LBGD>REF(LBGD,1) AND LBGD>4,LBGD,DRAWNULL),COLOR6A2EE9 LINETHICK2;
DRAWNUMBER(LBGD>1,LBGD,LBGD)DRAWABOVE;
HZT:=CONST(HHV(涨停数,300));
HLB:=CONST(HHV(LBGD,300));
HLBGS:=CONST(HHV(连板个数,300));
TEMP1:=HLB*涨停数/HZT;
NOTEXT涨停:HLB*涨停数/HZT,COLOR5E409B ;
NOTEXT涨停2:IF(TEMP1>0 AND X1=1,TEMP1,DRAWNULL),COLOR5E409B POINTDOT LINETHICK4;
DRAWNUMBER(涨停数>0 AND X1=1,TEMP1,涨停数)DRAWABOVE COLOR5E409B;
NOTEXT连板:HLB*连板个数/HLBGS, COLOR808080;
TEMP2:=HLB*连板个数/HLBGS;
NOTEXT连板2:IF(连板个数>0 AND X2=1,TEMP2,DRAWNULL), POINTDOT LINETHICK4 COLOR808080;
DRAWNUMBER(连板个数>1 AND X2=1,TEMP2*B2,连板个数)COLOR808080 DRAWABOVE;
股票代码:INSUM('历史连板股','LBZG',1,2),NODRAW COLOR6A2EE9;
T1:=股票代码;
E1:=MOD(INTPART(T1/100000),10);
E2:=MOD(INTPART(T1/10000),10);
E3:=MOD(INTPART(T1/1000),10);
E4:=MOD(INTPART(T1/100),10);
E5:=MOD(INTPART(T1/10),10);
E6:=MOD(T1,10);
DRAWTEXT(LBGD>5 AND LBGD>REFV(LBGD,1) AND LBGD>REFX(LBGD,1),LBGD*B1,VARCAT(VAR2STR(E1,0),VARCAT(VAR2STR(E2,0),VARCAT(VAR2STR(E3,0),VARCAT(VAR2STR(E4,0),VARCAT(VAR2STR(E5,0),VAR2STR(E6,0)))))))COLOR6A2EE9;
DRAWTEXT(ISLASTBAR,LBGD*B1,VARCAT(VAR2STR(E1,0),VARCAT(VAR2STR(E2,0),VARCAT(VAR2STR(E3,0),VARCAT(VAR2STR(E4,0),VARCAT(VAR2STR(E5,0),VAR2STR(E6,0)))))))COLOR6A2EE9;
WK:=WEEKDAY;
DRAWTEXT(WK=1,0,'一')COLOR808080;
DRAWTEXT(WK=2,0,'二')COLOR808080;
DRAWTEXT(WK=3,0,'三')COLOR808080;
DRAWTEXT(WK=4,0,'四')COLOR808080;
DRAWTEXT(WK=5,0,'五')COLOR808080;
未来函数检测结果如下:
该公式包含未来函数:REFX
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
{参数B1:控制"股票代码"的显示位置,可以根据显示情况调节 参数输出B2:控制"连板个数"的显示位置,可以根据显示情况调节 参数输出X1:如果X1=1,显示"涨停数"曲线以及对应的取值; 如果X1=0,则只显示曲线,不显示取值;默认X1=0
输出参数X2:如果X2=1,显示"连板个数"曲线以及对应的取值; 如果X2=0,则只显示曲线,不显示取值;默认X2=0
}B1赋值:1.15
B2赋值:0.06
X1赋值:0
X2赋值:0
输出下跌:"880003$DECLINE",画绿色 NODRAW
输出上涨:"880003$ADVANCE",画红色 NODRAW
输出跌停数:SCJYVALUE(24,2,0),画绿色 NODRAW
输出涨停数:SCJYVALUE(24,1,0), COLOR5E409B NODRAW
输出连板高度:SCJYVALUE(30,1,0)画白色 NODRAW
输出连板个数:SCJYVALUE(23,2,0), COLOR808080,NODRAW
LBGD赋值:连板高度
TJ1赋值:LBGD
TJ2赋值:REFX(TJ1,1)
如果TJ1<2 AND TJ2>2返回TJ2-1否则返回TJ1
如果LBGD>1返回LBGD否则返回DRAWNULL
NOTEXTLBGD3:IF(LBGD>1 AND LBGD<1日前的LBGD,LBGD,DRAWNULL),COLOR408000 线宽为2
{ COLOR32BC39}NOTEXTLBGD4:IF(LBGD>1 AND LBGD>REFX(LBGD,1),LBGD,DRAWNULL),COLOR408000 线宽为2
NOTEXTLBGD5:IF(LBGD>1 AND LBGD>1日前的LBGD,LBGD,DRAWNULL),COLOR3AABDC 线宽为2
NOTEXTLBGD6:IF(LBGD>1 AND LBGDNOTEXTLBGD7:IF(LBGD>1 AND LBGD>1日前的LBGD AND LBGD>4,LBGD,DRAWNULL),COLOR6A2EE9 线宽为2
DRAWNUMBER(LBGD>1,LBGD,LBGD)DRAWABOVE
HZT赋值:CONST(300日内涨停数最高值)
HLB赋值:CONST(300日内LBGD最高值)
HLBGS:=CONST(300日内连板个数最高值)
TEMP1赋值:HLB*涨停数/HZT
输出NOTEXT涨停:HLB*涨停数/HZT,COLOR5E409B
如果TEMP1>0 AND X1=1返回TEMP1否则返回DRAWNULL
DRAWNUMBER(涨停数>0 AND X1=1,TEMP1,涨停数)DRAWABOVE COLOR5E409B
输出NOTEXT连板:HLB*连板个数/HLBGS, COLOR808080
TEMP2赋值:HLB*连板个数/HLBGS
如果连板个数>0 AND X2=1返回TEMP2否则返回DRAWNULL
DRAWNUMBER(连板个数>1 AND X2=1,TEMP2*B2,连板个数)COLOR808080 DRAWABOVE
输出股票代码:INSUM('历史连板股','LBZG',1,2),NODRAW COLOR6A2EE9
T1赋值:股票代码
E1赋值:MOD(INTPART(T1/100000),10)
E2赋值:MOD(INTPART(T1/10000),10)
E3赋值:MOD(INTPART(T1/1000),10)
E4赋值:MOD(INTPART(T1/100),10)
E5赋值:MOD(INTPART(T1/10),10)
E6赋值:MOD(T1,10)
DRAWTEXT(LBGD>5 AND LBGD>REFV(LBGD,1) AND LBGD>REFX(LBGD,1),LBGD*B1,VARCAT(VAR2STR(E1,0),VARCAT(VAR2STR(E2,0),VARCAT(VAR2STR(E3,0),VARCAT(VAR2STR(E4,0),VARCAT(VAR2STR(E5,0),VAR2STR(E6,0)))))))COLOR6A2EE9
DRAWTEXT(ISLASTBAR,LBGD*B1,VARCAT(VAR2STR(E1,0),VARCAT(VAR2STR(E2,0),VARCAT(VAR2STR(E3,0),VARCAT(VAR2STR(E4,0),VARCAT(VAR2STR(E5,0),VAR2STR(E6,0)))))))COLOR6A2EE9
WK赋值:WEEKDAY
当满足条件WK=1时,在0和'一'位置书写文字
当满足条件WK=2时,在0和'二'位置书写文字
当满足条件WK=3时,在0和'三'位置书写文字
当满足条件WK=4时,在0和'四'位置书写文字
当满足条件WK=5时,在0和'五'位置书写文字