Type/to search

Quantitative Trading Strategy Based on Supertrend Indicator and Equity Curve Trading

Common strategy
Created: 2024-01-15 11:41:53
Last modified: 3 years ago
1
Follow
1802
Followers

img

Overview

The core idea of this strategy is to combine the Supertrend indicator with equity curve trading. When the Supertrend indicator generates a buy or sell signal, we do not directly execute the trade. Instead, we check if the current equity curve is below its moving average. We will open positions only when the equity curve is above the moving average. When the equity curve is below the moving average, we will pause trading for the current strategy. This can effectively prevent the expansion of losses.

Strategy Logic

This strategy mainly consists of two parts:

  1. Supertrend Indicator
  2. Equity Curve Trading

The calculation formula for the Supertrend indicator is:

Upper Band = Source Price - ATR Multiplier * ATR
Lower Band = Source Price + ATR Multiplier * ATR

Where ATR stands for Average True Range. The Supertrend indicator uses the ATR to set the upper and lower bands. A breakout above the upper band stands for a sell signal, while a breakout below the lower band stands for a buy signal.

The idea behind equity curve trading is that we take the moving average of the strategy's equity curve. When the equity curve falls below its moving average, we pause trading for the current strategy and wait for the equity curve to rebound back above the moving average before re-enabling trading.

This strategy combines the two techniques, so that after the Supertrend indicator generates a trading signal, we do not directly enter trades. Instead, we check if the current equity curve is above its moving average. Only when both conditions are met will we open positions. This can effectively mitigate the risks inherent in the Supertrend indicator itself and prevent excessive losses.

Advantages

The main advantages of this strategy are:

  1. It can effectively prevent the risks of the Supertrend indicator. The Supertrend indicator itself cannot effectively curb losses. Equity curve trading makes up for this shortcoming.

  2. When trading becomes unfavorable, it pauses trading to avoid excessive losses. We can resume trading after the market recovers.

  3. It can automatically manage positions without manual intervention. Trading is paused automatically when the equity curve falls below the moving average, and resumed when the equity curve rebounds back above it.

Risks

There are also some risks with this strategy:

  1. Incorrect parameter settings may render equity curve trading ineffective. Appropriate moving average periods need to be selected.

  2. It may fail to adjust positions promptly when market trend changes. This can lead to certain losses.

  3. It may miss good trading opportunities while waiting for the equity curve to rebound.

Counter measures:

  1. Optimize parameters and select the best moving average period.

  2. Incorporate other indicators to judge trend and adjust positions accordingly.

  3. Shorten the duration of suspended trading to lower the probability of missing opportunities.

Optimization Directions

We can optimize the strategy from the following aspects:

  1. Test different parameter combinations to find the optimal ATR period and multiplier.

  2. Try other types of moving averages, like Exponential Moving Average, Hull Moving Average etc.

  3. Add other indicators to determine market trend, and adjust positions when trend changes.

  4. Optimize the moving average period to find the best balance. Too long periods may miss opportunities, while too short may pause too frequently.

  5. Optimize the conditions to pause trading, like setting a stop loss threshold before suspension.

Conclusion

This strategy cleverly combines the Supertrend indicator with equity curve trading, leveraging the strengths of both techniques. The test results show that in most cases, applying equity curve trading actually decreases profitability. As such, this strategy is more suitable for defensive traders. With parameter and logic optimization, it can become a very practical quantitative trading strategy.

Source
Pine
/*backtest
start: 2023-01-14 00:00:00
end: 2024-01-14 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy('Supertrend & Equity curve with EMA', overlay=false, format=format.price, precision=2, initial_capital=100000)

eqlen = input.int(25, "EQ EMA len", group = "New Equity Curve Settings")
Strategy parameters
Strategy parameters
Show Original Equity Curve and MA
Show Filtered Equity Curve by MA
New Equity Curve Settings
EQ EMA len
SuperTrend Settings
ATR Period
Source
ATR Multiplier
Change ATR Calculation Method ?
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)