通达信辅助判断副图源码

刚才看了一个加密限时指标的图,有点感想,就做一个类似的副图指标,供参考。
 
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;

DRAWRECTREL(0,0,350,450,RGB(25,55,144));
{行业板块看盘幅图}
创业板:=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,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;
A1:=REF(CCC,1);
ZF:=(C-REF(C,1))/REF(C,1)*100;
行业指数:=IF(A1>0,(CCC-A1)*100/A1,0);
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;{行业};





来函数检测结果如下:
该公式没有未来函数

解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式

联系我们  |  股票指标网  |  指标网   |  指标公式  |   加入收藏   |  设为主页

@2005-2023 粤ICP备2023063687号-2 股票指标网别名指标网仅为互联网文章,所有股票指标公式及文章仅供学习研究,并不构成投资建议,请勿以此为依据进行股票交易,由此引起的投资亏损与本站无关。股票指标网均来源互联网收集整理,如不慎侵犯了你的权益,请联系我们告知,我们将做删除处理
QQ:88652583 微信 88652583
sitemap站点地图