FlyTradr
docs
๐Ÿงช Backtesting Lab
Overview

๐Ÿงช Backtesting Lab - User Guide

Test your trading strategies against real historical market data to validate performance before risking real money.

๐Ÿ“‘ Table of Contents

  1. Overview
  2. What's New
  3. How to Access
  4. Key Features
  5. Interface Tour
  6. Running Your First Backtest
  7. Configuration Controls
  8. Understanding Results
  9. Performance Metrics
  10. Charts & Visualizations
  11. Saving & Exporting
  12. Templates
  13. Tips & Best Practices
  14. Common Issues
  15. FAQ
  16. Related Guides

๐ŸŽฏ Overview

What is Backtesting Lab?

The Backtesting Lab tests your trading strategies against real historical market data to validate performance before risking real money.

Key Capabilities:

  • ๐Ÿ“Š 20+ Performance Metrics - Win rate, Sharpe ratio, drawdown, profit factor, and more
  • ๐Ÿ“ˆ Visual Equity Curve - See portfolio growth over time
  • ๐Ÿ“‹ Detailed Trade List - Every trade with entry/exit prices and P&L
  • ๐Ÿ’ฐ Realistic Fee Simulation - Commission and slippage modeling
  • ๐Ÿ’พ Save & Compare Results - Store backtests for later analysis
  • ๐Ÿ“ค Export Data - Download trades as CSV for spreadsheet analysis

Why Backtest?

  • โœ… Know your strategy's win rate before trading live
  • โœ… Understand maximum drawdown you'll face
  • โœ… Validate strategy with data, not guesses
  • โœ… Build confidence in your approach

๐Ÿ“ How to Access

Quick Access:

  • Press Ctrl + K and type "Backtest"
  • Click Backtesting Lab in top navigation
  • From Strategy Builder, click "Backtest" button
  • Visit /platform/backtesting-lab

โœจ Key Features

Core Capabilities:

  • ๐ŸŽฏ Strategy Selection - Choose from your saved strategies
  • ๐ŸŒ Multi-Market Support - Crypto, stocks, forex, commodities, indices
  • ๐Ÿ“… Custom Date Ranges - Test any historical period
  • ๐Ÿ’ฐ Capital Settings - Set initial portfolio size and currency
  • ๐Ÿ“Š Fee Modeling - Realistic commission and slippage simulation
  • ๐Ÿ“ˆ Live Progress - Watch backtest run in real-time
  • ๐Ÿ’พ Save & Compare - Store results for later analysis

๐Ÿ–ฅ๏ธ Interface Tour

Left Panel (Configuration):

  1. Strategy Selection - Choose your strategy
  2. Market Selection - Pick symbol and timeframe
  3. Test Settings - Date range and capital
  4. Execution Settings - Fees and slippage
  5. Actions - Run, save, export buttons
  6. Templates - Save/load configurations

Right Panel (Results):

  1. Performance Metrics - Win rate, Sharpe, drawdown, etc.
  2. Equity Curve Chart - Portfolio value over time
  3. Trade List - Detailed trade log with P&L

๐Ÿš€ Running Your First Backtest

Step 1: Select Your Strategy

  1. Click the Strategy Selection dropdown
  2. Choose a strategy from your saved library
  3. Review the strategy preview (indicators and signals)

๐Ÿ’ก No strategies? Create one in Strategy Builder first!

Step 2: Configure Market Data

  1. Select Market Type: Crypto, Stocks, Forex, Commodities, or Indices
  2. Search for Symbol: Type symbol name (e.g., "BTCUSDT" or "AAPL")
  3. Choose Timeframe: 1h, 4h, 1d, etc.

Available Data:

  • Crypto (Binance): 3+ years of history
  • Stocks (Yahoo Finance): 10+ years of history
  • Forex (Yahoo Finance): 10+ years of history
  • Commodities (Yahoo Finance): 10+ years of history
  • Indices (Yahoo Finance): 20+ years of history

Step 3: Set Test Parameters

  • Start Date: When to begin (e.g., 6-12 months ago)
  • End Date: When to end (typically today)
  • Initial Capital: Starting portfolio size (e.g., $10,000)
  • Currency: USD, EUR, GBP, or INR

๐Ÿ’ก Tip: Test at least 6 months of data for reliable results

Step 4: Configure Execution Settings

  • Commission: Fee per trade (0.1% for crypto, 0.01% for stocks)
  • Slippage: Price difference between signal and execution (0.05-0.1%)

Typical Fee Settings:

  • Crypto (CEX): 0.1% commission, 0.05% slippage
  • Stocks: 0.01% commission, 0.02% slippage
  • Forex: 0.01% commission, 0.01% slippage

โš ๏ธ Important: Always include realistic fees! A profitable strategy on paper can lose money with fees

Step 5: Run the Backtest

  1. Review your configuration
  2. Click "Start Backtest" button
  3. Watch progress bar (typically 10-60 seconds)
  4. View results when complete

Status Indicators:

  • โšช Idle - Ready to start
  • ๐ŸŸก Initializing - Loading data
  • ๐Ÿ”ต Running - In progress
  • ๐ŸŸข Completed - Finished successfully
  • ๐Ÿ”ด Failed - Error occurred

๐Ÿ“Š Understanding Results

Results are organized into three sections:

  1. Returns & Performance

    • Total Return %
    • Net Profit $
    • Win Rate %
    • Profit Factor
  2. Risk Metrics

    • Max Drawdown %
    • Sharpe Ratio
    • Sortino Ratio
    • Calmar Ratio
  3. Trade Statistics

    • Total Trades
    • Average Win
    • Average Loss
    • Largest Win/Loss

