Writing trend pullback components
An algorithm to identify a trend pullback pattern essentially consists of three components:
- An existing trend
- A pullback
- An impulse in the trend direction
Existing trend
In order to catch an existing trend, according to what we presented in Chapter 3, we know that we can use simple moving averages. But there are other algorithms, which are a bit more elaborate, to identify a trend, including the following:
- Supertrend
- ADX
Let’s delve into these next.
Supertrend
The Supertrend indicator is based on volatility. It consists of two main components: a moving average and a multiplier.
The Supertrend indicator uses a moving average of the asset’s price to determine the overall direction of the trend. This moving average can be calculated using different periods, such as 7 days, 14 days, or 50 days, depending on the trader’s time horizon.
The function of the multiplier is to adapt...