Type/to search

SuperTrend Quantitative Trading Strategy for Bitcoin

Common strategy
Created: 2024-02-06 12:09:09
Last modified: 2 years ago
1
Follow
1802
Followers

img

Overview

This is an automated quantitative trading strategy for Bitcoin based on the SuperTrend indicator. It uses the SuperTrend indicator to determine market trends and combines the ATR stop loss principle to control risks, enabling long and short trading. The biggest advantage of this strategy is good risk-reward ratio and reliable stop loss strategy, suitable for mid-to-long term holding. This strategy can be applied on mainstream exchanges like Coinbase Pro using 4-hour timeframe.

Strategy Principle

This strategy uses the SuperTrend indicator to determine the direction of market trends. It goes long when the SuperTrend indicator changes from a downtrend to an uptrend, and goes short when the SuperTrend indicator changes from an uptrend to a downtrend.

Specifically, this strategy first calculates the ATR period as 14 bars, and determines the stop loss distance for each trade by multiplying it by a ATR stop loss multiplier (such as 1.5x). It then calculates the SuperTrend indicator using default parameters (ATR period = 9, SuperTrend multiplier = 2.5). Trading signals are generated when the SuperTrend indicator changes direction.

After entering a trade, the stop loss is fixed above or below the ATR stop loss. The first take profit level is calculated based on a risk-reward ratio, default to 0.75, meaning the take profit distance is 0.75x of the stop loss distance. When price reaches the first take profit level, 50% of the position will be closed, and stop loss is moved to the entry price (break even) to lock in profits. The second take profit level continues to use a 0.75 risk-reward ratio. If price hits stop loss, the remaining position will be closed by stop loss.

By doing so, this strategy ensures controllable stop loss risk while locking in profits through partial take profits, suitable for mid-to-long term investment strategies.

Advantage Analysis

The biggest advantage of this strategy is good risk-reward ratio, allowing mid-to-long term holding. Specific advantages include:

  1. Using SuperTrend to determine market trends, filtering market noise and catching major trends.

  2. Dynamic ATR tracking of stop loss, reliably controlling single trade loss.

  3. Partial take profit locks in profit, resulting in high risk-reward ratio.

  4. Moving stop loss to entry price after hitting TP1 locks in profit and enhances strategy stability.

  5. Extremely simple logic, easy to understand and implement, with large parameter tuning space.

  6. Applicable on mainstream exchanges using intraday or high frequency data, high flexibility.

Risk Analysis

This strategy also carries some risks, mainly in the following areas:

  1. Gap risk failing to trigger stop loss, facing large loss. Can tweak ATR stop loss multiplier to reduce risk.

  2. SuperTrend fails to determine right trend, resulting in wrong trade signals. Can optimize parameters.

  3. Take profit ratio too high, unable to ride the trend. Should adjust based on different markets.

  4. Trade frequency may be too high or too low. Should find optimal balance by adjusting SuperTrend parameters.

Optimization Directions

There is still large room for optimizing this strategy, mainly in below areas:

  1. Test different ATR stop loss methods like fixed ATR, momentum stop, Bollinger stop loss etc.

  2. Optimize SuperTrend parameters using walk forward or genetic algorithms for best parameters.

  3. Adding a second layer of stop loss like Donchian Channels to make stop more reliable.

  4. Test different take profit ratios for optimal profit taking vs. risk balancing. Make it dynamic.

  5. Explore machine learning techniques for dynamic stop loss, position adjustment etc.

Conclusion

This is a quantitative strategy based on SuperTrend for trend, ATR dynamic stop and partial take profit. It has balanced risk-reward ratio, suitable for algo trading. There is ample room to optimize parameters, stop loss, profit taking etc. It's worth long term tuning and application.

Source
Pine
/*backtest
start: 2024-01-06 00:00:00
end: 2024-02-05 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// Developed by © StrategiesForEveryone
//@version=5
Strategy parameters
Strategy parameters
Date background
ATR Length SuperTrend
Factor SuperTrend
Time filter
Initial date
Final date
Appearance
Show supertrend ?
Show Atr stop loss ?
Draw position on chart ?
Atr stop loss
Source
Period
Atr multiplier
Risk management for trades
% Account risk per trade
Risk/reward for breakeven long
Risk/reward for take profit long
Risk/reward for break even short
Risk/reward for take profit short
% of trade for first take profit
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)