Page 1 of 1

Volume Momentum

PostPosted: Wed Aug 30, 2017 6:00 pm
by isamegrelo
This is formula:

study(title ="TheLark Volume Momentum",overlay=false)

//inputs
Length = input(14,minval=1)
atype = input(1,minval=1,maxval=3,title="1=sma, 2=ema, 3=wma")
mv = input(false, title="Multiply the volume?")
cc = input(false,title="Change color?")
//calc
avg = atype == 1 ? sma(volume,Length) : atype == 2 ? ema(volume,Length) : wma(volume,Length)
avgm = mv ? (avg - avg[Length]) * volume : (avg - avg[Length])
//plot
col = cc and avgm >= avgm[1] ? #0094FF : #FF006E
plot(avgm,style=histogram,linewidth=5,color=col)

Re: Volume Momentum

PostPosted: Fri Sep 01, 2017 3:45 am
by Apprentice