The Reversal Momentum Breakout Strategy is a quantitative trading strategy that generates trading signals using price reversal and momentum indicators. Based on the theory of “momentum leads price”, this strategy tracks the highest and lowest prices over a certain period to determine whether the market is at a key reversal point to capture reversal opportunities.
The core logic of this strategy is to identify market reversal points by calculating the highest and lowest prices over a specified lookback window (e.g. 20 days). The specific logic is:
Calculate the highest price (window_high) and lowest price (window_low) over the past 20 days.
If today’s high is higher than the maximum of the past 20 days (a new 20-day high), enter the high reversal monitoring period and set the counter to 5 days.
If no new high occurs, deduct the counter by 1 each day. When the counter reaches 0, the high reversal monitoring period ends.
The judgment logic for the lowest price is similar. If a new low occurs, enter the low reversal monitoring period.
long and short positions are taken within the reversal monitoring periods. Reversal signals near the key reversal points allow capturing larger moves.
The strategy also sets the start trading time to avoid generating signals on historical data.
The Reversal Momentum Breakout Strategy has the following main advantages:
Captures reversal opportunities, suitable for reversal trends. Markets often show some degree of reversal after a sustained uptrend or downtrend. This strategy aims to capture these turning points.
Momentum leads, relatively sensitive. Tracking the highest and lowest prices over a window can sensitively identify price reversal trends and timing.
Reversal monitoring periods avoid false signals. Signals are generated only around key reversal points, filtering out some noise.
Allows long and short positions. Alternates between long and short following market direction.
Relatively simple logic, easy to implement. Mainly relies on price and simple momentum indicators, easy to code.
The main risks of this strategy include:
Inaccurate reversal prediction. The strategy can incur losses if the market trends directionally.
Overall market trends not considered. Individual stock reversals do not necessarily represent market reversals. Market analysis should be combined.
Potentially large drawdowns. Drawdown may expand without actual reversals.
Data fitting bias. Performance may significantly differ from backtests.
Parameter sensitivity. Window period, counter parameters etc. affect stability.
Corresponding risk control methods include optimizing stop loss, incorporating market factors, adjusting parameter combinations and verifying stability.
The main optimization directions include:
Incorporate market indicators. Assess market strength to avoid unfavorable big picture environments.
Multi-factor stock selection. Select stocks with sound fundamentals and overvaluation.
Parameter optimization. Adjust window period and counter parameters to find optimal parameter combinations.
Add stop loss strategies e.g trailing stops, volatility stops to control max drawdown.
Increase machine learning predictive accuracy of price reversals.
The Reversal Momentum Breakout Strategy identifies reversal opportunities by tracking price and momentum. It reacts sensitively and identifies reversal trends and timing. But it has risks that require proper optimizations and risk control. Overall, when thoroughly understood and optimized, it can form an effective component of a quantitative trading system.
/*backtest start: 2023-02-16 00:00:00 end: 2024-02-22 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 strategy("New Highs and Lows Momentum Strategy", overlay = true, default_qty_type = strategy.percent_of_equity, default_qty_value = 100) window = input.int(20, title="New Highs and Lows Window", minval=1) decay = input.int(5, title="Decay", minval=1) startDate = input(timestamp("1 Jan 2023"), title = "Start Date") allowShort = input.bool(false, title = "Allow shorting") var int highDecayCounter = 0 var bool isHighPeriod = false var int lowDecayCounter = 0 var bool isLowPeriod = false inTradeWindow = true window_high = ta.highest(close, window) window_low = ta.lowest(low, window) // Logic for Highs if window_high > ta.highest(close, window)[1] highDecayCounter := decay isHighPeriod := true else if highDecayCounter > 0 highDecayCounter := highDecayCounter - 1 else isHighPeriod := false // Logic for Lows if window_low < ta.lowest(low, window)[1] lowDecayCounter := decay isLowPeriod := true else if lowDecayCounter > 0 lowDecayCounter := lowDecayCounter - 1 else isLowPeriod := false // Strategy Execution if inTradeWindow if isHighPeriod and highDecayCounter == decay strategy.entry("Long", strategy.long) if isHighPeriod and highDecayCounter == 0 strategy.close("Long") if isLowPeriod and lowDecayCounter == decay and allowShort strategy.entry("Short", strategy.short) if isLowPeriod and lowDecayCounter == 0 and allowShort strategy.close("Short") // Plotting plot(window_high, color=color.green) plot(window_low, color=color.red)template: strategy.tpl:40:21: executing "strategy.tpl" at <.api.GetStrategyListByName>: wrong number of args for GetStrategyListByName: want 7 got 6