DocsAI Watchers, Backtesting & Parameter Sweeps
Browse guidesAI Watchers, Backtesting & Parameter Sweeps
AI & Automation3 min read

AI Watchers, Backtesting & Parameter Sweeps

Learn how to monitor active markets, perform historical backtests, and run parallel parameter sweeps.

AI Watchers are persistent cloud containers that monitor the market and execute or evaluate your strategy code in real-time.


Running Backtests

Before activating any strategy on a live account, you should run historical backtests to evaluate performance. You can do this in two ways:

Method 1: Manual Backtesting via Dashboard

  1. Open your Watcher's detail panel and select the Backtests tab.
  2. Select the specific strategy version code, target symbol, timeframe, and historical date range.
  3. Click Run Backtest.
  4. Review the equity curve, trade markers (buy/sell entry/exit symbols on lightweight charts), Sharpe Ratio, and maximum drawdown.

Method 2: Agent-Driven Backtesting (Conversational)

You can instruct the AI assistant to set up and execute a historical backtest directly from the chat window. The agent will automatically configure the strategy version, pull the required market data, run the backtest via the background workers, and render the completed interactive chart block in your chat session.

  • Example prompt: "Run a backtest on EURUSD H1 for strategy v2 from May 1 to June 1, 2026."

AI Strategy Optimizer & Parameter Sweeps

The optimizer allows you to run parallel multi-variable sweeps (parameter grid searches) in a secure sandbox container. This helps you identify the best-performing variables (like indicator periods or stop-loss limits) for your strategy.

Method 1: Manual Parameter Sweeps

  1. Go to the watcher details page and select the Optimizer tab.
  2. Select the strategy version you wish to optimize. (Note: You must have built and saved a version in Strategy Builder first).
  3. Set your target symbol and historical date range.
  4. Define your Parameter Grid:
    • Click Add Param.
    • Input the parameter name (must match the variable in your strategy code, e.g., rsi_period).
    • Select Numeric Range to test increments (e.g., Min: 10, Max: 20, Step: 2) OR Discrete Choices to test a custom list (e.g., 15, 30, 45).
  5. Click Start Parameter Optimization.
  6. Leaderboard Output: Celery workers will execute these sweeps in parallel. A live-updating leaderboard will render below, sorted by Return [%] descending. The best parameters configuration will be highlighted as #1, detailing Total Trades, Win Rate, Sharpe Ratio, Max Drawdown, and Net Return.

Method 2: AI-Driven Agent Optimization

Instead of typing parameters manually, you can ask the AI agent:

  • "Optimize the rsi_period for my strategy v2 on EURUSD over the last 30 days."
  • The agent will automatically configure the sweep bounds, run the background worker task, analyze the returned leaderboard metrics, and output a detailed synthesis suggesting the optimal parameters.