FlyTradr
docs
๐ŸŽฎ Trading Simulator
Overview

๐ŸŽฎ Trading Simulator - User Guide

Watch your strategy execute with realistic market conditions, configurable speed controls, and stress testing scenarios.

๐Ÿ“‹ Table of Contents

SectionDescription
1. OverviewWhat is the Trading Simulator
2. Quick StartGet started in 5 steps
3. Interface OverviewUnderstanding the UI
4. Strategy SelectionLoading your strategy
5. Market SelectionChoosing markets and timeframes
6. Test SettingsConfiguring your simulation
7. Speed ControlControlling replay speed
8. Execution RealismModeling real-world conditions
9. Scenario InjectionTesting edge cases
10. Starting SimulationLaunch sequence
11. Live MonitoringReal-time telemetry
12. Playback ControlsControl the simulation
13. Results AnalysisReviewing performance
14. TemplatesSaving configurations
15. Tips & Best PracticesPro tips
16. FAQCommon questions
17. Related GuidesContinue learning

1. Overview

๐ŸŽฏ What is the Trading Simulator?

The Trading Simulator replays historical data at configurable speeds, testing your strategy's behavior under realistic execution conditions. Unlike instant backtesting, the simulator lets you watch your strategy execute in real-time (or accelerated time) and test edge cases with scenario injection.

Your Strategy Journey:

  1. Strategy Builder - Design your strategy
  2. Backtesting Lab - Quick historical validation
  3. Trading Simulator - Realistic execution testing โ† You are here
  4. Paper Trader - Live data simulation
  5. Live Trading - Real money

Key Features:

  • โฏ๏ธ Replay Mode - Watch strategy execute in real-time or accelerated
  • โšก Speed Control - 6 speed modes from Realtime to 10x Fast
  • ๐Ÿ’ฅ Scenario Injection - Test flash crashes, volatility spikes, liquidity droughts
  • ๐ŸŽฒ Execution Realism - Model latency, slippage, market impact
  • ๐Ÿ“ก Live Telemetry - Real-time streaming of execution events
  • ๐Ÿ“Š Progress Tracking - Progress bar with time estimates

๐Ÿ”„ Simulator vs Other Tools

FeatureBacktestingSimulatorPaper Trading
๐Ÿ“Š Data SourceHistoricalHistorical (replayed)Live Market
โšก SpeedInstantConfigurableReal-Time
๐ŸŽฒ RealismBasicConfigurableFull
๐Ÿ’ฅ ScenariosโŒโœ… SupportedโŒ
โฑ๏ธ DurationSecondsMinutes-HoursHours-Days
๐ŸŽฏ Use CaseRapid iterationStress testingPre-live validation

2. Quick Start

Get Started in 5 Steps:

  1. Navigate - Dashboard โ†’ Platform โ†’ Trading Simulator
  2. Select Strategy - Choose from your saved strategies
  3. Configure Market - Pick symbol, timeframe, and date range
  4. Set Speed Mode - Choose Auto (recommended), Fast, Balanced, or Accurate
  5. Click Start - Watch your simulation run!

๐Ÿ’ก First time? Use Auto speed mode with 1 week of data for a quick test


3. Interface Overview

Left Panel (Configuration):

  1. Strategy Selection - Load from library or Strategy Builder
  2. Market Selection - Choose symbol and timeframe
  3. Test Settings - Date range, capital, fees
  4. Speed Control - Replay speed mode
  5. Execution Realism - Latency, slippage, market impact
  6. Scenario Injection - Add stress test events

Main Panel (Live Monitoring):

  1. Progress Bar - Current progress with ETA
  2. Portfolio Stats - Real-time equity, P&L, positions
  3. Equity Curve - Portfolio value over time
  4. Trade List - Executed trades with details

Telemetry Panel (Health Monitoring):

  • Tick counter and processing speed
  • Execution latency metrics
  • Memory usage
  • Connection status

4. Strategy Selection

๐Ÿ“‹ Loading Your Strategy

Select a strategy to simulate:

SourceDescription
๐Ÿ“ Strategy LibraryPreviously saved strategies
โœ๏ธ Strategy BuilderCurrently open strategy
๐Ÿ“ฅ ImportLoad from JSON file

โœ… Strategy Requirements

RequirementDescription
โœ… Valid DSLStrategy must compile without errors
โœ… Entry RulesAt least one entry condition
โœ… Exit RulesAt least one exit condition
โœ… BacktestedShould pass backtesting first

5. Market Selection

