OBV with its 13 day moving average


Category:
0
0

I’m trying to plot the OBV with its 13 day moving average on the chart.  The following code I created doesn’t work and I believe an explanation would help with adding moving averages to other indicators.  Thanks for your help.

declare lower;

plot OBV = TotalSum(Sign(close – close[1]) * volume);
input MALenght = 13;
plot MA = Average(OBV,MALength);

OBV.SetDefaultColor(GetColor(8));
MA.SetDefaultColor(GetColor(9));

 

RESOLVED
Marked as spam
Posted by (Questions: 3, Answers: 0)
Asked on June 2, 2017 10:36 am
212 views
0
Private answer

Typo. You misspelled the variable name for the MA Length in the input, but spelled it correctly in the place you were trying to use it. So as far are applying a moving average to another study, you got it right. And we have covered this before in a previous post: https://www.hahn-tech.com/ans/apply-moving-average-to-relative-strength-correlation-indicator/

Marked as spam
Posted by (Questions: 37, Answers: 4118)
Answered on June 2, 2017 11:40 am