The Euphoria Technical Indicator for Market Prediction
Creating K’s Euphoria Technical Indicator Using Python
--
Euphoria in the markets is an interesting event where market participants over exaggerate their positions, biases, positioning, and expectations thus amplifying the initial move. This article presents an interesting indicator called K’s Euphoria indicator which shows in percentage terms, euphoria (and greed) in a numeric form.
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.
Creating the Euphoria Indicator Step-by-Step
The idea of the euphoria indicator is to measure extreme levels and anticipate reversals by using two concepts:
- The percentage of bullish candles over the last five price candles.
- The percentage of the distance between the highs and close prices relative to the previous ones.
The steps required to calculate the indicator are as follows:
- Create a condition that outputs a value of 1 whenever the close price is greater than the open price.
- Calculate the sum of the 1’s over a moving period of 5.
- Create a condition that outputs a value of 1 whenever the distance between the high and close is greater than the distance between the previous high and the previous close.
- Calculate the sum of the 1’s over a moving period of 5.
- Multiply the values from the second step and the fourth step.
The next Figure shows the euphoria indicator.