← All projects

cTrader Multi-Strategy Robot and ATR Volatility Filter

Maintenance and extension of a large cTrader cBot across three variants, including a statistical ATR volatility-regime filter that can block orders and suspend stop-loss changes when volatility drops below its normal range.

Client
cTrader robot owner
Year
2025
Category
Trading Systems
Stack
  • cTrader
  • cAlgo
  • C#

The problem

The client owned a large multi-strategy cBot, 250–390 KB of C# per file, whose legacy build used Italian naming. He needed it maintained in three variants and extended with a filter that stops it trading in dead, low-volatility markets.

What I built

  • ATR volatility filter: ATR(14) with a selectable MA type, plus a rolling mean and standard deviation of ATR over a configurable window (10 to 5,000 bars).
  • Regime thresholds: upper and lower bands at mean ± k·SD, with a separate multiplier for each side.
  • Actions: block new orders when ATR falls below its average, and optionally suspend stop-loss modifications in the same low-volatility regime. Both are switchable, and the guide gives presets for each combination.
  • Chart feedback: an info panel showing the regime as HIGH, NORMAL or LOW in colour, dashed lines for the average and thresholds, and a solid line for current ATR. The trader can see why a trade was skipped.
  • Codebase work: English-named current builds maintained alongside the legacy one, three variants (full, lite and legacy) kept in step, and 155 grouped parameters covering clusters, martingale, grid drawdown compensation, equity stop and target, Keltner, SuperTrend and swing modules.
  • News filter: separate toggles for high, medium and low impact events, plus custom events with minutes before and after.
  • Documentation: a 300-line user guide for the volatility filter with settings, examples and tuning notes.

Details

  • In live trading the filter recalculates every 5 seconds instead of every tick, and on every tick in backtests. This keeps the live robot responsive without changing backtest results.
  • Measuring the regime as distance from ATR’s own rolling mean adapts to each symbol and timeframe, so one fixed ATR threshold doesn’t have to fit every market.