Volatility Adjusted Mean Reversion Strategy (Python). StockSharp

Author: StockSharp
N: 1737
v5.0.0 (7/30/2025)
Downloads: 4

This variation of mean reversion scales entry thresholds by the ratio of ATR to standard deviation. When volatility increases relative to typical noise, the distance needed to trigger a trade grows, helping avoid premature signals during chaotic swings.
A long position opens when price falls below the moving average by more than the adjusted threshold. A short position opens when price rises above the average by the same measure. Positions exit once price closes back near the average level.
The adaptive threshold makes this strategy suitable for markets with changing volatility regimes. A stop-loss equal to twice the ATR limits risk while waiting for reversion.

  • Entry Criteria:

    • Long: Close < MA - Multiplier * ATR / (ATR/StdDev)
    • Short: Close > MA + Multiplier * ATR / (ATR/StdDev)

  • Long/Short: Both sides.
  • Exit Criteria:

    • Long: Exit when close >= MA
    • Short: Exit when close <= MA

  • Stops: Yes, dynamic based on ATR.
  • Default Values:

    • Period = 20
    • Multiplier = 2.0m
    • CandleType = TimeSpan.FromMinutes(5)

  • Filters:

    • Category: Mean Reversion
    • Direction: Both
    • Indicators: ATR, StdDev
    • Stops: Yes
    • Complexity: Intermediate
    • Timeframe: Intraday
    • Seasonality: No
    • Neural networks: No
    • Divergence: No
    • Risk Level: Medium