行业分析加强版指标 公式 源码[通达信公式]
指标公式代码分析:
这段指标源码是用于分析行业板块的盘面情况,并通过绘制图表和文字显示来展示涨跌家数、涨跌幅等信息。下面是对该指标源码的简要编程思路及指标使用说明:
1. 首先,该指标代码通过获取不同板块(创业板、中小企业、上证A股、深证A股)的数据,并定义了相应的指数和涨跌幅计算公式。
2. 接着,通过调用相应的函数和绘制函数,绘制盘面图表和文字。
3. 盘面图表部分包括绘制K线图和绘制不同均线指标(MA5、MA10、MA20、MA60)。
4. 文字部分展示了各板块的涨跌家数、涨跌幅以及行业指数的涨跌幅等信息。
编程思路:
- 首先,需要获取各板块的行情数据,可以使用相关的数据接口或者自行编写获取数据的代码。
- 然后,根据获取的数据计算指标所需的各项参数,如涨跌幅、涨跌家数等。
- 利用绘图函数,将获取的数据进行可视化展示,包括K线图和文字说明。
- 最后,根据指标的使用说明,根据具体情况进行相关的操作,如观察板块强弱、个股强弱等情况。
使用说明:
- 该指标主要用于分析行业板块的盘面情况,包括涨跌家数、涨跌幅等各项指标。
- 通过观察图表和文字说明,可以了解不同板块的相对强弱和个股的强弱情况。
- 根据指标的使用说明,可以做出相应的交易决策,如根据板块强弱情况选择适合的交易策略。
- 使用时需要注意数据的准确性和实时性,及时更新数据以保证分析的准确性。
以上是对该指标源码的简要编程思路及使用说明。实际使用时,还需要根据具体需求和情况进行进一步的调整和优化。
源码:
{行业板块看盘幅图}创业板:=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,'上证指数','深证指数')));指数涨幅:=(INDEC-REF(INDEC,1))*100/REF(INDEC,1);A:=STRCAT(板块,STRCAT(':',CON2STR(INDEC,2)));B:=STRCAT(STRCAT('指数涨跌:',CON2STR(指数涨幅,2)),' %');DRAWTEXT_FIX(ISLASTBAR,0,0,0,A),COLOR0055FF;DRAWTEXT_FIX(ISLASTBAR,0.1,0,0,B),COLOR0055FF;沪A涨家数:="999999$ADVANCE",COLORRED,NODRAW;沪A跌家数:="999999$DECLINE",COLORGREEN,NODRAW;深A涨家数:="399001$ADVANCE",COLORRED,NODRAW;深A跌家数:="399001$DECLINE",COLORGREEN,NODRAW;中小涨家数:="399005$ADVANCE",COLORRED,NODRAW;中小跌家数:="399005$DECLINE",COLORGREEN,NODRAW;创业涨家数:="399006$ADVANCE",COLORRED,NODRAW;创业跌家数:="399006$DECLINE",COLORGREEN,NODRAW;上涨总家数:=沪A涨家数+深A涨家数,COLORRED,NODRAW;下跌总家数:=沪A跌家数+深A跌家数,COLORGREEN,NODRAW;BBB1:=STRCAT('沪A涨家数: ',CON2STR(沪A涨家数,0));DRAWTEXT_FIX(ISLASTBAR,0,0.06,0,BBB1),COLORRED;BBB2:=STRCAT('沪A跌家数: ',CON2STR(沪A跌家数,0));DRAWTEXT_FIX(ISLASTBAR,0,0.12,0,BBB2),COLORGREEN;BBB3:=STRCAT('深A涨家数: ',CON2STR(深A涨家数,0));DRAWTEXT_FIX(ISLASTBAR,0.1,0.06,0,BBB3),COLORRED;BBB4:=STRCAT('深A跌家数: ',CON2STR(深A跌家数,0));DRAWTEXT_FIX(ISLASTBAR,0.1,0.12,0,BBB4),COLORGREEN;BBB5:=STRCAT('中小涨家数: ',CON2STR(中小涨家数,0));DRAWTEXT_FIX(ISLASTBAR,0.2,0.06,0,BBB5),COLORRED;BBB6:=STRCAT('中小跌家数:',CON2STR(中小跌家数,0));DRAWTEXT_FIX(ISLASTBAR,0.2,0.12,0,BBB6),COLORGREEN;BBB7:=STRCAT('创业涨家数: ',CON2STR(创业涨家数,0));DRAWTEXT_FIX(ISLASTBAR,0.3,0.06,0,BBB7),COLORRED;BBB8:=STRCAT('创业跌家数: ',CON2STR(创业跌家数,0));DRAWTEXT_FIX(ISLASTBAR,0.3,0.12,0,BBB8),COLORGREEN;上涨总家数比:=上涨总家数/(上涨总家数+下跌总家数)*100,COLORRED,NODRAW;下跌总家数比:=下跌总家数/(上涨总家数+下跌总家数)*100,COLORGREEN,NODRAW;沪A上涨家数比:=沪A涨家数/(沪A涨家数+沪A跌家数)*100,COLORRED,NODRAW;沪A下跌家数比:=沪A跌家数/(沪A涨家数+沪A跌家数)*100,COLORGREEN,NODRAW;深A上涨家数比:=深A涨家数/(深A涨家数+深A跌家数)*100,COLORRED,NODRAW;深A下跌家数比:=深A跌家数/(深A涨家数+深A跌家数)*100,COLORGREEN,NODRAW;中小上涨家数比:=中小涨家数/(中小涨家数+中小跌家数)*100,COLORRED,NODRAW;中小下跌家数比:=中小跌家数/(中小涨家数+中小跌家数)*100,COLORGREEN,NODRAW;创业上涨家数比:=创业涨家数/(创业涨家数+创业跌家数)*100,COLORRED,NODRAW;创业下跌家数比:=创业跌家数/(创业涨家数+创业跌家数)*100,COLORGREEN,NODRAW;AAA1:=STRCAT(STRCAT('上涨总家数比 ',CON2STR(上涨总家数比,0)),' %');DRAWTEXT_FIX(ISLASTBAR,0.4,0.06,0,AAA1),COLORRED;AAA2:=STRCAT(STRCAT('下跌总家数比 ',CON2STR(下跌总家数比,0)),' %');DRAWTEXT_FIX(ISLASTBAR,0.4,0.12,0,AAA2),COLORGREEN;AAA3:=STRCAT(STRCAT('沪A上涨家数比 ',CON2STR(沪A上涨家数比,0)),' %');DRAWTEXT_FIX(ISLASTBAR,0.5,0.06,0,AAA3),COLORRED;AAA4:=STRCAT(STRCAT('沪A下跌家数比 ',CON2STR(沪A下跌家数比,0)),' %');DRAWTEXT_FIX(ISLASTBAR,0.5,0.12,0,AAA4),COLORGREEN;AAA5:=STRCAT(STRCAT('深A上涨家数比 ',CON2STR(深A上涨家数比,0)),' %');DRAWTEXT_FIX(ISLASTBAR,0.6,0.06,0,AAA5),COLORRED;AAA6:=STRCAT(STRCAT('深A下跌家数比 ',CON2STR(深A下跌家数比,0)),' %');DRAWTEXT_FIX(ISLASTBAR,0.6,0.12,0,AAA6),COLORGREEN;AAA7:=STRCAT(STRCAT('中小上涨家数比 ',CON2STR(中小上涨家数比,0)),' %');DRAWTEXT_FIX(ISLASTBAR,0.7,0.06,0,AAA7),COLORRED;AAA8:=STRCAT(STRCAT('中小下跌家数比 ',CON2STR(中小下跌家数比,0)),' %');DRAWTEXT_FIX(ISLASTBAR,0.7,0.12,0,AAA8),COLORGREEN;AAA9:=STRCAT(STRCAT('创业上涨家数比 ',CON2STR(创业上涨家数比,0)),' %');DRAWTEXT_FIX(ISLASTBAR,0.8,0.06,0,AAA9),COLORRED;AAA10:=STRCAT(STRCAT('创业下跌家数比 ',CON2STR(创业下跌家数比,0)),' %');DRAWTEXT_FIX(ISLASTBAR,0.8,0.12,0,AAA10),COLORGREEN;CCC:=HY_INDEXC;OOO:=HY_INDEXO;LLL:=HY_INDEXL;HHH:=HY_INDEXH;DRAWKLINE(HHH,OOO,LLL,CCC);MA5:MA(CCC,5);MA10:MA(CCC,10);MA20:MA(CCC,20);MA60:MA(CCC,60);上涨:=cxhCAT('行业上涨:',cxh2STR(HY_INDEXADV,0));下跌:=cxhCAT('行业下跌:',cxh2STR(HY_INDEXDEC,0));DRAWTEXT_FIX(ISLASTBAR,0.7,0,0,上涨),COLORMAGENTA;DRAWTEXT_FIX(ISLASTBAR,0.8,0,0,下跌),COLORYELLOW;ZF:=(C-REF(C,1))/REF(C,1)*100;行业指数:=(CCC-REF(CCC,1))*100/REF(CCC,1);DD:=STRCAT('行业指数:',CON2STR(CCC,2));E:=STRCAT(STRCAT('行业涨跌:',CON2STR(行业指数,2)),' %');DRAWTEXT_FIX(ISLASTBAR,0.2,0,0,DD),COLORYELLOW;DRAWTEXT_FIX(ISLASTBAR,0.3,0,0,E),COLORYELLOW;DRAWTEXT_FIX(ISLASTBAR,0.4,0,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;DRAWTEXT_FIX(1,0.0,0.43,0,'【说明:早盘如果持有的股票:板弱、股弱。遇到急拉,坚决高抛低吸。】'),COLOR0080FF;DRAWTEXT_FIX(1,0.0,0.50,0,'【如果板强、股弱:等待股弱转股强。如果盘中一直处于板强、股弱:坚决做短线T】'),COLOR0080FF;DRAWTEXT_FIX(1,0.0,0.57,0,'【遇到板强、股强:持股不动。遇到板弱、股强:看个股量,如果放量强持股不动。如果急拉不放量,应高抛低吸】'),COLOR0080FF;DRAWTEXT_FIX(1,0.0,0.64,0,'【遇到上涨家数迅速增加:考虑补仓或者持股不动,反之减仓。】'),COLOR0080FF;个股强弱:=(CLOSE-MA(CLOSE,30))/MA(CLOSE,30)*100,COLORWHITE;行业强弱:=(HY_INDEXC-MA(HY_INDEXC,30))/MA(HY_INDEXC,30)*100,COLORYELLOW,LINETHICK2;大盘强弱:=(INDEXC-MA(INDEXC,30))/MA(INDEXC,30)*100,COLORRED,LINETHICK4;
公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程】
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容