代写指标 通达信板块股票强弱副图 看板块强弱指标
DRAWRECTREL(0,0,350,550,RGB(25,55,144));
MA1:MA(HY_INDEXC,5);
MA2:MA(HY_INDEXC,10);
MA3:MA(HY_INDEXC,20);
MA4:MA(HY_INDEXC,60);
煤炭C:="880301$C",NODRAW;
电力C:="880305$C";
石油C:="880310$C";
钢铁C:="880318$C";
有色C:="880324$C";
化纤C:="880330$C";
化工C:="880335$C";
建材C:="880344$C";
造纸C:="880350$C";
矿物制品C:="880351$C";
日用化工C:="880355$C";
农林牧渔C:="880360$C";
纺织服饰C:="880367$C";
食品饮料C:="880372$C";
酿酒C:="880380$C";
家用电器C:="880387$C";
汽车类C:="880390$C";
医疗保健C:="880398$C";
家具用品C:="880399$C";
医药C:="880400$C";
商业连锁C:="880406$C";
商贸代理C:="880414$C";
传媒娱乐C:="880418$C";
广告包装C:="880421$C";
文教休闲C:="880422$C";
酒店餐饮C:="880423$C";
旅游C:="880424$C";
航空C:="880430$C";
船舶C:="880431$C";
运输设备C:="880432$C";
通用机械C:="880437$C";
工业机械C:="880440$C";
电气设备C:="880446$C";
工程机械C:="880447$C";
电器仪表C:="880448$C";
电信运营C:="880452$C";
公共交通C:="880453$C";
水务C:="880454$C";
供气供热C:="880455$C";
环境保护C:="880456$C";
运输服务C:="880459$C";
仓储物流C:="880464$C";
交通设施C:="880465$C";
银行C:="880471$C";
证券C:="880472$C";
保险C:="880473$C";
多元金融C:="880474$C";
建筑C:="880476$C";
房地产C:="880482$C";
IT设备C:="880489$C";
通信设备C:="880490$C";
半导体C:="880491$C";
元器件C:="880492$C";
软件服务C:="880493$C";
互联网C:="880494$C";
综合类C:="880497$C";
上证指数C:="999999$C",NODRAW;
深证成指C:="399001$C",NODRAW;
中小板指C:="399005$C",NODRAW;
创业板指C:="399006$C",NODRAW;
{DRAWKLINE(H,O,L,C);}
CCC:=HY_INDEXC;
OOO:=HY_INDEXO;
LLL:=HY_INDEXL;
HHH:=HY_INDEXH;
DRAWKLINE(HHH,OOO,LLL,CCC);
MA(CCC,5),COLORRED;
IF(MA(CCC,5)<=REF(MA(CCC,5),1),MA(CCC,5),DRAWNULL),COLORGREEN;
指数价格:HY_INDEXC,NODRAW;
股票价格:C,NODRAW;
行业涨幅:HY_INDEXC/REF(HY_INDEXC,1)*100-100,NODRAW,COLORRED;
{行业板块看盘幅图}
创业板:=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);
A1:=REF(CCC,1);
ZF:=(C-REF(C,1))/REF(C,1)*100;
行业指数:=IF(A1>0,(CCC-A1)*100/A1,0),NODRAW;
指数涨幅:=IF(AA>0,(INDEC-AA)*100/AA,0);
A:=STRCAT(板块,STRCAT(':',CON2STR(INDEC,2)));
B:=STRCAT('指数涨跌:',CON2STR(指数涨幅,2));
DRAWTEXT_FIX(ISLASTBAR,0.0,0,0,A),COLOR0055FF;
DRAWTEXT_FIX(ISLASTBAR,0.12,0,0,B),COLOR0055FF;
上涨:=VARCAT('上涨:',VAR2STR(HY_INDEXADV,0));
下跌:=VARCAT('下跌:',VAR2STR(HY_INDEXDEC,0));
DRAWTEXT_FIX(ISLASTBAR,0.22,0.15,0,上涨),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.28,0.15,0,下跌),COLORYELLOW;
个股涨幅:(C-REF(C,1))/REF(C,1)*100,NODRAW,COLORRED;
DD:=STRCAT('行业指数:',CON2STR(CCC,2));
E:=STRCAT('行业涨跌:',CON2STR(行业指数,2));
DRAWTEXT_FIX(ISLASTBAR,0,0.15,0,DD),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR,0.12,0.15,0,E),COLORYELLOW;
DRAWTEXT_FIX(ISLASTBAR AND 指数涨幅<=行业指数,0.22,0.0,0,'板块强'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR AND 指数涨幅>行业指数,0.22,0.0,0,'板块弱'),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR AND ZF>=行业指数,0.28,0.0,0,'股票强'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR AND ZF<行业指数,0.28,0.0,0,'股票弱'),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR,0,0.3,0,HYBLOCK),COLORCYAN;{所属行业};
DRAWTEXT_FIX(ISLASTBAR,0.12,0.3,0,GNBLOCK),COLORCYAN;{行业};
HG1165:=STRCAT( '在 ' ,'');
HG1504:=STRCAT( ' ' ,'');
HG1166:=STRCAT( ' 板块中,涨幅第 ' ,''),COLORYELLOW;
HG1167:=STRCAT( ' 名' ,''),COLORYELLOW;
TJ2AA:=HORCALC(HYBLOCK,105,1,DRAWNULL);
TJ4AA:=STRCAT(STRCAT(HG1165,HG1504),HG1504);
DRAWTEXT_FIX(ISLASTBAR,0,0.4,0,STRCAT(TJ4AA,STRCAT(HG1166,STRCAT(CON2STR(TJ2AA,0),HG1167)))),COLORCYAN;
DRAWTEXT_FIX(ISLASTBAR,0,0.4,0,STRCAT(' ',HYBLOCK)),COLORYELLOW;
板块排序:=HORCALC('板块指数',105,1,0),COLOR00FFFF;
来函数检测结果如下:
该公式没有未来函数
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
DRAWRECTREL(0,0,350,550,RGB(25,55,144))
输出MA1:HY_INDEXC的5日简单移动平均
输出MA2:HY_INDEXC的10日简单移动平均
输出MA3:HY_INDEXC的20日简单移动平均
输出MA4:HY_INDEXC的60日简单移动平均
煤炭C赋值:"880301$C",NODRAW
电力C赋值:"880305$C"
石油C赋值:"880310$C"
钢铁C赋值:"880318$C"
有色C赋值:"880324$C"
化纤C赋值:"880330$C"
化工C赋值:"880335$C"
建材C赋值:"880344$C"
造纸C赋值:"880350$C"
矿物制品C赋值:"880351$C"
日用化工C赋值:"880355$C"
农林牧渔C赋值:"880360$C"
纺织服饰C赋值:"880367$C"
食品饮料C赋值:"880372$C"
酿酒C赋值:"880380$C"
家用电器C赋值:"880387$C"
汽车类C赋值:"880390$C"
医疗保健C赋值:"880398$C"
家具用品C赋值:"880399$C"
医药C赋值:"880400$C"
商业连锁C赋值:"880406$C"
商贸代理C赋值:"880414$C"
传媒娱乐C赋值:"880418$C"
广告包装C赋值:"880421$C"
文教休闲C赋值:"880422$C"
酒店餐饮C赋值:"880423$C"
旅游C赋值:"880424$C"
航空C赋值:"880430$C"
船舶C赋值:"880431$C"
运输设备C赋值:"880432$C"
通用机械C赋值:"880437$C"
工业机械C赋值:"880440$C"
电气设备C赋值:"880446$C"
工程机械C赋值:"880447$C"
电器仪表C赋值:"880448$C"
电信运营C赋值:"880452$C"
公共交通C赋值:"880453$C"
水务C赋值:"880454$C"
供气供热C赋值:"880455$C"
环境保护C赋值:"880456$C"
运输服务C赋值:"880459$C"
仓储物流C赋值:"880464$C"
交通设施C赋值:"880465$C"
银行C赋值:"880471$C"
证券C赋值:"880472$C"
保险C赋值:"880473$C"
多元金融C赋值:"880474$C"
建筑C赋值:"880476$C"
房地产C赋值:"880482$C"
IT设备C赋值:"880489$C"
通信设备C赋值:"880490$C"
半导体C赋值:"880491$C"
元器件C赋值:"880492$C"
软件服务C赋值:"880493$C"
互联网C赋值:"880494$C"
综合类C赋值:"880497$C"
上证指数C赋值:"999999$C",NODRAW
深证成指C赋值:"399001$C",NODRAW
中小板指C赋值:"399005$C",NODRAW
创业板指C赋值:"399006$C",NODRAW
{DRAWKLINE(H,O,L,C)
}CCC赋值:HY_INDEXC
OOO赋值:HY_INDEXO
LLL赋值:HY_INDEXL
HHH赋值:HY_INDEXH
DRAWKLINE(HHH,OOO,LLL,CCC)
CCC的5日简单移动平均,COLORRED
IF(CCC的5日简单移动平均<=REF(CCC的5日简单移动平均,1),CCC的5日简单移动平均,DRAWNULL),COLORGREEN
输出指数价格:HY_INDEXC,NODRAW
输出股票价格:C,NODRAW
输出行业涨幅:HY_INDEXC/1日前的HY_INDEXC*100-100,NODRAW,COLORRED
{行业板块看盘幅图}创业板赋值: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
A1赋值:1日前的CCC
ZF赋值:(C-1日前的C)/1日前的C*100
行业指数赋值:IF(A1>0,(CCC-A1)*100/A1,0),NODRAW
指数涨幅赋值:IF(AA>0,(INDEC-AA)*100/AA,0)
A:=STRCAT(板块,STRCAT(':',CON2STR(INDEC,2)))
B赋值:STRCAT('指数涨跌:',CON2STR(指数涨幅,2))
当满足条件ISLASTBAR时,在横轴0.0纵轴0位置书写文字
当满足条件ISLASTBAR时,在横轴0.12纵轴0位置书写文字
上涨赋值:VARCAT('上涨:',VAR2STR(HY_INDEXADV,0))
下跌赋值:VARCAT('下跌:',VAR2STR(HY_INDEXDEC,0))
当满足条件ISLASTBAR时,在横轴0.22纵轴0.15位置书写文字
当满足条件ISLASTBAR时,在横轴0.28纵轴0.15位置书写文字
输出个股涨幅:(C-1日前的C)/1日前的C*100,NODRAW,COLORRED
DD赋值:STRCAT('行业指数:',CON2STR(CCC,2))
E赋值:STRCAT('行业涨跌:',CON2STR(行业指数,2))
当满足条件ISLASTBAR时,在横轴0纵轴0.15位置书写文字
当满足条件ISLASTBAR时,在横轴0.12纵轴0.15位置书写文字
当满足条件ISLASTBAR AND 指数涨幅<=行业指数时,在横轴0.22纵轴0.0位置书写文字
当满足条件ISLASTBAR AND 指数涨幅>行业指数时,在横轴0.22纵轴0.0位置书写文字
当满足条件ISLASTBAR AND ZF>=行业指数时,在横轴0.28纵轴0.0位置书写文字
当满足条件ISLASTBAR AND ZF<行业指数时,在横轴0.28纵轴0.0位置书写文字
当满足条件ISLASTBAR时,在横轴0纵轴0.3位置书写文字
{所属行业}
当满足条件ISLASTBAR时,在横轴0.12纵轴0.3位置书写文字
{行业}
HG1165赋值:STRCAT( '在 ' ,'')
HG1504赋值:STRCAT( ' ' ,'')
HG1166赋值:STRCAT( ' 板块中,涨幅第 ' ,''),COLORYEL最低价
HG1167赋值:STRCAT( ' 名' ,''),COLORYEL最低价
TJ2AA赋值:HORCALC(HYBLOCK,105,1,DRAWNULL)
TJ4AA赋值:STRCAT(STRCAT(HG1165,HG1504),HG1504)
DRAWTEXT_FIX(ISLASTBAR,0,0.4,0,STRCAT(TJ4AA,STRCAT(HG1166,STRCAT(CON2STR(TJ2AA,0),HG1167)))),画青色
DRAWTEXT_FIX(ISLASTBAR,0,0.4,0,STRCAT(' ',HYBLOCK)),COLORYEL最低价
板块排序:=HORCALC('板块指数',105,1,0),COLOR00FFFF