How do you figure out the tangent line derivative of a MA

 

I have seen posts on how to calculate the rate of change from two points on a moving average line which gives you the slope, however,

this is the secant of the curve. How do I get the line derivative of this when the original formula for the moving average only exists in random points.

The line derivative will yield the tangent of the curve of the moving average. Any ideas?

 

Just guessing, but perhpas you could do polinomial interpolation, which gives a polynomial that includes the points you get from the moving average iMA(....)

With such a polynomial you can now compute its derivative at a given point.


I suggest searching for "polynomial interpolation" and derivative in your search engine.

 

The next two images are zoomed in on the area outlined in red above





The MA line really isn't a curve --- instead it is a zig zag line from one point to the next. If you want instant slope somewhere in a small segment of the MA "curve" simply use two points that are closer together. IMO complex curve fitting isn't worth the effort to set up a formula for calc'ing a line derivative.

 

Thanks abstract_mind and FXtrader2008 for your ideas...


I realize from both your answers that what I am looking for will not work for various reasons and I will go another route.


Your absolutely right about the polynomial interpolation, it does yield the equations I'm looking for but not the results I need due

to inconsistent MA smoothing.

Your also right about the curve being made up of line segments, but trying to derive a slope "actually a rate of change" from

a non-Cartesian coordinate system is less than fruitful. A slope can only be derived as one takes a series of limits as it approaches

that point.

Thanks for both your time.

 

Sure, but you know interpolations can work directly with price_closes (or highs or lows) of a currency. And you might be creative enough thinking of a statistically effective way to "EXTRAPOLATE" the future price of a corrency, using the obtained polynomiuns,.m.....

it might be possible... but yes, I've tried it before.

 
ErgoRaid:

Thanks abstract_mind and FXtrader2008 for your ideas...


I realize from both your answers that what I am looking for will not work for various reasons and I will go another route.


Your absolutely right about the polynomial interpolation, it does yield the equations I'm looking for but not the results I need due

to inconsistent MA smoothing.

Your also right about the curve being made up of line segments, but trying to derive a slope "actually a rate of change" from

a non-Cartesian coordinate system is less than fruitful. A slope can only be derived as one takes a series of limits as it approaches

that point.

Thanks for both your time.

Actually, if you assume that the function that represents price is differentiable, such as sufficiently smooth and without cusps, you can calculate derivatives using finite difference methods. You wont be able to find an instantaneous rate of change, but you will be able to approximate it.

Reason: