{成本曲线,每档5%}
CS01:=COST(1);
CS05:=COST(5);
CS10:=COST(10);
CS15:=COST(15);
CS20:=COST(20);
CS25:=COST(25);
CS30:=COST(30);
CS35:=COST(35);
CS40:=COST(40);
CS45:=COST(45);
CS50:=COST(50);
CS55:=COST(55);
CS60:=COST(60);
CS65:=COST(65);
CS70:=COST(70);
CS75:=COST(75);
CS80:=COST(80);
CS85:=COST(85);
CS90:=COST(90);
CS95:=COST(95);
CS100:=COST(99.9);
{每档区间高度}
W05:=CS05-CS01;
W10:=CS10-CS05;
W15:=CS15-CS10;
W20:=CS20-CS15;
W25:=CS25-CS20;
W30:=CS30-CS25;
W35:=CS35-CS30;
W40:=CS40-CS35;
W45:=CS45-CS40;
W50:=CS50-CS45;
W55:=CS55-CS50;
W60:=CS60-CS55;
W65:=CS65-CS60;
W70:=CS70-CS65;
W75:=CS75-CS70;
W80:=CS80-CS75;
W85:=CS85-CS80;
W90:=CS90-CS85;
W95:=CS95-CS90;
W100:=CS100-CS95;
CMWT:=CS100-CS01;
{区间宽度最小值,则相对筹码密集}
W1:=MIN(W05,MIN(W10,MIN(W15,W20)));
W2:=MIN(W25,MIN(W30,MIN(W35,W40)));
W3:=MIN(W45,MIN(W50,MIN(W55,W60)));
W4:=MIN(W65,MIN(W70,MIN(W75,W80)));
W5:=MIN(W85,MIN(W90,W95));
ZX1:=MIN(W1,MIN(W2,MIN(W3,MIN(W4,W5))));
{最小区间对应的中间价}
F1:=IF(ZX1=W05,(CS01+CS05)/2,IF(ZX1=W10,(CS05+CS10)/2,0));
F2:=IF(ZX1=W15,(CS10+CS15)/2,IF(ZX1=W20,(CS15+CS20)/2,0));
F3:=IF(ZX1=W25,(CS20+CS25)/2,IF(ZX1=W30,(CS25+CS30)/2,0));
F4:=IF(ZX1=W35,(CS30+CS35)/2,IF(ZX1=W40,(CS35+CS40)/2,0));
F5:=IF(ZX1=W45,(CS40+CS45)/2,IF(ZX1=W50,(CS45+CS50)/2,0));
F6:=IF(ZX1=W55,(CS50+CS55)/2,IF(ZX1=W60,(CS55+CS60)/2,0));
F7:=IF(ZX1=W65,(CS60+CS65)/2,IF(ZX1=W70,(CS65+CS70)/2,0));
F8:=IF(ZX1=W75,(CS70+CS75)/2,IF(ZX1=W80,(CS75+CS80)/2,0));
F9:=IF(ZX1=W85,(CS80+CS85)/2,IF(ZX1=W90,(CS85+CS90)/2,0));
f10:=IF(ZX1=W95,(CS90+CS95)/2,0);
MF1:=MAX(F1,MAX(F2,MAX(F3,MAX(F4,F5))));
MF2:=MAX(F6,MAX(F7,MAX(F8,MAX(F9,F10))));
MAXF:=MAX(MF1,MF2);
VAL1:=(CS65-CS05)/10;
BL:(CS65-CS05)/(CS95-CS05)*100,NODRAW;
STICKLINE(BL<=30,MAXF+VAL1,MAXF-VAL1,8,0),COLOR00FF00;
{下方35%区间集中60%筹码时,高亮输出图形}
VAL2:=ZX1/10;
STICKLINE(1,MAXF+VAL2*3,MAXF-VAL2*3,8,0),COLORB9B922;
{以最小区间中间60%高度输出图形}
DRAWKLINE(H,O,L,C);
const(close);