Market Types:

  • Crypto - Binance data (BTC/USDT, ETH/USDT, etc.)
  • US Stocks - TwelveData (AAPL, TSLA, MSFT, etc.)
  • Forex - TwelveData (EUR/USD, GBP/USD, etc.)
  • Indian Equities - Demo data (RELIANCE, TCS, INFY, etc.)

Available Timeframes:

TimeframeBest ForData Points (1 year)
1mScalping525,600
5mDay trading105,120
15mIntraday swing35,040
1hSwing trading8,760
4hPosition trading2,190
1dLong-term365

6. Test Settings

Configuration Options:

  1. Capital Settings - Initial portfolio size and currency
  2. Date Range - Start/end dates with quick selects (1W, 1M, 3M, 6M, 1Y)
  3. Session Templates - Market hours (NSE, NYSE, Forex 24/5, Crypto 24/7)
  4. Trading Fees - Commission and slippage rates

๐Ÿ’ฐ Capital Options

CurrencySymbolTypical Range
๐Ÿ‡ฎ๐Ÿ‡ณ Indian Rupeeโ‚นโ‚น1,00,000 - โ‚น50,00,000
๐Ÿ‡บ๐Ÿ‡ธ US Dollar$$10,000 - $500,000
๐Ÿ‡ช๐Ÿ‡บ Euroโ‚ฌโ‚ฌ10,000 - โ‚ฌ500,000
๐Ÿ‡ฌ๐Ÿ‡ง British Poundยฃยฃ10,000 - ยฃ500,000
โ‚ฟ BitcoinBTC0.1 - 10 BTC
๐Ÿ’Ž EthereumETH1 - 100 ETH

๐Ÿ’ฑ Currency Display: All P&L values in the simulation results are automatically converted to your profile's display currency. The simulation runs in the configured currency, but dashboard views show converted values using live FX rates.

๐Ÿ“… Date Range Quick Selects

PeriodDescriptionData Volume
1WLast week~2,000 candles (5m)
1MLast month~8,600 candles (5m)
3MLast 3 months~26,000 candles (5m)
6MLast 6 months~52,000 candles (5m)
1YLast year~105,000 candles (5m)

โฐ Session Templates

TemplateHoursTime Zone
๐Ÿ‡ฎ๐Ÿ‡ณ NSE09:15 - 15:30 ISTAsia/Kolkata
๐Ÿ‡บ๐Ÿ‡ธ NYSE09:30 - 16:00 ESTAmerica/New_York
๐Ÿ‡บ๐Ÿ‡ธ NASDAQ09:30 - 16:00 ESTAmerica/New_York
๐Ÿ’ฑ Forex24/5UTC
โ‚ฟ Crypto24/7UTC
๐Ÿ“Š CustomUser-definedUser-defined

7. Speed Control

โฏ๏ธ Speed Modes

ModeSpeedDescriptionUse Case
๐Ÿข Realtime1xActual market speedWatch every tick
๐ŸŒ Slow0.5xHalf speedDetailed analysis
๐Ÿค– AutoOptimizedSystem decidesRecommended
โšก Fast10xQuick completionValidation runs
โš–๏ธ Balanced5xSpeed + accuracyGeneral testing
๐ŸŽฏ AccurateTick-by-tickEvery data pointPrecision testing

๐Ÿ’ก Tip: Start with Auto mode. The system optimizes based on your data volume and complexity.

โฑ๏ธ Time Estimates

Data PeriodAuto ModeFast ModeRealtime
1 Week~2 min~30 sec~35 hours
1 Month~8 min~2 min~7 days
3 Months~20 min~5 min~21 days
1 Year~1 hour~15 min~3 months

8. Execution Realism

Simulate Real-World Trading Conditions:

โšก Network Latency - Delay between order submission and execution ๐Ÿ“Š Order Book & Liquidity - Partial fills and order rejections ๐Ÿ“ˆ Market Impact - Large orders move prices ๐Ÿ“‰ Dynamic Slippage - Slippage increases during volatility

โšก Network Latency

Models the delay between order submission and execution:

SettingDescriptionTypical Values
Min LatencyBest-case delay10-50ms
Max LatencyWorst-case delay100-500ms
JitterRandom variationOn/Off

๐Ÿ“Š Order Book & Liquidity

SettingDescription
Liquidity ThresholdOrders > X% of daily volume may be rejected
Partial FillsLarge orders may fill in parts
Rejection ProbabilityChance of order rejection

๐Ÿ“ˆ Market Impact

Large orders move prices:

ModelDescriptionUse Case
LinearImpact proportional to order sizeSimple approximation
Square RootImpact = k ร— โˆš(Order Size)Institutional standard

๐Ÿ“‰ Dynamic Slippage

