da 1:= IF(TS & gt; TOTALBARSCOUNT,TOTALBARSCOUNT,TS);
DA:= IF(CURRBARSCOUNT & gt; DA 1,0,da 1);
HI:=REFDATE(HHV(H, DA), date); {highest price}
LO:=REFDATE(LLV(L, DA), date);
c 1:= IF(CURRBARSCOUNT & lt; =DA,C,draw null);
GZ:= EXP(LN(HI/LO)/ 15); {Logarithmic lattice value}
LH 1:= SUM(IF(c 1 & gt; = (hi /GZ), v, 0), da);
LH2:= SUM(IF(c 1 & gt; =(HI/POW(GZ, 2)) and c1<; (hi /GZ), v, 0), da);
LH3:= SUM(IF(c 1 & gt; =(HI/POW(GZ, 3)) and c1<; (HI/POW(GZ,2)),V,0),DA);
LH4:= SUM(IF(c 1 & gt; =(HI/POW(GZ, 4)) and c1<; (HI/POW(GZ,3)),V,0),DA);
LH5:= SUM(IF(c 1 & gt; =(HI/POW(GZ, 5)) and c1<; (HI/POW(GZ,4)),V,0),DA);
LH6:= SUM(IF(c 1 & gt; =(HI/POW(GZ, 6)) and c1<; (HI/POW(GZ,5)),V,0),DA);
LH7:= SUM(IF(c 1 & gt; =(HI/POW(GZ, 7)) and c1<; (HI/POW(GZ,6)),V,0),DA);
LH8:= SUM(IF(c 1 & gt; =(HI/POW(GZ, 8)) and c1<; (HI/POW(GZ,7)),V,0),DA);
LH9:= SUM(IF(c 1 & gt; =(HI/POW(GZ, 9)) and c1<; LO*POW(GZ,7),V,0),DA);
LH 10:= SUM(IF(c 1 & gt; =(LO*POW(GZ, 5)) and c1<; LO*POW(GZ,6),V,0),DA);
LH 1 1:= SUM(IF(c 1 & gt; =(LO*POW(GZ, 4)) and c1<; LO*POW(GZ,5),V,0),DA);
LH 12:= SUM(IF(c 1 & gt; =(LO*POW(GZ, 3)) and c1<; LO*POW(GZ,4),V,0),DA);
LH 13:= SUM(IF(c 1 & gt; =(LO*POW(GZ, 2)) and c1<; LO*POW(GZ,3),V,0),DA);
LH 14:= SUM(IF(c 1 & gt; =(LO*GZ) and c1< LO*POW(GZ,2),V,0),DA);
LH 15:= SUM(IF(c 1 & gt; =LO and c1<; LO*GZ,V,0),DA);
l 1:= ref DATE(HHV(LH 1,DA),DATE);
L2:=REFDATE(HHV(LH2, DA), date);
L3:=REFDATE(HHV(LH3, DA), date);
L4:=REFDATE(HHV(LH4, DA), date);
L5:=REFDATE(HHV(LH5, DA), date);
L6:=REFDATE(HHV(LH6, DA), date);
L7:=REFDATE(HHV(LH7, DA), date);
L8:=REFDATE(HHV(LH8, DA), date);
L9:=REFDATE(HHV(LH9, DA), date);
L10: = refDAte (HHV (LH10, da), date);
l 1 1:= ref DATE(HHV(LH 1 1,DA),DATE);
L12: = refDAte (HHV (LH12, da), date);
L13: = refDAte (HHV (LH13, da), date);
L14: = refDAte (HHV (LH14, da), date);
L15: = refDAte (HHV (LH15, da), date);
SS:=(l 1+L2+L3+L4+L5+L6+L7+L8+L9+l 10+l 16+l 12+l 13+l 14+l 15);
Adhesion line (ceiling (da * l1/ss) * 3 > =CURRBARSCOUNT,HI*N/ 100,HI/GZ,6,0)COLOR606060,LINETHICK3
Adhesion line (upper limit (da * L2/ss) * 3 >; =CURRBARSCOUNT,HI/POW(GZ, 1)*N/ 100,HI/POW(GZ,2),6,0)COLOR606060,LINETHICK3
Adhesion line (upper limit (da * L3/ss) * 3 >; =CURRBARSCOUNT,HI/POW(GZ,2)*N/ 100,HI/POW(GZ,3),6,0)COLOR606060,LINETHICK3
Adhesion line (upper limit (da * l4/ss) * 3 >; =CURRBARSCOUNT,HI/POW(GZ,3)*N/ 100,HI/POW(GZ,4),6,0)COLOR606060,LINETHICK3
Adhesion line (upper limit (da * l5/ss) * 3 >; =CURRBARSCOUNT,HI/POW(GZ,4)*N/ 100,HI/POW(GZ,5),6,0)COLOR606060,LINETHICK3
Adhesion line (upper limit (da * l6/ss) * 3 >; =CURRBARSCOUNT,HI/POW(GZ,5)*N/ 100,HI/POW(GZ,6),6,0)COLOR606060,LINETHICK3
Adhesion line (upper limit (da * l7/ss) * 3 >; =CURRBARSCOUNT,HI/POW(GZ,6)*N/ 100,HI/POW(GZ,7),6,0)COLOR606060,LINETHICK3
Adhesion line (upper limit (da * l8/ss) * 3 >; =CURRBARSCOUNT,LO*POW(GZ,7),LO*POW(GZ,8)*N/ 100,6,0)COLOR606060,LINETHICK3
Adhesion line (upper limit (Da * L9/SS) * 3 >; =CURRBARSCOUNT,LO*POW(GZ,6),LO*POW(GZ,7)*N/ 100,6,0)COLOR606060,LINETHICK3
Adhesion line (ceiling (da * l10/ss) * 3 > =CURRBARSCOUNT,LO*POW(GZ,5),LO*POW(GZ,6)*N/ 100,6,0)COLOR606060,LINETHICK3
Adhesion line (ceiling (da * l11/ss) * 3 > =CURRBARSCOUNT,LO*POW(GZ,4),LO*POW(GZ,5)*N/ 100,6,0)COLOR606060,LINETHICK3
Adhesion line (ceiling (da * l12/ss) * 3 > =CURRBARSCOUNT,LO*POW(GZ,3),LO*POW(GZ,4)*N/ 100,6,0)COLOR606060,LINETHICK3
Adhesion line (ceiling (da * l13/ss) * 3 > =CURRBARSCOUNT,LO*POW(GZ,2),LO*POW(GZ,3)*N/ 100,6,0)COLOR606060,LINETHICK3
Adhesion line (ceiling (da * l14/ss) * 3 > =CURRBARSCOUNT,LO*POW(GZ, 1),LO*POW(GZ,2)*N/ 100,6,0)COLOR606060,LINETHICK3
Adhesion line (ceiling (da * l15/ss) * 3 > =CURRBARSCOUNT,LO,LO*POW(GZ, 1)*N/ 100,6,0)COLOR606060,LINETHICK3
Traction line (h, o, l, c); {
Pressure support: Ma (c, 5) Color Magenta; };
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Supplement: the output of communication formula is limited by 16. Your requirements are not realized by the software itself, nor by the formula. Look at the chip, please switch to the chip peak interface, there is no good way to achieve it.