通达信公式:累计筹码均线主图
TS:=500;
N:=95;
DA1:=IF(TS TOTALBARSCOUNT,TOTALBARSCOUNT,TS);
DA:=IF(CURRBARSCOUNT DA1,0,DA1);
HI:=REFDATE(HHV(H,DA),DATE);{最高价}
LO:=REFDATE(LLV(L,DA),DATE);
C1:=IF(CURRBARSCOUNT =DA,C,DRAWNULL);
GZ:=EXP(LN(HI/LO)/15); {对数格值}
LH1:=SUM(IF(C1 =(HI/GZ),V,0),DA);
LH2:=SUM(IF(C1 =(HI/POW(GZ,2)) AND C1 (HI/GZ),V,0),DA);
LH3:=SUM(IF(C1 =(HI/POW(GZ,3)) AND C1 (HI/POW(GZ,2)),V,0),DA);
LH4:=SUM(IF(C1 =(HI/POW(GZ,4)) AND C1 (HI/POW(GZ,3)),V,0),DA);
LH5:=SUM(IF(C1 =(HI/POW(GZ,5)) AND C1 (HI/POW(GZ,4)),V,0),DA);
LH6:=SUM(IF(C1 =(HI/POW(GZ,6)) AND C1 (HI/POW(GZ,5)),V,0),DA);
LH7:=SUM(IF(C1 =(HI/POW(GZ,7)) AND C1 (HI/POW(GZ,6)),V,0),DA);
LH8:=SUM(IF(C1 =(HI/POW(GZ,8)) AND C1 (HI/POW(GZ,7)),V,0),DA);
LH9:=SUM(IF(C1 =(HI/POW(GZ,9)) AND C1 LO*POW(GZ,7),V,0),DA);
LH10:=SUM(IF(C1 =(LO*POW(GZ,5)) AND C1 LO*POW(GZ,6),V,0),DA);
LH11:=SUM(IF(C1 =(LO*POW(GZ,4)) AND C1 LO*POW(GZ,5),V,0),DA);
LH12:=SUM(IF(C1 =(LO*POW(GZ,3)) AND C1 LO*POW(GZ,4),V,0),DA);
LH13:=SUM(IF(C1 =(LO*POW(GZ,2)) AND C1 LO*POW(GZ,3),V,0),DA);
LH14:=SUM(IF(C1 =(LO*GZ) AND C1 LO*POW(GZ,2),V,0),DA);
LH15:=SUM(IF(C1 =LO AND C1 LO*GZ,V,0),DA);
L1:=REFDATE(HHV(LH1,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);
L11:=REFDATE(HHV(LH11,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:=(L1+L2+L3+L4+L5+L6+L7+L8+L9+L10+L11+L12+L13+L14+L15);
最大值:=MAX(L1,MAX(L2,MAX(L3,MAX(L4,MAX(L5,MAX(L6,MAX(L7,MAX(L8,MAX(L9,MAX(L10,MAX(L11,MAX(L12,MAX(L13,MAX(L14,L15))))))))))))));
AA4:=IF(最大值=L4,L4,DRAWNULL),NODRAW;
AA5:=IF(最大值=L5,L5,DRAWNULL),NODRAW;
AA6:=IF(最大值=L6,L6,DRAWNULL),NODRAW;
AA7:=IF(最大值=L7,L7,DRAWNULL),NODRAW;
STICKLINE(CEILING(DA*AA4/SS) =CURRBARSCOUNT,HI/POW(GZ,3)*N/100,HI/POW(GZ,5),2.2,1),COLOR70FFCA;
STICKLINE(CEILING(DA*AA5/SS) =CURRBARSCOUNT,HI/POW(GZ,4)*N/100,HI/POW(GZ,6),2.2,1),COLOR68EEBC;
STICKLINE(CEILING(DA*AA6/SS) =CURRBARSCOUNT,HI/POW(GZ,5)*N/100,HI/POW(GZ,7),2.2,1),COLOR3AEEB3;
STICKLINE(CEILING(DA*AA7/SS) =CURRBARSCOUNT,HI/POW(GZ,6)*N/100,HI/POW(GZ,8),2.2,1),COLOR2FFFAD;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
累计筹码均线:MA(C,BARSSINCE(HI/POW(GZ,0)*N/100)+1);
DRAWNUMBER(ISLASTBAR,累计筹码均线,累计筹码均线),COLOR00FFFF;