Slippage increases during volatile periods:

Actual Slippage = Base Slippage ร— Volatility ร— Multiplier
SettingDescriptionRange
Base SlippageNormal market conditions0.01% - 0.1%
Volatility MultiplierScales with market volatility1x - 3x

9. Scenario Injection

Test Your Strategy Under Stress:

Inject market events to see how your strategy handles extreme conditions:

  • ๐ŸŒ‹ Volatility Spike - Sudden price movement increase
  • ๐Ÿ“‰ Flash Crash - Rapid price drop and recovery
  • ๐Ÿ’ง Liquidity Drought - Reduced market depth and wider spreads
  • ๐Ÿ“ฐ News Shock - Price gap simulation
  • ๐Ÿ”„ Regime Shift - Trend reversal

๐Ÿ“‹ Scenario Types

ScenarioDescriptionEffect
๐ŸŒ‹ Volatility SpikeSudden increase in price movementTests stop-loss behavior
๐Ÿ“‰ Flash CrashRapid price drop and recoveryTests panic scenarios
๐Ÿ’ง Liquidity DroughtReduced market depthTests fill quality
๐Ÿ“ฐ News ShockPrice gap on news eventTests gap handling
๐Ÿ”„ Regime ShiftTrend reversalTests adaptation

๐ŸŒ‹ Volatility Spike Settings

SettingDescriptionRange
IntensityHow much volatility increases2x - 10x
DurationHow long the spike lasts5 - 60 minutes
Trigger TimeWhen to inject (random or specific)Auto / Manual

๐Ÿ“‰ Flash Crash Settings

SettingDescriptionRange
Drop MagnitudeHow far price drops5% - 20%
Drop DurationHow fast the drop occurs1 - 5 minutes
Recovery TimeHow fast price recovers5 - 30 minutes
Recovery %How much price recovers50% - 100%

๐Ÿ’ง Liquidity Drought Settings

SettingDescriptionRange
Spread WideningHow much spread increases2x - 10x
DurationHow long the drought lasts5 - 60 minutes
Fill RatePercentage of orders that fill20% - 80%

10. Starting Simulation

Launch Process:

  1. Click Start button
  2. System validates your configuration
  3. Historical data is fetched from provider
  4. Simulation engine initializes
  5. Strategy begins executing on replayed data
  6. Live telemetry streams to your browser

Simulation States:

  • Idle โ†’ Initializing โ†’ Loading โ†’ Running โ†’ Completed
  • Can pause/resume at any time
  • Stop ends simulation permanently

๐ŸŽจ Status Indicators

StatusColorDescription
โฌค IdleGrayReady to start
โฌค InitializingBlueValidating configuration
โฌค LoadingOrangeFetching historical data
โฌค RunningGreenSimulation in progress
โฌค PausedYellowTemporarily stopped
โฌค CompletedGreenSuccessfully finished
โฌค StoppedGrayManually stopped

11. Live Monitoring

Real-Time Telemetry:

The simulator streams live updates via Server-Sent Events (SSE) as your strategy executes:

  • Tick Events - Each candle processed
  • Order Events - Entries, exits, fills
  • Portfolio Updates - Equity, positions, P&L

All updates appear instantly in the interface with no page refresh needed.

๐Ÿ’ฐ Live Portfolio Stats

MetricDescription
๐Ÿ’ต EquityTotal portfolio value
๐Ÿ’ณ CashAvailable cash balance
๐Ÿ“ˆ Open P&LUnrealized profit/loss
๐Ÿ“Š Total P&LRealized + unrealized
๐Ÿ“ฆ PositionsCurrent open positions
๐Ÿ“ OrdersPending orders
๐Ÿ”„ TradesTotal executed trades
๐ŸŽฏ Win RatePercentage of winning trades

๐Ÿ–ฅ๏ธ Runtime Health

MetricHealthy RangeWarning
Tick CounterProgressingStuck for 10s+
Exec LatencyUnder 100msOver 500ms
Memory UsageUnder 500MBOver 1GB
SSE Status๐ŸŸข Connected๐Ÿ”ด Disconnected

12. Playback Controls

โฏ๏ธ Controlling the Simulation

ButtonActionDescription
โ–ถ๏ธ StartBegin simulationStarts from beginning
โธ๏ธ PauseTemporarily stopCan resume later
โ–ถ๏ธ ResumeContinue from pausePicks up where you left off
โน๏ธ StopEnd simulationCannot resume

โธ๏ธ When to Use Pause

ScenarioWhy Pause
Observe a specific eventPause to analyze what just happened
Scenario triggeredWatch how strategy responds
Large trade executedReview order details
Take a breakReturn later without losing progress

