通达信看盘幅图优化版
创业板:=INBLOCK('创业板');
中小企业:=INBLOCK('中小企业');
上证A股:=INBLOCK('上证A股');
深证A股:=INBLOCK('深证A股');
INDEH:=IF(中小企业=1,"399005$H",IF(创业板=1,"399006$H",IF(上证A股=1,"999999$H","399001$H"))),NODRAW;
INDEO:=IF(中小企业=1,"399005$O",IF(创业板=1,"399006$O",IF(上证A股=1,"999999$O","399001$O"))),NODRAW;
INDEL:=IF(中小企业=1,"399005$L",IF(创业板=1,"399006$L",IF(上证A股=1,"999999$L","399001$L"))),NODRAW;
INDEC:=IF(中小企业=1,"399005$C",IF(创业板=1,"399006$C",IF(上证A股=1,"999999$C","399001$C"))),NODRAW;
板块:=IF(中小企业=1,'中小企业指数',IF(创业板=1,'创业板指数',IF(上证A股=1,'上证指数','深证指数')));
AA:=REF(INDEC,1);
指数涨幅:=IF(AA>0,(INDEC-AA)*100/AA,0);
A:=STRCAT(板块,STRCAT(':',CON2STR(INDEC,2)));
B:=STRCAT('指数涨跌:',CON2STR(指数涨幅,2));
DRAWTEXT_FIX(ISLASTBAR,0,0,0,A),COLOR0055FF;
DRAWTEXT_FIX(ISLASTBAR,0.15,0,0,B),COLOR0055FF;
CC:=HY_INDEXC;
OO:=HY_INDEXO;
LL:=HY_INDEXL;
HH:=HY_INDEXH;
DRAWKLINE(HH,OO,LL,CC);
上涨:=VARCAT('上涨:',VAR2STR(HY_INDEXADV,0));
下跌:=VARCAT('下跌:',VAR2STR(HY_INDEXDEC,0));
DRAWTEXT_FIX(ISLASTBAR,0.3,0,0,上涨),COLORMAGENTA;
DRAWTEXT_FIX(ISLASTBAR,0.4,0,0,下跌),COLORYELLOW;
A1:=REF(CC,1);
ZF:=(C-REF(C,1))/REF(C,1)*100;
行业指数:=IF(A1>0,(CC-A1)*100/A1,0);
D:=STRCAT('行业指数:',CON2STR(CC,2));
E:=STRCAT('行业涨跌:',CON2STR(行业指数,2));
DRAWTEXT_FIX(ISLASTBAR,0,0.3,0,D),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.15,0.3,0,E),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.3,0.3,0,HYBLOCK),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR AND 指数涨幅<=行业指数,0.5,0,0,'版强'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR AND 指数涨幅>行业指数,0.5,0,0,'版弱'),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR AND ZF>=行业指数,0.6,0,0,'股强'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR AND ZF<行业指数,0.6,0,0,'股弱'),COLORCYAN;
M5:MA(CC,5);
M10:MA(CC,10);
M20:MA(CC,20);
M60:MA(CC,60);
来函数检测结果如下:
该公式没有未来函数
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
创业板赋值:INBLOCK('创业板')
中小企业赋值:INBLOCK('中小企业')
上证A股赋值:INBLOCK('上证A股')
深证A股赋值:INBLOCK('深证A股')
INDEH赋值:IF(中小企业=1,"399005$H",IF(创业板=1,"399006$H",IF(上证A股=1,"999999$H","399001$H"))),NODRAW
INDEO赋值:IF(中小企业=1,"399005$O",IF(创业板=1,"399006$O",IF(上证A股=1,"999999$O","399001$O"))),NODRAW
INDEL赋值:IF(中小企业=1,"399005$L",IF(创业板=1,"399006$L",IF(上证A股=1,"999999$L","399001$L"))),NODRAW
INDEC赋值:IF(中小企业=1,"399005$C",IF(创业板=1,"399006$C",IF(上证A股=1,"999999$C","399001$C"))),NODRAW
板块赋值:IF(中小企业=1,'中小企业指数',IF(创业板=1,'创业板指数',IF(上证A股=1,'上证指数','深证指数')))
AA赋值:1日前的INDEC
指数涨幅赋值:IF(AA>0,(INDEC-AA)*100/AA,0)
A:=STRCAT(板块,STRCAT(':',CON2STR(INDEC,2)))
B赋值:STRCAT('指数涨跌:',CON2STR(指数涨幅,2))
当满足条件ISLASTBAR时,在横轴0纵轴0位置书写文字
当满足条件ISLASTBAR时,在横轴0.15纵轴0位置书写文字
CC赋值:HY_INDEXC
OO赋值:HY_INDEXO
LL赋值:HY_INDEXL
HH赋值:HY_INDEXH
DRAWKLINE(HH,OO,LL,CC)
上涨赋值:VARCAT('上涨:',VAR2STR(HY_INDEXADV,0))
下跌赋值:VARCAT('下跌:',VAR2STR(HY_INDEXDEC,0))
当满足条件ISLASTBAR时,在横轴0.3纵轴0位置书写文字
当满足条件ISLASTBAR时,在横轴0.4纵轴0位置书写文字
A1赋值:1日前的CC
ZF赋值:(C-1日前的C)/1日前的C*100
行业指数赋值:IF(A1>0,(CC-A1)*100/A1,0)
D赋值:STRCAT('行业指数:',CON2STR(CC,2))
E赋值:STRCAT('行业涨跌:',CON2STR(行业指数,2))
当满足条件ISLASTBAR时,在横轴0纵轴0.3位置书写文字
当满足条件ISLASTBAR时,在横轴0.15纵轴0.3位置书写文字
当满足条件ISLASTBAR时,在横轴0.3纵轴0.3位置书写文字
当满足条件ISLASTBAR AND 指数涨幅<=行业指数时,在横轴0.5纵轴0位置书写文字
当满足条件ISLASTBAR AND 指数涨幅>行业指数时,在横轴0.5纵轴0位置书写文字
当满足条件ISLASTBAR AND ZF>=行业指数时,在横轴0.6纵轴0位置书写文字
当满足条件ISLASTBAR AND ZF<行业指数时,在横轴0.6纵轴0位置书写文字
输出M5:CC的5日简单移动平均
输出M10:CC的10日简单移动平均
输出M20:CC的20日简单移动平均
输出M60:CC的60日简单移动平均