The Elder Ray Index for Trading
Trend following requires understanding the current market state in order to be on the right side. This article discusses the Elder Ray index, a popular trend following technical indicator.
I have released a new book after the success of my previous one “Trend Following Strategies in Python”. It features advanced contrarian indicators and strategies with a GitHub page dedicated to the continuously updated code. If you feel that this interests you, feel free to visit the below Amazon link (which contains a sample), or if you prefer to buy the PDF version, you could check the link at the end of the article.
Contrarian Trading Strategies in Python
Amazon.com: Contrarian Trading Strategies in Python: 9798434008075: Kaabar, Sofien: Books
Intuition and Calculation of the Elder Ray Index
Developed by Dr. Alexander Elder, the Elder Ray index is a trend following system that seeks to determine buy signals in an uptrend and sell signals in a downtrend.
The intuition of the index is quite simple and its formula is even simpler. Whenever the market is in a bullish trend, its highs are more likely greater than its short-term moving average (in a strong bullish market, even the lows are greater than the short-term moving average). Whenever the market is in a bearish trend, its lows are more likely lower than its short-term moving average (in a strong bearish market, even the highs are lower than the short-term moving average).
The Elder Ray index is composed of two indicators, the Bull Power and the Bear Power. These are calculated on a separate panel from the market price. The original lookback period used for the exponential moving average is 13. The formula is therefore as follows:
Next up, we’re going to see how to code this simple indicator in Python.
Coding the Elder Ray Index in Python
The required functions for this job are the function to add and remove columns, the moving average function, and the exponential moving average…