๐Ÿ’ก Tip: Pausing does NOT reset the simulation. You can resume from exactly where you left off.


13. Results Analysis

Comprehensive Performance Summary:

After completion, view detailed results across three categories:

๐Ÿ“ˆ Returns:

  • Total Return %
  • Sharpe Ratio (risk-adjusted return)
  • Sortino Ratio (downside risk)

๐Ÿ“‰ Risk:

  • Max Drawdown %
  • Volatility
  • Value at Risk

๐Ÿ”„ Trading:

  • Total Trades
  • Win Rate %
  • Profit Factor

๐Ÿ“ˆ Key Metrics

MetricDescriptionGood Value
๐Ÿ“ˆ Total ReturnOverall profit/lossPositive
๐Ÿ“Š Sharpe RatioRisk-adjusted return> 1.0
๐Ÿ“‰ Max DrawdownLargest peak-to-trough loss< 15%
๐ŸŽฏ Win RatePercentage of winning trades> 50%
โš–๏ธ Profit FactorGross profit / gross loss> 1.5
๐Ÿ“‹ Avg TradeAverage profit per tradePositive

๐Ÿ“ˆ Available Charts

ChartShows
๐Ÿ“ˆ Equity CurvePortfolio value over time
๐Ÿ“‰ Drawdown ChartPeak-to-trough losses
๐Ÿ“Š Win/Loss DistributionTrade outcome histogram
๐Ÿ“… Monthly ReturnsCalendar heatmap of returns

๐Ÿ’พ Exporting Results

FormatContents
๐Ÿ“„ CSVAll trades, metrics, timestamps
๐Ÿ“‹ JSONFull simulation data including configuration

14. Templates

๐Ÿ’พ Saving Configuration Templates

Save your simulation setup for reuse:

ComponentSaved
โœ… Strategy ReferenceYes
โœ… Market SelectionYes
โœ… Test SettingsYes
โœ… Execution RealismYes
โœ… Scenario InjectionYes
โœ… Speed ModeYes

๐Ÿ“ Example Templates

TemplateDescription
๐Ÿ“ AAPL Stress TestAAPL 5m, $100k, Flash Crash enabled
๐Ÿ“ Quick ValidationAny symbol, 1 week, Fast mode
๐Ÿ“ Full Realism TestAll realism options, Slow mode

15. Tips & Best Practices

Pro Tips:

โœ… Start with Auto Speed - Let the system optimize for your data volume โœ… Enable Execution Realism - At least latency (50-200ms) and slippage (0.01-0.1%) โœ… Test Stress Scenarios - Every strategy should survive a flash crash โœ… Compare with Backtesting - Results should be similar but slightly worse due to realism โœ… Save Configuration Templates - Maintain consistency across tests โœ… Use Sufficient Data - Minimum 1-3 months for statistical significance

Common Mistakes:

โŒ Zero slippage/latency - Unrealistic execution (always enable realism) โŒ Fast mode only - May miss execution issues (test slower modes too) โŒ No stress testing - Creates false confidence (add scenarios) โŒ Too short date range - Statistical noise (use 1-3 months minimum)

๐ŸŽฏ When to Use Simulator vs Others

Use CaseBest ToolWhy
Rapid iterationBacktestingFastest results
Execution testingSimulatorRealistic fills
Stress testingSimulatorScenario injection
Pre-live validationPaper TradingReal market data
Parameter optimizationBacktestingMany runs needed

16. FAQ

How long does a simulation take? Depends on data volume and speed mode. Typical times: 1 week (~2 min), 1 month (~8 min), 3 months (~20 min) on Auto speed.

Can I change speed during simulation? Not currently - stop and restart with different speed.

Why are results different from backtesting? Execution realism (latency, slippage, market impact) makes fills more realistic, usually slightly worse than backtesting.

What if I close the browser during simulation? Simulation continues on server. Reconnect to see progress and results.

How many scenarios can I add? No hard limit, but too many creates unrealistic conditions.

Does scenario injection modify historical data? No - scenarios are overlaid. Original data unchanged.

What if SSE connection fails? Page automatically attempts to reconnect. If issues persist, check network connection.


17. Related Guides

Your Trading Journey:

  1. Strategy Builder - Create your strategy
  2. Backtesting Lab - Quick historical validation
  3. Trading Simulator - Realistic execution testing โ† You are here
  4. Paper Trader - Live data simulation
  5. Dashboard - Platform navigation

๐Ÿ†˜ Need Help?


Test your strategy with realistic execution conditions! ๐ŸŽฎ