Moving Average of OnBalanceVolume?

R

rak

New member
Lifetime
First time post and I have zero experience with writing code. I've opened scripts and added "plot" line or "addcloud" but that's about it. I currently just drop a SMA in the lower study panel on top of the OBV but that's not very accurate. I would like a 200 SMA of the OBV to plot for confirmation of who is in control.

I would appreciate someone sharing if they have this or something similar.
 
horserider

horserider

Well-known member
VIP
@rak
Code:
# OBV and MovingAverage average of OBV
# Horserider 1/23/2020

declare lower;
input length = 200;
plot OBV = TotalSum(Sign(close - close[1]) * volume);
plot obvma = Average(obv, length);
OBV.SetDefaultColor(GetColor(8));
obvma.setDefaultColor(GetColor(1));
 

Similar threads

Top