m1:=88;m2:=101;m3:=120;p:=300;
AV:=if(INDEXC=C,amount/10000000000,M1*V/CAPITAL);
kk:=if(INDEXC=C,P,M1);
SK:=IF(SUM(AV,0)<kk,BARSCOUNT(CLOSE),SUMBARS(AV,kk));
SV:=SUM(V,SK);
PJ1:IF(INDEXC=C OR SV=0,MA(C,SK),SUM(AMOUNT,SK)/SV/M1);
AV:=if(INDEXC=C,amount/10000000000,M2*V/CAPITAL);
kk:=if(INDEXC=C,P,M2);
SK:=IF(SUM(AV,0)<kk,BARSCOUNT(CLOSE),SUMBARS(AV,kk));
SV:=SUM(V,SK);
PJ2:IF(INDEXC=C OR SV=0,MA(C,SK),SUM(AMOUNT,SK)/SV/M2);
AV:=if(INDEXC=C,amount/10000000000,M3*V/CAPITAL);
kk:=if(INDEXC=C,P,M3);
SK:=IF(SUM(AV,0)<kk,BARSCOUNT(CLOSE),SUMBARS(AV,kk));
SV:=SUM(V,SK);
PJ3:IF(INDEXC=C OR SV=0,MA(C,SK),SUM(AMOUNT,SK)/SV/M3);