I'm trying to create an alg that trades a specific stock based on the equation below. The problem I'm running into is doing the math of the high and low price over X Period.
AO = SMA(High+Low)/2, 5 Periods) - SMA(High+Low/2, 34 Periods)
- When AO crosses above the Zero Line, short term momentum is now rising faster than the long term momentum. This can present a bullish buying opportunity.
- When AO crosses below the Zero Line, short term momentum is now falling faster then the long term momentum. This can present a bearish selling opportunity.
https://www.tradingview.com/wiki/Awesome_Oscillator_(AO)
Can anyone offer some help?