� Backtesting Lab - User Guide
🔬 Backtesting Lab - User Guide
Version: 1.0
Last Updated: 10 December 2025
Status: ✅ Complete
Audience: Traders, Strategy Designers, Platform Users
📑 Table of Contents
- Overview
- How to Access
- Key Features
- Interface Tour
- Running Your First Backtest
- Configuration Controls
- Understanding Results
- Performance Metrics
- Charts & Visualizations
- Saving & Exporting
- Templates
- Tips & Best Practices
- Common Issues & Solutions
- FAQ
- Related Guides
🎯 Overview
What is Backtesting Lab?
The Backtesting Lab is where you test your trading strategies against real historical market data. It answers the crucial question: "Would this strategy have been profitable in the past?"
Think of it as a time machine for trading — you replay historical market conditions and see exactly how your strategy would have performed.
What Can You Do?
| 🎯 Capability | 📝 Description |
|---|---|
| 🕐 Historical Testing | Run strategies against years of past market data |
| 📊 Comprehensive Metrics | 20+ performance metrics (Sharpe, Sortino, drawdown, etc.) |
| 📈 Equity Curve | Visualize your portfolio growth over time |
| 📋 Trade List | See every trade with entry, exit, P&L details |
| 💰 Fee Simulation | Include realistic commission and slippage |
| 💾 Save Results | Store backtests for comparison |
| 📤 Export Data | Download trades as CSV for analysis |
Why Backtest?
| ❌ Without Backtesting | ✅ With Backtesting |
|---|---|
| "I think this will work..." | "Historical data shows 62% win rate" |
| Guessing at position sizes | Optimal sizing based on drawdown |
| Unknown risk exposure | Max drawdown of 12% identified |
| Blind trading | Data-driven confidence |
📍 How to Access
🏠 Dashboard → 📊 Platform → 🔬 Backtesting Lab
Step-by-Step Navigation
- Log in to your Flytradr account
- Click on Platform in the main navigation
- Select Backtesting Lab from the sidebar menu
📸 [Screenshot: Navigation path highlighted showing Dashboard → Platform → Backtesting Lab]
Quick Access Methods
| Method | How |
|---|---|
| Command Palette | Press Ctrl+K, type "Backtest" |
| Direct URL | /platform/backtesting-lab |
| From Strategy Builder | Click "Run Backtest" button after building |
✨ Key Features
🧱 Core Capabilities
| Icon | Feature | Description |
|---|---|---|
| 🎯 | Strategy Selection | Load any saved strategy from your library |
| 🌐 | Multi-Market | Test on Binance, Yahoo Finance, and more |
| 📅 | Custom Date Range | Select specific historical periods |
| 💰 | Capital Settings | Set starting capital and position sizing |
| 📊 | Fee Modeling | Simulate commission and slippage |
| ⏱️ | Session Timer | Track backtest execution time |
| 📈 | Live Progress | Watch results as they calculate |
| 💾 | Save & Compare | Store multiple backtests |
🛡️ Realistic Simulation
The Backtesting Lab models real trading conditions:
- ✅ Commission fees (per-trade costs)
- ✅ Slippage (price impact)
- ✅ Order execution (market/limit)
- ✅ Position sizing (based on capital)
🖥️ Interface Tour
Layout Overview
Screenshot: [Diagram placeholder #1 - Add relevant screenshot here]
Sidebar Sections
| Section | Purpose | Icon |
|---|---|---|
| Strategy Selection | Choose which strategy to test | 🎯 |
| Market Selection | Pick data provider, symbol, timeframe | 🌐 |
| Test Settings | Configure capital, dates, session | ⚙️ |
| Execution Settings | Set fees, slippage, order types | 💰 |
| Actions | Start, Stop, Reset, Save, Export | 🎬 |
| Templates | Save/load configuration presets | 📋 |
🚀 Running Your First Backtest
Let's run a complete backtest step by step!
Step 1: Select Your Strategy
- Click the Strategy Selection section in the sidebar
- Click Select Strategy or the dropdown
- Choose a strategy from your saved library
- The strategy details will appear below
📸 [Screenshot: Strategy selection dropdown with list of saved strategies]
💡 Tip: No strategies? Go to Strategy Builder first!
Step 2: Configure Market Data
- Click the Market Selection section
- Configure:
| Field | Description | Example |
|---|---|---|
| Provider | Data source | Binance, Yahoo Finance |
| Symbol | Trading pair/ticker | BTCUSDT, AAPL |
| Timeframe | Candle interval | 1h, 4h, 1d |
📸 [Screenshot: Market selection panel with provider, symbol, and timeframe dropdowns]
Step 3: Set Test Parameters
- Click the Test Settings section
- Configure your backtest parameters:
| Parameter | Description | Recommended |
|---|---|---|
| Start Date | When to begin testing | 6-12 months ago |
| End Date | When to end testing | Today or yesterday |
| Initial Capital | Starting portfolio value | Your typical trading capital |
| Currency | Account currency | USD, EUR, INR |
📸 [Screenshot: Test settings panel with date pickers and capital input]
Step 4: Configure Execution Settings
- Click the Execution Settings section
- Set realistic trading costs:
| Parameter | Description | Typical Values |
|---|---|---|
| Commission | Per-trade fee | 0.1% (crypto), 0.01% (stocks) |
| Slippage | Price impact | 0.05% - 0.1% |
| Order Type | Execution style | Market (default) |
📸 [Screenshot: Execution settings panel with commission and slippage inputs]
💡 Why fees matter: A strategy with 55% win rate might actually lose money after fees!
Step 5: Run the Backtest
- Review your configuration
- Click the ▶️ Start button
- Watch the progress bar fill
- View results as they stream in!
📸 [Screenshot: Backtest running with progress bar at 50%]
Status Indicators
| Status | Icon | Description |
|---|---|---|
| Idle | ⚪ | Ready to start |
| Initializing | 🟡 | Loading data |
| Running | 🔵 | Backtest in progress |
| Completed | 🟢 | Finished successfully |
| Failed | 🔴 | Error occurred |
⚙️ Configuration Controls
Strategy Settings Panel
| Control | Purpose | Notes |
|---|---|---|
| Strategy Dropdown | Select saved strategy | Shows name + last updated |
| Strategy Preview | View DSL summary | Read-only |
| Refresh Button | Reload strategy list | Use after saving new strategies |
Market Selection Panel
| Control | Type | Options |
|---|---|---|
| Provider | Dropdown | Binance, Yahoo Finance, etc. |
| Symbol | Searchable dropdown | Depends on provider |
| Timeframe | Dropdown | 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w, 1M |
📊 Provider Comparison:
| Provider | Best For | Data Quality | Historical Depth |
|---|---|---|---|
| Binance | Crypto | ⭐⭐⭐⭐⭐ | 3+ years |
| Yahoo Finance | Stocks, ETFs | ⭐⭐⭐⭐ | 10+ years |
Test Settings Panel
| Control | Type | Default | Range |
|---|---|---|---|
| Start Date | Date picker | 6 months ago | Any valid date |
| End Date | Date picker | Today | After start date |
| Initial Capital | Number input | 10,000 | 100 - 10,000,000 |
| Currency | Dropdown | USD | USD, EUR, INR, etc. |
| Session Template | Dropdown | Crypto 24×7 | See below |
Session Templates
| Template | Description | Hours |
|---|---|---|
| 🇮🇳 Indian Equities | NSE/BSE trading | 9:15 AM - 3:30 PM IST |
| 🇺🇸 US Equities | NYSE/NASDAQ | 9:30 AM - 4:00 PM EST |
| 🇪🇺 EU Equities | LSE/Euronext | 8:00 AM - 4:30 PM CET |
| 🌐 Global FX | Forex markets | 24h Mon-Fri |
| ₿ Crypto 24×7 | Cryptocurrency | Continuous |
| 🛢️ Commodities | CME/NYMEX | Various |
Execution Settings Panel
| Control | Type | Default | Range |
|---|---|---|---|
| Commission (%) | Number input | 0.1 | 0 - 5 |
| Slippage (%) | Number input | 0.05 | 0 - 5 |
| Allow Shorting | Toggle | Yes | Yes/No |
| Order Type | Dropdown | Market | Market, Limit |
💡 Realistic Fee Examples:
| Market | Commission | Slippage |
|---|---|---|
| Crypto (CEX) | 0.1% | 0.05% |
| Crypto (DEX) | 0.3% | 0.2% |
| US Stocks | 0.01% | 0.02% |
| Forex | 0.01% | 0.01% |
📊 Understanding Results
Performance Summary Panel
After a backtest completes, you'll see a summary grid:
Screenshot: [Diagram placeholder #2 - Add relevant screenshot here]
Color Coding
| Color | Meaning | Example |
|---|---|---|
| 🟢 Green | Good/Positive | Win rate > 50%, Sharpe > 1 |
| 🟡 Yellow | Caution/Moderate | Drawdown 10-20% |
| 🔴 Red | Bad/Negative | Losing strategy, high drawdown |
📈 Performance Metrics
Core Metrics Explained
| Metric | What It Measures | Good Value | Formula |
|---|---|---|---|
| Total Return | Overall profit/loss % | > 0% | (End - Start) / Start × 100 |
| Net Profit | Absolute dollar gain/loss | > $0 | End Balance - Start Balance |
| Win Rate | % of profitable trades | > 50% | Winning Trades / Total Trades |
| Profit Factor | Gross profit ÷ gross loss | > 1.5 | Total Gains / Total Losses |
Risk Metrics
| Metric | What It Measures | Good Value | Interpretation |
|---|---|---|---|
| Max Drawdown | Largest peak-to-trough decline | < 20% | Lower = less risk |
| Sharpe Ratio | Risk-adjusted return | > 1.0 | Higher = better |
| Sortino Ratio | Downside risk-adjusted return | > 1.5 | Like Sharpe, ignores upside volatility |
| Calmar Ratio | Return / Max Drawdown | > 1.0 | Higher = better risk/reward |
Trade Statistics
| Metric | Description |
|---|---|
| Total Trades | Number of completed round-trips |
| Avg Win | Average profit on winning trades |
| Avg Loss | Average loss on losing trades |
| Largest Win | Best single trade |
| Largest Loss | Worst single trade |
| Avg Trade Duration | How long positions are held |
| Expectancy | Expected $ per trade |
Metric Benchmarks
| Metric | 🔴 Poor | 🟡 Average | 🟢 Good | ⭐ Excellent |
|---|---|---|---|---|
| Win Rate | < 40% | 40-50% | 50-60% | > 60% |
| Profit Factor | < 1.0 | 1.0-1.5 | 1.5-2.0 | > 2.0 |
| Sharpe Ratio | < 0 | 0-1.0 | 1.0-2.0 | > 2.0 |
| Max Drawdown | > 30% | 20-30% | 10-20% | < 10% |
📉 Charts & Visualizations
Equity Curve
The Equity Curve shows your portfolio value over time:
Portfolio Value ($)
^
12000│ ___/
│ ___/
11000│ ___/
│ ___/
10000│___________/
│
9500│ ↓ Drawdown
└──────────────────────────────────────> Time
Jan Feb Mar Apr May
📸 [Screenshot: Interactive equity curve with hover tooltips]
What to look for:
- 📈 Upward trend = Strategy is profitable overall
- 📉 Sharp drops = Drawdown periods (risk!)
- 📊 Smooth curve = Consistent performance (ideal)
- 🎢 Choppy curve = High volatility (concerning)
Drawdown Chart
Shows underwater equity periods:
Drawdown (%)
0%│─────────────────────────────────────
│ \ /
-5%│ \/\/
│ \
-10%│ \____/
│
-15%│ Max DD: -12%
└──────────────────────────────────────> Time
📸 [Screenshot: Drawdown chart showing peak-to-trough declines]
Win/Loss Distribution
Histogram of trade outcomes:
Frequency
^
12 │ ▓▓
10 │ ▓▓
8 │ ▓▓ ▓▓
6 │ ▓▓ ▓▓ ▓▓
4 │ ▓▓ ▓▓ ▓▓ ▓▓
2 │ ▓▓ ▓▓ ▓▓ ▓▓ ▓▓
└─────────────────────> P&L %
-5% -2% 0% +2% +5%
📸 [Screenshot: Win/loss distribution histogram]
Monthly Returns Heatmap
Jan Feb Mar Apr May Jun
2024 +2% -1% +4% +3% -2% +5%
🟢 🔴 🟢 🟢 🔴 🟢
📸 [Screenshot: Monthly returns grid with color coding]
💾 Saving & Exporting
Save Results to Library
- After backtest completes, click 💾 Save Results
- Enter a descriptive label (optional)
- Add notes about this backtest (optional)
- Click Save
📸 [Screenshot: Save dialog with label and notes fields]
Saved backtests appear in: Dashboard → Saved Results
Export Trades as CSV
- Click 📤 Export button
- Select Export Trades (CSV)
- File downloads with all trade details
CSV Columns:
| Column | Description |
|---|---|
| Trade # | Sequential number |
| Entry Time | When position opened |
| Exit Time | When position closed |
| Direction | Long/Short |
| Entry Price | Entry execution price |
| Exit Price | Exit execution price |
| Quantity | Position size |
| P&L ($) | Dollar profit/loss |
| P&L (%) | Percentage return |
| Duration | How long held |
Export Full Results (JSON)
- Click 📤 Export button
- Select Export Full Results (JSON)
- Complete backtest data downloads
📋 Templates
What Are Templates?
Templates save your configuration settings (not results) for quick reuse:
- Market selection (provider, symbol, timeframe)
- Test settings (capital, dates, fees)
- Execution settings (commission, slippage)
Saving a Template
- Configure your backtest settings
- Click the 📋 Templates section
- Click Save as Template
- Enter a template name
- Click Save
📸 [Screenshot: Template save dialog]
Loading a Template
- Click the 📋 Templates section
- Browse your saved templates
- Click Load on the template you want
- All settings are restored!
📸 [Screenshot: Template list with load/delete buttons]
Template Ideas
| Template Name | Use Case |
|---|---|
| "BTC Daily - Low Fees" | Binance BTC 1D with 0.05% fees |
| "AAPL Swing" | Yahoo AAPL 4h, US Equities session |
| "High Frequency Test" | 1m data with tight slippage |
| "Conservative Backtest" | High fees, conservative slippage |
💡 Tips & Best Practices
🎯 Strategy Testing Tips
| 💡 Tip | 📝 Why |
|---|---|
| Test multiple timeframes | Strategy may work on 4h but not 1h |
| Use sufficient data | 6+ months minimum, 2+ years ideal |
| Include bear AND bull markets | Avoid curve-fitting to one condition |
| Test different symbols | Verify strategy isn't symbol-specific |
| Be realistic with fees | Many strategies fail after fees |
📊 Result Interpretation Tips
| 💡 Tip | 📝 Why |
|---|---|
| Win rate isn't everything | 40% win rate with 2:1 R:R is profitable |
| Watch the drawdown | Can you stomach -20% before profits? |
| Check trade count | 10 trades isn't statistically significant |
| Compare to buy-and-hold | Beat passive investing! |
| Look at losing streaks | 5+ losses in a row is psychologically hard |
⚡ Productivity Tips
| 💡 Tip | 📝 How |
|---|---|
| Use templates | Save time on repeated setups |
| Save good results | Build a comparison library |
| Export to Excel | Deeper analysis with spreadsheets |
| Test in phases | Quick test first, then detailed |
⚠️ Common Mistakes to Avoid
| ❌ Mistake | ✅ Solution |
|---|---|
| Testing only on winning periods | Include losing periods too |
| Ignoring fees | Always simulate realistic costs |
| Too few trades | Need 50+ trades for validity |
| Over-optimizing | Don't curve-fit to past data |
| Not comparing to benchmark | Beat buy-and-hold! |
⚠️ Common Issues & Solutions
Issue: "No strategy selected"
Symptoms: Start button disabled, error message shown
Solution:
- Click the Strategy Selection panel
- Choose a saved strategy from the dropdown
- If no strategies appear, create one in Strategy Builder first
📸 [Screenshot: Strategy selection panel with dropdown empty]
Issue: "Invalid date range"
Symptoms: Error about dates, backtest won't start
Solution:
- Ensure Start Date is BEFORE End Date
- Check that dates aren't in the future
- Verify data exists for the selected period
Issue: "Backtest failed"
Symptoms: Red error status, no results
Possible Causes & Solutions:
| Cause | Solution |
|---|---|
| No data for symbol/period | Try different dates or symbol |
| Network error | Check internet, retry |
| Strategy DSL invalid | Re-save strategy in Builder |
| Server timeout | Try shorter date range |
📸 [Screenshot: Error status with message details]
Issue: Results show 0 trades
Symptoms: Backtest completes but no trades
Possible Causes:
- Signal never triggered: Check strategy logic
- Wrong timeframe: Signal requires different interval
- Wrong market: Strategy designed for different symbol
- Date range too short: Not enough data for signals
Solution: Review strategy signals in Strategy Builder
Issue: Very different results than expected
Symptoms: Results don't match mental model
Checklist:
- ✅ Correct strategy selected?
- ✅ Correct symbol/timeframe?
- ✅ Fees configured correctly?
- ✅ Date range as expected?
- ✅ Initial capital correct?
❓ FAQ
General Questions
Q: How far back can I backtest?
🅰️ Depends on the data provider:
- Binance: Up to 3+ years for major pairs
- Yahoo Finance: Up to 10+ years for popular stocks
- Older data may have gaps
Q: How long does a backtest take?
🅰️ Depends on date range and timeframe:
- 1 month, 1h: ~5-10 seconds
- 1 year, 1h: ~30-60 seconds
- 3 years, 1d: ~10-20 seconds
Q: Can I backtest multiple strategies at once?
🅰️ Currently one at a time. Batch backtesting is planned for a future release.
Technical Questions
Q: What does "Sharpe Ratio" mean?
🅰️ Risk-adjusted return. It measures how much return you get per unit of risk. A Sharpe > 1.0 is considered good.
Q: Why is my win rate high but I'm losing money?
🅰️ Your average loss is larger than your average win. A 60% win rate with $100 wins and $200 losses = net loss.
Q: Does slippage apply to both entry AND exit?
🅰️ Yes, slippage is applied to every order execution in the simulation.
Troubleshooting Questions
Q: The backtest is stuck at 0%?
🅰️ The system might be fetching data. Wait 30 seconds. If still stuck, click Stop and retry.
Q: Can I pause and resume a backtest?
🅰️ Not currently. Backtests run to completion or must be stopped/restarted.
🔗 Related Guides
Before Backtesting
| 📚 Guide | 📝 Purpose |
|---|---|
| Strategy Builder Guide | Create strategies to backtest |
After Backtesting
| 📚 Guide | 📝 Purpose |
|---|---|
| Simulator Guide | Test in real-time simulation |
| Paper Trader Guide | Trade live without real money |
Supporting Documentation
| 📚 Document | 📝 Purpose |
|---|---|
| Dashboard Guide | View saved backtests |
| Troubleshooting | Common platform issues |
📝 Glossary
| Term | Definition |
|---|---|
| Backtest | Running a strategy against historical data |
| Equity Curve | Graph of portfolio value over time |
| Drawdown | Peak-to-trough decline in portfolio value |
| Sharpe Ratio | Risk-adjusted return measure |
| Sortino Ratio | Sharpe variant focusing on downside risk |
| Profit Factor | Gross profits divided by gross losses |
| Win Rate | Percentage of trades that are profitable |
| Max Drawdown | Largest percentage decline from a peak |
| Slippage | Price difference between expected and actual execution |
| Commission | Fee charged per trade |
| OHLC | Open, High, Low, Close (candle data) |
📞 Need Help?
- 💬 In-App Help: Press
Ctrl+?or click the Help icon - 📧 Email Support: support@flytradr.com
- 📖 Knowledge Base: docs.flytradr.com
- 💬 Community Discord: discord.gg/flytradr
Document End
Next Review: January 2026
Owner: Flytradr Team