• TIME TO 2024 UK RANKINGS

  • C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Moving Average Slope/Gradient

Joined
3/11/12
Messages
3
Points
11
Hi All,

Hope everyone is well

I hope someone can assist me with this dilema

I want to get an indication of the strength or momentum in the 200d simple moving average - and using this across a basket of stocks

in this example i want to see the slope of the 200d sma over the last 3 months on an individual stock

so i have my current sma level and the sma level 66 days ago - if using a chart i can draw a a straight horizontal line from the prior period sma level to the Y axis - giving me a 90 degree angle up to the current sma level on the far right of a chart - then connect this point to my starting point (66 days ago level), i want to calculate this hypotenuse either as a gradient/slope or better yet the angle between my adjacent and hypotenuse

have attached a drawing (which a 5 year old could probably have done better) but so i can illustrate what im looking

The main issue im having is that there is no relationship with each unit of change in time compared to each unit of change in price, is it possible for me make these comparable, perhaps using a scale. Some of my results give reasonably accurate angles - for example a 5 degree angle for something with not much slope but still some momentum, but some stocks give a 50 degree angle and when i view the 200d sma on chart it's flat.

Im using the formula
=degrees(atan((current price - prior price)/days


I could be missing a simple fundamental rule but there must be a way to do this?

Many Thanks,
 

Attachments

  • Untitled.png
    Untitled.png
    11.9 KB · Views: 419
Natural logs are base e, not base pi.

Also, natural log is the inverse function for exponentiation, which is different from e^(1/x).

Logarithms don't have negative values in their domain, but e^x has a domain of all real numbers, etc.
 
Back
Top