OPEN-SOURCE SCRIPT

Adaptive Momentum Reversion Strategy

The Adaptive Momentum Reversion Strategy: An Empirical Approach to Market Behavior

The Adaptive Momentum Reversion Strategy seeks to capitalize on market price dynamics by combining concepts from momentum and mean reversion theories. This hybrid approach leverages a Rate of Change (ROC) indicator along with Bollinger Bands to identify overbought and oversold conditions, triggering trades based on the crossing of specific thresholds. The strategy aims to detect momentum shifts and exploit price reversions to their mean.

Theoretical Framework

Momentum and Mean Reversion: Momentum trading assumes that assets with a recent history of strong performance will continue in that direction, while mean reversion suggests that assets tend to return to their historical average over time (Fama & French, 1988; Poterba & Summers, 1988). This strategy incorporates elements of both, looking for periods when momentum is either overextended (and likely to revert) or when the asset’s price is temporarily underpriced relative to its historical trend.

Rate of Change (ROC): The ROC is a straightforward momentum indicator that measures the percentage change in price over a specified period (Wilder, 1978). The strategy calculates the ROC over a 2-period window, making it responsive to short-term price changes. By using ROC, the strategy aims to detect price acceleration and deceleration.

Bollinger Bands: Bollinger Bands are used to identify volatility and potential price extremes, often signaling overbought or oversold conditions. The bands consist of a moving average and two standard deviation bounds that adjust dynamically with price volatility (Bollinger, 2002).

The strategy employs two sets of Bollinger Bands: one for short-term volatility (lower band) and another for longer-term trends (upper band), with different lengths and standard deviation multipliers.

Strategy Construction

Indicator Inputs:

ROC Period: The rate of change is computed over a 2-period window, which provides sensitivity to short-term price fluctuations.

Bollinger Bands:

Lower Band: Calculated with a 18-period length and a standard deviation of 1.7.

Upper Band: Calculated with a 21-period length and a standard deviation of 2.1.

Calculations:

ROC Calculation: The ROC is computed by comparing the current close price to the close price from rocPeriod days ago, expressing it as a percentage.

Bollinger Bands: The strategy calculates both upper and lower Bollinger Bands around the ROC, using a simple moving average as the central basis. The lower Bollinger Band is used as a reference for identifying potential long entry points when the ROC crosses above it, while the upper Bollinger Band serves as a reference for exits, when the ROC crosses below it.

Trading Conditions:

Long Entry: A long position is initiated when the ROC crosses above the lower Bollinger Band, signaling a potential shift from a period of low momentum to an increase in price movement.

Exit Condition: A position is closed when the ROC crosses under the upper Bollinger Band, or when the ROC drops below the lower band again, indicating a reversal or weakening of momentum.

Visual Indicators:

ROC Plot: The ROC is plotted as a line to visualize the momentum direction.

Bollinger Bands: The upper and lower bands, along with their basis (simple moving averages), are plotted to delineate the expected range for the ROC.

Background Color: To enhance decision-making, the strategy colors the background when extreme conditions are detected—green for oversold (ROC below the lower band) and red for overbought (ROC above the upper band), indicating potential reversal zones.

Strategy Performance Considerations

The use of Bollinger Bands in this strategy provides an adaptive framework that adjusts to changing market volatility. When volatility increases, the bands widen, allowing for larger price movements, while during quieter periods, the bands contract, reducing trade signals. This adaptiveness is critical in maintaining strategy effectiveness across different market conditions.

The strategy’s pyramiding setting is disabled (pyramiding=0), ensuring that only one position is taken at a time, which is a conservative risk management approach. Additionally, the strategy includes transaction costs and slippage parameters to account for real-world trading conditions.

Empirical Evidence and Relevance

The combination of momentum and mean reversion has been widely studied and shown to provide profitable opportunities under certain market conditions. Studies such as Jegadeesh and Titman (1993) confirm that momentum strategies tend to work well in trending markets, while mean reversion strategies have been effective during periods of high volatility or after sharp price movements (De Bondt & Thaler, 1985). By integrating both strategies into one system, the Adaptive Momentum Reversion Strategy may be able to capitalize on both trending and reverting market behavior.

Furthermore, research by Chan (1996) on momentum-based trading systems demonstrates that adaptive strategies, which adjust to changes in market volatility, often outperform static strategies, providing a compelling rationale for the use of Bollinger Bands in this context.
Conclusion

The Adaptive Momentum Reversion Strategy provides a robust framework for trading based on the dual concepts of momentum and mean reversion. By using ROC in combination with Bollinger Bands, the strategy is capable of identifying overbought and oversold conditions while adapting to changing market conditions. The use of adaptive indicators ensures that the strategy remains flexible and can perform across different market environments, potentially offering a competitive edge for traders who seek to balance risk and reward in their trading approaches.

References

Bollinger, J. (2002). Bollinger on Bollinger Bands. McGraw-Hill Professional.

Chan, L. K. C. (1996). Momentum, Mean Reversion, and the Cross-Section of Stock Returns. Journal of Finance, 51(5), 1681-1713.

De Bondt, W. F., & Thaler, R. H. (1985). Does the Stock Market Overreact? Journal of Finance, 40(3), 793-805.

Fama, E. F., & French, K. R. (1988). Permanent and Temporary Components of Stock Prices. Journal of Political Economy, 96(2), 246-273.

Jegadeesh, N., & Titman, S. (1993). Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency. Journal of Finance, 48(1), 65-91.

Poterba, J. M., & Summers, L. H. (1988). Mean Reversion in Stock Prices: Evidence and Implications. Journal of Financial Economics, 22(1), 27-59.

Wilder, J. W. (1978). New Concepts in Technical Trading Systems. Trend Research.
Bollinger Bands (BB)educationalstatistics

Script open-source

Dans le plus pur esprit TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par nos Règles. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Vous voulez utiliser ce script sur un graphique ?

Clause de non-responsabilité