I found two version of the formula and i paste them both (don't know what language they are... choose the one easier)
Sum(If(C,>,Ref(C,-1),+V*C-Ref(C,-1),If(C,<,Ref(C,-1),-V*C - Ref(C,-1),0)),18) {with a moving average of 9}
TSV=(Sum( IIf( C > Ref(C,-1), V * ( C-Ref(C,-1) ), IIf( C < Ref(C,-1),-V * ( C-Ref(C,-1) ), 0 ) ) ,18)); Plot(TSV,"TSV",1,1);
Comment