Creating a Technical Indicator
Thinking About & Creating a Technical Indicator
--
Anybody can create a calculation that aids in detecting market reactions. The question is, how good will it be? It is always complicated to find a good indicator because of the ever-changing market regime which alternates between trending, ranging, and random. In this article, we will think about a simple indicator and create it ourselves in Python from scratch.
I have released a new book called “Contrarian Trading Strategies in Python”. It features a lot of advanced contrarian indicators and strategies with a GitHub page dedicated to the continuously updated code. If you are interested, you could buy the PDF version directly through a PayPal payment of 9.99 EUR.
Please include your email in the note before paying so that you receive it on the right address. Also, once you receive it, make sure to download it through google drive.
The Momentum Indicator
Momentum is an interesting concept in financial time series. Most strategies are either trend-following or mean-reverting. Momentum is the strength of the acceleration to the upside or to the downside, and if we can measure precisely when momentum has gone too far, we can anticipate reactions and profit from these short-term reversal points. One way to measure momentum is by the Momentum Indicator.
The Momentum Indicator’s formula is extremely simple and can be summed up in the below mathematical representation:
What the above says is that we can divide the latest (or current) closing price by the closing price of a previous selected period, then we multiply by 100. Hence, if we say we are going to use Momentum(14), then, we will subtract the current values from the values 14 periods ago and then divide by 100.
The Momentum Indicator is not bounded as can be seen from the formula, which is why we need to form a strategy that can give us signals from its movements.