Skip to main content
The Backtest Widget allows you to test and analyze trading strategies using historical data directly inside your workspace. It combines strategy execution, performance analytics, trade logs, and risk statistics in a single environment — tightly integrated with Charts and the Indie IDE.

Getting Started

When the Backtest Widget is opened, you will see a prompt to select a strategy. Click Select Strategy or Open Strategy to:
  • Choose a built-in strategy
  • Open an existing custom strategy
  • Create a new strategy

Using Built-in Strategies

The widget includes a library of ready-to-use strategies such as:
  • ADX Breakout Strategy
  • MACD Strategy
  • Moving Average Cross
  • RSI Strategy
  • Price Channel Strategy
  • Consecutive Up/Down Strategy
  • Inside Bar / Outside Bar Strategies
To use a built-in strategy:
  1. Open the strategy selector
  2. Choose a strategy from the Built-in section
  3. Run the backtest
Built-in strategies are useful for:
  • Learning how strategy logic works
  • Benchmarking performance
  • Comparing behavior across instruments and timeframes

Creating a Custom Strategy

To create your own strategy:
  1. Open the strategy selector
  2. Click Create New Strategy
  3. The Indie editor will open
  4. Define your strategy logic
Custom strategies are written in Indie using the strategy framework. For full implementation details, refer to: https://takeprofit.com/docs/indie/Strategies/Strategies-overview Once saved, the strategy becomes available inside the Backtest Widget.

Strategy Settings

Each strategy includes configurable inputs. Typical parameters may include:
  • Initial Capital
  • Commission value and type
  • Leverage
  • Risk-free rate
  • Order size and order size unit
  • Market order type
  • Intrabar execution rules
  • Strategy-specific logic inputs (periods, thresholds, multipliers, etc.)
You can modify these inputs directly from the settings panel and instantly rerun the backtest.

Main Performance Overview

After running a strategy, the Backtest Widget provides a structured performance summary.

Core Metrics

  • Total P&L
  • Win Rate
  • Profit Factor
  • Total Trades
  • Wins / Losses
  • Average Trade
  • Expectancy
  • Risk–Reward Ratio

Capital & Returns

This section summarizes capital progression:
  • Initial Capital
  • Final Capital
  • Realized P&L
  • Unrealized P&L
  • Annualized Return
  • Buy & Hold Return
  • Average Monthly Return
  • Minimum / Maximum Equity

Risk & Volatility

Risk metrics help evaluate downside exposure:
  • Max Drawdown
  • Average Drawdown
  • Number of Drawdowns
  • Max Drawdown Duration
  • Sharpe Ratio

Volatility & Recovery

Additional recovery and stability indicators:
  • Sortino Ratio
  • Calmar Ratio
  • Daily Standard Deviation
  • Daily Value at Risk (95% / 99%)
  • Annualized Volatility
  • Average Recovery Time
  • Maximum Recovery Time

Trade Quality

Trade-level quality metrics include:
  • Expectancy
  • Risk–Reward Ratio
  • Profit Factor
  • Best Trade Net P&L
  • Worst Trade Net P&L
  • Commission-to-Profit Ratio

Trade Analysis

The Trades tab provides a detailed breakdown:
  • Trade ID and type (Long / Short)
  • Entry and exit timestamps
  • Duration
  • Individual trade P&L
  • Cumulative P&L
  • Drawdown and run-up
Trades can be inspected individually for execution analysis.

Orders Log

The Orders tab displays:
  • Order ID
  • Order type (Market / Limit / Stop)
  • Price
  • Quantity
  • Exposure
  • Fee
This allows you to audit execution mechanics in detail.

Visual Components

The widget also provides:
  • Equity curve
  • Drawdown chart
  • Position activity
  • Trade distribution statistics
These visualizations help identify instability, overfitting, or structural weaknesses in strategy logic.

Workflow Integration

The Backtest Widget is designed to work together with:
  • Charts – to visually validate entries and exits
  • IDE – to develop and refine strategy logic
  • Watchlist – to test strategies across multiple instruments
This creates a structured research loop: Develop → Test → Analyze → Refine → Retest
The Backtest Widget transforms your workspace into a complete strategy validation environment — combining execution logic, risk diagnostics, and performance analytics in one unified interface.