Cumulative volume plot using SAR indicator


I’m trying to plot the cumulative volume for when the close is above/below the pSAR. I’m trying to make it reset whenever a cross occurs.

This isn’t quite right. Would appreciate some tips please.

a = SAR();

aa = C>a;
bb = C<a;

e = ValueWhen(aa,V);
ee = ValueWhen(bb,V);

f = Cum(e);
ff = Cum(ee);

g = IIf(aa,f,Null);
gg = IIf(bb,ff,Null);


1 Like