通达信自定义柱状板块副图源码
把压缩文件里的自定义板块添加到工具——用户板块设置里——选导入,一个一个导入进去。
功能——定制品种——组合品种管理——这里面创建自定义指数,也就是把代码和自定义板块对应起来。
需要添加的自建板块对应指数代码
按下图添加。
393001 中盘股
393002 小盘股
393003 大盘股
393004 生物医药
393005太阳能
393006手机支付
393007三网合一
393008风能
393011信息网络
393013新能源汽车
393014智能电网
393015核能
{公式在线提供:www.gszx.com.cn}
复制内容到剪贴板
- VAR1:=MEMA(("399005$C"),3);
- VAR2:=MEMA(("399001$C"),3);
- VAR3:=MEMA(("999999$C"),3);
- VAR4:=MEMA(("393002$C"),3);
- VAR5:=MEMA(("393001$C"),3);
- VAR6:=MEMA(("393003$C"),3);
-
- VAR7:=MEMA(("393004$C"),3);
- VAR8:=MEMA(("393005$C"),3);
- VAR9:=MEMA(("393006$C"),3);
- VAR10:=MEMA(("393007$C"),3);
- VAR11:=MEMA(("393008$C"),3);
- VAR12:=MEMA(("393011$C"),3);
- VAR13:=MEMA(("393015$C"),3);
- VAR14:=MEMA(("393013$C"),3);
- VAR15:=MEMA(("393014$C"),3);
-
- 中小板指:=SUM((VAR1/REF(VAR1,1)-1)*100,0),COLORRED;
- 深圳成指:=SUM((VAR2/REF(VAR2,1)-1)*100,0),COLORMAGENTA;
- 上证指数:=SUM((VAR3/REF(VAR3,1)-1)*100,0),COLORLIRED;
- 小盘股:=SUM((VAR4/REF(VAR4,1)-1)*100,0),COLORLIMAGENTA;
- 中盘股:=SUM((VAR5/REF(VAR5,1)-1)*100,0),COLORCYAN;
- 大盘股:=SUM((VAR6/REF(VAR6,1)-1)*100,0),COLORGREEN;
- 生物医药:=SUM((VAR7/REF(VAR7,1)-1)*100,0),COLORRED;
- 太阳能:=SUM((VAR8/REF(VAR8,1)-1)*100,0),COLORMAGENTA;
- 手机支付:=SUM((VAR9/REF(VAR9,1)-1)*100,0),COLORLIRED;
- 三网合一:=SUM((VAR10/REF(VAR10,1)-1)*100,0),COLORWHITE;
- 风能:=SUM((VAR11/REF(VAR11,1)-1)*100,0),COLORCYAN;
- 信息网络:=SUM((VAR12/REF(VAR12,1)-1)*100,0),COLORGREEN;
- 核能:=SUM((VAR13/REF(VAR13,1)-1)*100,0),COLORYELLOW;
- 新能源汽车:=SUM((VAR14/REF(VAR14,1)-1)*100,0),COLORCYAN;
- 智能电网:=SUM((VAR15/REF(VAR15,1)-1)*100,0),COLORGREEN;
-
- VAR16:=CONST(MA(中小板指,10));
- VAR17:=CONST(MA(深圳成指,10));
- VAR18:=CONST(MA(上证指数,10));
- VAR19:=CONST(MA(小盘股,10));
- VAR20:=CONST(MA(中盘股,10));
- VAR21:=CONST(MA(大盘股,10));
- VAR22:=CONST(MA(生物医药,10));
- VAR23:=CONST(MA(太阳能,10));
- VAR24:=CONST(MA(手机支付,10));
- VAR25:=CONST(MA(三网合一,10));
- VAR26:=CONST(MA(风能,10));
- VAR27:=CONST(MA(信息网络,10));
- VAR28:=CONST(MA(核能,10));
- VAR29:=CONST(MA(新能源汽车,10));
- VAR30:=CONST(MA(智能电网,10));
- PQ:=VAR30-40;
-
-
- P1:=IF(BARSLAST(CURRBARSCOUNT=8),10,0);
- P2:=IF(BARSLAST(CURRBARSCOUNT=16),10,0);
- P3:=IF(BARSLAST(CURRBARSCOUNT=24),10,0);
- P4:=IF(BARSLAST(CURRBARSCOUNT=32),10,0);
- P5:=IF(BARSLAST(CURRBARSCOUNT=40),10,0);
- P6:=IF(BARSLAST(CURRBARSCOUNT=48),10,0);
- P7:=IF(BARSLAST(CURRBARSCOUNT=54),10,0);
- P8:=IF(BARSLAST(CURRBARSCOUNT=62),10,0);
- P9:=IF(BARSLAST(CURRBARSCOUNT=70),10,0);
- P10:=IF(BARSLAST(CURRBARSCOUNT=78),10,0);
- P11:=IF(BARSLAST(CURRBARSCOUNT=86),10,0);
- P12:=IF(BARSLAST(CURRBARSCOUNT=94),10,0);
- P13:=IF(BARSLAST(CURRBARSCOUNT=102),10,0);
- P14:=IF(BARSLAST(CURRBARSCOUNT=110),10,0);
- P15:=IF(BARSLAST(CURRBARSCOUNT=118),10,0);
- P16:=IF(BARSLAST(CURRBARSCOUNT=126),10,0);
-
-
-
- STICKLINE(中小板指,PQ,IF(P2-P1,CONST(MA(中小板指,3)),DRAWNULL),5,0),
- COLORYELLOW;
- STICKLINE(深圳成指,PQ,IF(P3-P2,CONST(MA(深圳成指,3)),DRAWNULL),5,0),COLORYELLOW;
- STICKLINE(上证指数,PQ,IF(P4-P3,CONST(MA(上证指数,3)),DRAWNULL),5,0),COLORYELLOW;
- STICKLINE(小盘股,PQ,IF(P5-P4,CONST(MA(小盘股,3)),DRAWNULL),5,0),COLORYELLOW;
- STICKLINE(中盘股,PQ,IF(P6-P5,CONST(MA(中盘股,3)),DRAWNULL),5,0),COLORYELLOW;
- STICKLINE(大盘股,PQ,IF(P7-P6,-CONST(MA(大盘股,3)),DRAWNULL),5,0),
- COLORYELLOW;
- STICKLINE(生物医药,PQ,IF(P8-P7,CONST(MA(生物医药,3)),DRAWNULL),5,0),
- COLORYELLOW;
- STICKLINE(太阳能,PQ,IF(P9-P8,CONST(MA(太阳能,3)),DRAWNULL),5,0),COLORYELLOW;
- STICKLINE(手机支付,PQ,IF(P10-P9,CONST(MA(手机支付,3)),DRAWNULL),5,0),COLORYELLOW;
- STICKLINE(三网合一,PQ,IF(P11-P10,CONST(MA(三网合一,3)),DRAWNULL),5,0),COLORYELLOW;
- STICKLINE(风能,PQ,IF(P12-P11,CONST(MA(风能,3)),DRAWNULL),5,0),COLORYELLOW;
- STICKLINE(信息网络,PQ,IF(P13-P12,CONST(MA(信息网络,3)),DRAWNULL),5,0),
- COLORYELLOW;
- STICKLINE(核能,PQ,IF(P14-P13,CONST(MA(核能,3)),DRAWNULL),5,0),COLORYELLOW;
- STICKLINE(新能源汽车,PQ,IF(P15-P14,CONST(MA(新能源汽车,3)),DRAWNULL),5,0),COLORYELLOW;
- STICKLINE(智能电网,PQ,IF(P16-P15,CONST(MA(智能电网,3)),DRAWNULL),5,0),
- COLORYELLOW;
-
-
- DRAWTEXT((P2>=10 AND REF(P2,1)<=0),中小板指,'中小板指'),COLORRED;
- DRAWTEXT((P3>=10 AND REF(P3,1)<=0),深圳成指,'深圳成指'),COLORMAGENTA;
- DRAWTEXT((P4>=10 AND REF(P4,1)<=0),上证指数,'上证指数'),COLORLIRED;
- DRAWTEXT((P5>=10 AND REF(P5,1)<=0),小盘股,'小盘股'),COLORWHITE;
- DRAWTEXT((P6>=10 AND REF(P6,1)<=0),中盘股,'中盘股'),COLORCYAN;
- DRAWTEXT((P7>=10 AND REF(P7,1)<=0),大盘股,'大盘股'),COLORGREEN;
- DRAWTEXT((P8>=10 AND REF(P8,1)<=0),生物医药,'生物医药'),COLORRED;
- DRAWTEXT((P9>=10 AND REF(P9,1)<=0),太阳能,'太阳能'),COLORMAGENTA;
- DRAWTEXT((P10>=10 AND REF(P10,1)<=0),手机支付,'手机支付'),COLORLIRED;
- DRAWTEXT((P11>=10 AND REF(P11,1)<=0),三网合一,'三网合一'),COLORWHITE;
- DRAWTEXT((P12>=10 AND REF(P12,1)<=0),风能,'风能'),COLORCYAN;
- DRAWTEXT((P13>=10 AND REF(P13,1)<=0),信息网络,'信息网络'),COLORGREEN;
- DRAWTEXT((P14>=10 AND REF(P14,1)<=0),核能,'核能'),COLORWHITE;
- DRAWTEXT((P15>=10 AND REF(P15,1)<=0),新能源汽车,'新能源汽车'),COLORCYAN;
- DRAWTEXT((P16>=10 AND REF(P16,1)<=0),智能电网,'智能电网'),COLORGREEN;