Color Coding:

  • ๐ŸŸข Green = Good (win rate > 50%, Sharpe > 1)
  • ๐ŸŸก Yellow = Caution (drawdown 10-20%)
  • ๐Ÿ”ด Red = Bad (losing strategy, high drawdown)

๐Ÿ“ˆ Performance Metrics

Key Metrics Explained:

Returns:

  • Total Return - Overall profit/loss percentage (target: > 0%)
  • Net Profit - Dollar gain or loss (target: > $0)
  • Win Rate - Percentage of profitable trades (target: > 50%)
  • Profit Factor - Gross profits รท gross losses (target: > 1.5)

Risk:

  • Max Drawdown - Largest peak-to-trough decline (target: < 20%)
  • Sharpe Ratio - Risk-adjusted return (target: > 1.0)
  • Sortino Ratio - Downside risk-adjusted return (target: > 1.5)
  • Calmar Ratio - Return divided by max drawdown (target: > 1.0)

Benchmarks:

Metric๐Ÿ”ด Poor๐ŸŸก Average๐ŸŸข Goodโญ Excellent
Win Rate< 40%40-50%50-60%> 60%
Profit Factor< 1.01.0-1.51.5-2.0> 2.0
Sharpe Ratio< 00-1.01.0-2.0> 2.0
Max Drawdown> 30%20-30%10-20%< 10%

๐Ÿ“‰ Charts & Visualizations

Reading the Equity Curve

The equity curve shows your portfolio value over time. Here's what to look for:

Good Signs:

  • ๐Ÿ“ˆ Steady upward trend (profitable strategy)
  • ๐Ÿ“Š Smooth curve (consistent returns)
  • Small dips (controlled drawdowns)

Warning Signs:

  • ๐Ÿ“‰ Sharp drops (large drawdowns)
  • ๐ŸŽข Choppy, erratic movement (high volatility)
  • Flat or declining trend (unprofitable)

Trade List: Below the equity curve, you'll see every trade with:

  • Entry/exit timestamps
  • Entry/exit prices
  • Direction (long/short)
  • P&L in $ and %

๐Ÿ’พ Saving & Exporting

Save Results:

  1. After backtest completes, click "Save"
  2. Give it a descriptive name
  3. Access later from your backtest library

Export Data:

  • CSV Export - Download trade list for Excel/Google Sheets analysis
  • JSON Export - Full results backup with all metrics

CSV includes:

  • Trade number, entry/exit times
  • Entry/exit prices
  • Direction (long/short)
  • P&L in dollars and percentage

๐Ÿ“‹ Templates

Save Time with Templates:

Templates let you save common configurations (market, fees, date ranges) for quick reuse.

How to Use:

  1. Configure your settings (symbol, timeframe, fees, etc.)
  2. Click "Save as Template"
  3. Name it descriptively (e.g., "BTC Daily - Low Fees")
  4. Load anytime to apply those settings instantly

Template Ideas:

  • "BTC 1D Conservative" - BTCUSDT daily with 0.1% fees
  • "AAPL Swing" - AAPL 4h with stock fees
  • "High Frequency" - 1m timeframe with tight slippage

๐Ÿ’ก Tips & Best Practices

Testing Best Practices:

โœ… Test sufficient data - Use at least 6 months of history (preferably 12+) โœ… Include different market conditions - Both bull and bear markets โœ… Test multiple timeframes - See if strategy works across 1h, 4h, 1d โœ… Try different symbols - Validate it's not just lucky on one asset โœ… Use realistic fees - Always include commission and slippage โœ… Need enough trades - At least 50 trades for statistical significance

Interpreting Results:

  • Win rate isn't everything (40% win rate + 2:1 reward/risk = profitable)
  • Can you handle the max drawdown psychologically?
  • Compare to buy-and-hold - does your strategy beat passive investing?
  • Look at consistency - steady growth is better than erratic spikes

Common Mistakes:

โŒ Testing only bull markets (include bear markets too) โŒ Ignoring fees (can turn winners into losers) โŒ Over-optimizing parameters (curve-fitting to past data) โŒ Too few trades (need 50+ for validity)


โš ๏ธ Common Issues & Solutions

ProblemSolution
"No strategy selected"Choose a strategy from the dropdown
"Invalid date range"Make sure start date is before end date
"Backtest failed"Check your internet connection, try different dates
"0 trades executed"Your strategy didn't generate signals - review entry/exit conditions
Results seem unrealisticCheck your fee settings - too low fees inflate results
Takes too longReduce date range or use higher timeframe (e.g., 1d instead of 1h)

โ“ FAQ

How far back can I test?

  • Crypto (Binance): 3+ years
  • Stocks/Forex (Yahoo Finance): 10-20+ years

How long does a backtest take?

  • 1 month of hourly data: ~10 seconds
  • 1 year of hourly data: ~60 seconds

Can I test multiple strategies at once? Not yet - run one at a time for now.

What's a good Sharpe ratio? Sharpe ratio measures risk-adjusted returns. Above 1.0 is good, above 2.0 is excellent.

Why is my high win rate strategy losing money? Check if your average loss is larger than your average win. You might be cutting winners short and letting losers run.

Is slippage applied to both entry and exit? Yes, slippage is applied to every order to simulate realistic execution.


๐Ÿ”— Related Guides

Your Trading Journey:

  1. Strategy Builder - Create your strategy
  2. Backtesting Lab - Test with historical data โ† You are here
  3. Trading Simulator - Practice with market replay
  4. Paper Trader - Test with live data (virtual money)

๐Ÿ“ž Need Help?


Test your strategies with confidence! ๐Ÿงช