PatternFoundry
← Back to Docs

Simulator

Overview & Purpose

The Simulator is the heart of PatternFoundry. It provides a full-featured trading environment where you can practice executing trades against realistic synthetic price action. The simulator includes:

Generating a Session

To start a new simulation session:

  1. Select an Instrument — Choose from 14 built-in instruments (ES, NQ, CL, RTY, MES, MNQ, MCL, M2K, SPY, AAPL, MSFT, PLTR, TSLA, GME) or any custom characters you've created in the Chart Designer. Each instrument has appropriate tick sizes, point values, and margin requirements.
  2. Set History Depth — Select how much historical chart data to generate before the live session begins: 1 day, 1 week, 1 month, 3 months, 6 months, 1 year, or 2 years.
  3. Seed (Optional) — Enter a numeric seed to reproduce a specific session. Leave blank for a random seed. Sharing seeds with other traders lets you compare performance on identical price action.
  4. Click Generate to create the session.
Note

Session generation typically takes 1–3 seconds. The system generates the full historical candle data and initializes the tick engine for real-time simulation.

Playback Controls

The playback toolbar at the bottom of the chart controls the simulation timeline:

ControlFunction
Play / PauseStart or pause the real-time tick simulation
Speed SelectorAdjust playback speed: 0.25x, 0.5x, 1x, 2x, 5x, 10x, 25x, 50x, 100x, 200x

At 1x speed, ticks arrive at realistic intervals matching the instrument's typical trading activity. Higher speeds compress time proportionally - at 10x, one minute of real time equals ten minutes of simulated market time.

Tip

Use slower speeds (0.25x–1x) when learning to read order flow and tape. Use faster speeds (10x–50x) for swing trading practice or to quickly build up chart history.

Placing Trades

PatternFoundry supports three order types:

Market Orders

Execute immediately at the current best available price. Click the Buy or Sell button in the order panel, or use keyboard shortcuts. Market orders experience realistic slippage based on available liquidity in the order book.

Limit Orders

Place an order to buy below or sell above the current price. The order rests in the book until price reaches your level. To place a limit order:

  1. Click the price level on the chart where you want the order
  2. Select "Limit" from the order type dropdown
  3. Set your quantity and optional SL/TP
  4. Confirm the order

Stop-Limit Orders

A two-price order: when price hits the stop price, a limit order is placed at the limit price. Useful for breakout entries with controlled slippage. The stop price triggers the order; the limit price defines the worst acceptable fill.

Managing Positions

Once a trade is filled, your position appears on the chart with visual markers:

To close a position, click the × on the position label or use the position panel's close button. Partial closes are supported - specify the number of contracts to close.

Account Tracking

The account panel displays real-time trading statistics:

MetricDescription
BalanceStarting capital plus/minus realized P&L
EquityBalance plus unrealized P&L from open positions
Realized P&LTotal profit/loss from closed trades
Unrealized P&LCurrent profit/loss on open positions
Win RatePercentage of closed trades that were profitable
Profit FactorGross profit divided by gross loss
Max DrawdownLargest peak-to-trough decline in equity
TradesTotal number of completed round-trip trades

Timeframe Switching

Switch between multiple timeframes without losing your session state. Available timeframes:

All timeframes are computed from the same underlying tick data, so switching is instant and consistent. Drawings and indicators persist across timeframe changes.

Session Management

Sessions can be saved, loaded, exported, and imported:

ActionDescription
SaveSave current session state to your account (server-side). Includes all price data, positions, orders, drawings, and account state.
LoadLoad a previously saved session and resume from where you left off.
ExportDownload session as a JSON file to your local machine.
ImportUpload a previously exported JSON session file.
Tip

Export sessions to share specific market scenarios with other traders for collaborative learning. Include the seed number so they can also generate the same session independently.

DOM (Depth of Market) Panel

The DOM panel shows the simulated order book in a vertical ladder format:

The DOM updates in real-time as the tick engine processes orders. You can click price levels in the DOM to quickly place limit orders at that price.

Drawing Tools

Access drawing tools from the toolbar on the left side of the chart. Available tools:

ToolDescriptionUsage
LineTrend line between two pointsClick start point, drag to end point
Horizontal LineInfinite horizontal line at a price levelClick at desired price
Vertical LineInfinite vertical line at a time pointClick at desired time
ArrowDirectional arrow between two pointsClick start, drag to end
ChannelParallel channel (two parallel lines)Draw first line, then set channel width
RectanglePrice/time zone highlightClick corner, drag to opposite corner
EllipseCircular/elliptical highlightClick center, drag to set radius
Fibonacci RetracementFib levels between swing high/lowClick swing start, drag to swing end
Gann BoxGann time/price grid overlayClick start corner, drag to end corner
Gann FanGann angle lines from a pivot pointClick pivot point, drag to set angle
TextFree-form text annotationClick position, type your label
Long PositionVisual long trade with entry, SL, TPClick entry, set SL and TP levels
Short PositionVisual short trade with entry, SL, TPClick entry, set SL and TP levels

All drawings can be selected, moved, resized, and deleted. Right-click a drawing to access its properties (color, style, line width). Use the lock button in the toolbar to prevent accidental modifications to your drawings.

Indicators

Built-in technical indicators available from the indicators menu:

IndicatorTypeDefault PeriodDescription
SMAOverlay20Simple Moving Average - arithmetic mean of closing prices over N periods
EMAOverlay20Exponential Moving Average - weighted average giving more weight to recent prices
VWAPOverlaySessionVolume Weighted Average Price - average price weighted by volume, resets each session
RSIOscillator14Relative Strength Index - momentum oscillator measuring speed of price changes (0–100)
MACDOscillator12/26/9Moving Average Convergence Divergence - trend-following momentum indicator
Bollinger BandsOverlay20, 2σPrice envelope based on standard deviation around an SMA
ATROscillator14Average True Range - volatility indicator measuring the average range of candles

Click the indicator name in the legend to toggle visibility. Click the gear icon to edit parameters. Click × to remove.

Closing a Session

When you're done trading, click the ✓ Close Session button in the playback bar. This finalizes the session and:

Margin System

The simulator enforces realistic margin requirements:

Keyboard Shortcuts

KeyAction
SpacePlay / Pause simulation
+Increase playback speed (next step)
-Decrease playback speed (previous step)
BInstant buy (market order with current panel settings, skips confirmation)
SInstant sell (market order with current panel settings, skips confirmation)
Note

Hotkeys are disabled when typing in input fields. B/S use whatever quantity, order type, SL, and TP values are set in the trade panel — they just skip the drag-to-confirm step.

Tips

Pro Tips

• Use the scroll wheel to zoom in/out on the time axis. Hold Ctrl + scroll to zoom the price axis.
• Use slower speeds (0.25x–1x) when learning to read order flow and tape. Use faster speeds (10x–50x) for swing trading practice.
• Right-click a drawing to edit its color, style, and line width.
• Commissions are 1 tick per contract round-trip, calculated automatically.