通达信成本分布主图指标原码

[复制链接]
查看155 | 回复0 | 2021-8-21 06:07:13 | 显示全部楼层 |阅读模式

以下是通达信成本分布主图指标原码(无源码的请下载附件导入)

通达信成本分布主图指标原码

成本分布指标对于分析支撑和阻力位置很有用,很直观.但使用系统自带的指标时,要用鼠标点击一下才能切换到那个界面,很麻烦.论坛上也曾经有在主图中迭加的成本分布指标,用以简化操作.但可惜不准确,与系统自带的指标差异较大,缺乏使用价值,而且使主图界面复杂,影响对K线的观察和分析.
     本贴发布的这个指标原理正确,精度够用,与系统自带的指标基本一致.而且只在当天的K线区显示一个兰色的矩形条,矩形条中有一些横线,用以反应当天的成本分布状态.这样便既能方便地看到当天的正确的成本分布情况,又基本上不对主图界面构成影响.完全没必要去看系统自带的指标了.
     指标的原理为:兰色的矩形条由底到顶对应于从0.1%到99.9%的筹码分布区间,每二条横线间的区间均为2%的筹码,横线越密集说明筹码越集中,最密集的地方就是筹码峰所在地.有一条横线是兰色的,对应50%筹码处.
     本指标只反应当天的成本分布情况,不能看历史的成本分布情况.
     指标的精度处决于对矩形的等分数,越多越精确,但代码行数就越多,电脑运行就越慢.综合权衡精度和速度后,本指标设置为50等分.
     本指标成本分布区间为0.1%到99.9%,不是0到100%,这是因为设置为0到100%后那个兰色矩形就不显示了,其原因应该是系统的成本分布函数取值范围限定不能为0和100所致.这对指标的正确性和精度都不构成影响.
     大家只需把下载的代码中最后一句不要,其余的全部复制后粘贴在你常用的主图指标代码的最前面即可.(一定要放在最前面,否则兰色的矩形条会挡住当天的K线和指标线的.)
     几张附图为与系统成本分布指标对照结果.

源码

成本100:=COST(99.9);

成本98:=COST(98);

成本96:=COST(96);

成本94:=COST(94);

成本92:=COST(92);

成本90:=COST(90);

成本88:=COST(88);

成本86:=COST(86);

成本84:=COST(84);

成本82:=COST(82);

成本80:=COST(80);

成本78:=COST(78);

成本76:=COST(76);

成本74:=COST(74);

成本72:=COST(72);

成本70:=COST(70);

成本68:=COST(68);

成本66:=COST(66);

成本64:=COST(64);

成本62:=COST(62);

成本60:=COST(60);

成本58:=COST(58);

成本56:=COST(56);

成本54:=COST(54);

成本52:=COST(52);

成本50:=COST(50);

成本48:=COST(48);

成本46:=COST(46);

成本44:=COST(44);

成本42:=COST(42);

成本40:=COST(40);

成本38:=COST(38);

成本36:=COST(36);

成本34:=COST(34);

成本32:=COST(32);

成本30:=COST(30);

成本28:=COST(28);

成本26:=COST(26);

成本24:=COST(24);

成本22:=COST(22);

成本20:=COST(20);

成本18:=COST(18);

成本16:=COST(16);

成本14:=COST(14);

成本12:=COST(12);

成本10:=COST(10);

成本8:=COST(8);

成本6:=COST(6);

成本4:=COST(4);

成本2:=COST(2);

成本0:=COST(0.1);

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本0,成本100,12,0),COLORFF0000;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本98,成本98,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本96,成本96,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本94,成本94,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本92,成本92,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本90,成本90,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本88,成本88,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本86,成本86,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本84,成本84,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本82,成本82,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本80,成本80,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本78,成本78,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本76,成本76,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本74,成本74,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本72,成本72,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本70,成本70,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本68,成本68,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本66,成本66,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本64,成本64,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本62,成本62,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本60,成本60,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本58,成本58,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本56,成本56,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本54,成本54,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本52,成本52,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本50,成本50,12,0),COLORFFFF00;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本48,成本48,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本46,成本46,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本44,成本44,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本42,成本42,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本40,成本40,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本38,成本38,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本36,成本36,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本34,成本34,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本32,成本32,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本30,成本30,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本28,成本28,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本26,成本26,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本24,成本24,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本22,成本22,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本20,成本20,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本18,成本18,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本16,成本16,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本14,成本14,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本12,成本12,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本10,成本10,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本8,成本8,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本6,成本6,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本4,成本4,12,0),COLOR888888;

STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,成本2,成本2,12,0),COLOR888888;

DRAWKLINE(H,O,L,C);

 

64544661.png

64544661.png

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则