Type/to search

Breakout Trend Follower V2

Cryptocurrency
Created: 2023-11-01 17:24:08
Last modified: 3 years ago
1
Follow
1779
Followers

img

Overview

This strategy is a variation on my other Breakout Trend Follower strategy. In the other strategy, you can use a moving average to act as a filter for your trades (i.e. if the price is below the moving average, it won't go long). After making the tool that detects trends on higher timeframes, I wanted to see if that might be a better filter than a moving average.

So this script lets you look at higher timeframe trends (i.e. are there higher highs and higher lows? If so, this is an uptrend). You only take trades when you are with the trend. You have the ability to select up to two trends to act as a filter. Each trend direction is shown on a table on the chart for easy reference. The current pivot highs and lows are plotted on the chart so you can see when you might be breaking both the current timeframe's trend and higher level trends.

What I found was that in general this does not perform as well as the other strategy, but it does seem to be a lot more picky with trades. Showing higher win rates and a better profit factor. It just takes a lot less trades and the net profit isn't as good.

Strategy Logic

The core logic of this strategy is to identify trends using breakouts of support and resistance levels on higher timeframes, and take trades in the direction of the trend.

Specifically, it implements the following steps:

  1. Calculate pivot support and resistance levels on the current timeframe (e.g. 1 hour). This is done by looking at highest high and lowest low over a certain period.

  2. Calculate pivot support and resistance levels on one or more higher timeframes (e.g. 4 hour and daily). This uses the same logic as the current timeframe.

  3. Plot these support and resistance levels as horizontal lines on the chart. Breaking these levels indicates a change in trend on the higher timeframes.

  4. Determine trend direction based on whether price breaks previous high or low points. Breaking past a previous high indicates uptrend. Breaking past a previous low indicates downtrend.

  5. Allow user to select one or more higher timeframe trends as a filter condition. I.e. only consider taking trades when current timeframe trend aligns with higher timeframe trend(s).

  6. When trend filter condition is met and current price breaks key level, enter long or short. Stop loss is set at previous key support or resistance level.

  7. As price moves, adjust stop loss to new low points to lock in profits and trail the trend.

  8. Exit when stop loss is triggered or key support/resistance level is broken.

By analyzing trends across multiple timeframes, the strategy attempts to only trade in the direction of stronger trends to improve win rate. Meanwhile, the key levels provide clear entry and stop loss signals.

Advantages of the Strategy

  • Using multiple timeframes to judge trends can more accurately identify stronger trend direction, avoiding noise.

  • Only trading with major trends significantly improves win rate. Compared to simple moving average filter, this strategy showed higher win rate and risk-reward ratio.

  • Support and resistance levels provide clear entry and stop loss levels. No need to guess specific entry points.

  • Adjusting stops along trend to maximize profit locking.

  • Simple and clear strategy logic, easy to understand and optimize.

Risks of the Strategy

  • Relies on longer-term trends, prone to being trapped at trend reversals. Should shorten timeframe for judging trends, or use other indicators to assist.

  • Does not consider fundamental impacts, may deviate from price on major events. Can add filters like earnings dates.

  • No position sizing controls set. Should optimize size by account size, volatility etc.

  • Limited backtest period. Should expand testing across different market environments.

  • No consideration of trading costs. Should adjust parameters based on actual costs.

  • Only considers long-term trading. Can develop signals for short-term trades to implement multi-timeframe strategies.

Optimization Directions

  • Add filter conditions:

    • Fundamentals like earnings, news events

    • Indicators like volume, ATR stops

  • Optimize parameters:

    • Periods for support/resistance calculation

    • Timeframes for trend determination

  • Expand strategy scope:

    • Develop short-term trading strategies

    • Consider shorting opportunities

    • Inter-market spreads

  • Enhance risk management:

    • Optimize position sizing by volatility and size

    • Improve stop loss strategies like moving/bracket stops

    • Introduce risk-adjusted metrics

  • Improve execution logic:

    • Entry timing selection

    • Partial size entries

    • Stop loss movement optimization

Conclusion

This strategy designed a relatively robust breakout system by analyzing trends across multiple timeframes. Compared to simple filters like moving averages, it demonstrated higher win rates and risk-reward ratios. But there are some areas that can be improved, like the lack of solid risk management mechanisms and consideration of fundamentals. With further optimization, it can become a very practical trend following strategy. Overall, the strategy design is sound, improving accuracy through multi-timeframe analysis, and is worth further research and application.

Source
Pine
/*backtest
start: 2023-10-24 00:00:00
end: 2023-10-26 00:00:00
period: 5m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4

// Revision:        1
// Author:          @millerrh
Strategy parameters
Strategy parameters
Backtest Range
Backtest Start Date
Backtest End Date
Display
Info Table Location
Pivot Points
Pivot Lookback Period
Show Historical Pivot Points?
Higher Timeframe Levels
Use HTF Trend for Filtering?
1st High Timeframe
2nd High Timeframe
Show Multiple Timeframe S/R Levels?
Current Timeframe    Support
 Resistance
1st High Timeframe   Support
 Resistance
2nd High Timeframe    Support
 Resistance
Comment
All comments (0)
No data
No data
  • 1
iPhone Download
Forums
PINE Language
© 2015 - ∞ INVENTOR PTE LTD (SG)