Order-Flow Simulator
Deep Dive into Order Flow, Indicators, and Strategy Design
Stock Game Pro is a market‑microstructure simulator where every candle is produced by order‑book depletion. The price does not move randomly; it moves because bids or asks are consumed. This gives you a clean environment to learn how real price discovery works.
Core loop: order‑book pressure → price tick → candle update → indicator update → strategy decision.
Goal: train your eye to link the flow (orders) to the response (price + indicators).
Every candle is built from simulated market buys/sells depleting the order book. This shows why price moves rather than just the result.
Indicators (RSI, MACD, VWAP, BB, ATR, ADX, MFI, etc.) update on each tick, so you see their true behavior during live price formation.
Write your own formulas and render them directly on the chart. This is ideal for testing ideas quickly without external tools.
Test entry/exit logic with advanced helper functions (market, limit, stop, sizing, cooldowns). You can iterate safely and observe results immediately.
Learning benefit: You can isolate one skill at a time—trend reading, momentum timing, volatility control, and execution precision—then combine them into a complete strategy.
Why it matters: Most charts only show outcomes. This simulator shows causes, which is exactly what you need to improve decision‑making.
Scalping is more than just fast trading; it is the process of understanding Market Microstructure. This simulator demonstrates how raw order book data is transformed into candles and technical indicators in real-time.
Why this simulator is different: You are not just watching random candles. Every tick is born from order book depletion, so you can see why price moves, not just that it moves.
Key strengths: practice reading liquidity shifts, test strategies with real‑time indicators, and build your own indicators and automated rules without external tools.
Watch bids/asks: thick levels act like magnets or barriers. When a level is fully consumed, price ticks to the next level.
Use trend indicators (SMA/EMA/VWAP) for direction, momentum indicators (RSI/MACD/Stoch) for timing, and volatility (ATR/BB) for risk.
Test manual or automated rules. Use limit orders for better fills, stop orders for protection, and helper functions for sizing.
After each run, check the trade log and indicator behavior. Adjust one rule at a time so you can see exactly what improved or worsened your results.
When market buy orders consume the entire liquidity at the Best Ask, price ticks upward to the next level.
When market sell orders deplete the Best Bid, price ticks downward to find new buyers.
Benefit: You learn how bids and asks absorb orders and why breakouts or reversals happen at specific price levels. This builds intuition that classic charts alone can’t teach.
Instant execution at the current price. Use when speed is more important than price.
Reserved orders that only fill if price crosses your limit. Use for precise entries and exits.
Protective orders that trigger when price crosses a level. Stop‑limit adds price control after the trigger.
Use orderQty to read the UI quantity, setOrderQty to change it, and riskQty to size by risk. This keeps your execution consistent and prevents accidental oversizing.
The indicators below are mathematical re-renderings of the trade data generated in the order book. Use overlays to guide trend direction, oscillators to gauge momentum, and volume tools to confirm participation.
SMA smooths price by averaging the last N closes. It shows the underlying trend and common support/resistance zones.
EMA weights recent prices more heavily, reacting faster to new order flow than SMA.
BB measure volatility around a moving average. Expanding bands = rising volatility; contracting bands = compression.
VWAP blends price and volume to show the average price where most volume traded.
RSI is a momentum indicator that measures the magnitude of recent price changes to evaluate overbought or oversold conditions.
MACD measures trend strength by comparing fast and slow EMAs, then smoothing with a signal line.
Stochastic compares the current close to the recent high-low range to detect momentum shifts.
CCI measures deviation from a moving average using typical price to spot cyclic turns.
ADX shows trend strength, regardless of direction. Higher values mean stronger, more directional moves.
ATR measures volatility by tracking the average true range of recent candles.
MFI blends price and volume to measure buying vs selling pressure.
ROC measures speed of price change over a set period.
Williams %R is a momentum oscillator scaled between -100 and 0, similar to Stochastic.
Volume bars show how much participation occurred during each candle.
OBV accumulates volume based on price direction, revealing whether volume supports the trend.
These are secondary metrics available in the custom indicator and auto-trade engines. They are not plotted by default but are powerful for filtering, confirmation, and risk control.
Fast and slow RSI versions plus the direction of RSI change. Use rsi7 for quick turns, rsi21 for trend context, and rsiSlope to detect momentum acceleration.
Short and long volatility baselines. atrPct expresses ATR as a % of price, useful for dynamic sizing and setting realistic targets.
smaDiff, emaDiff, ema10Slope, and sma20Slope capture spread and acceleration between averages. Great for early trend shifts.
In addition to MACD line, you can monitor macdSignal and macdHist to confirm whether momentum is building or fading.
The smoothed line (stochD) helps filter noisy %K spikes. Crosses of %K and %D often precede micro reversals.
bbWidth measures squeeze/expansion, while bbPctB shows where price sits inside the bands (0 to 1).
volSma5/20/50, volRel, and volChangePct quantify whether current volume is above normal and how fast it is changing.
priceAboveSma20, priceAboveEma20, closeAboveVwap, and trendUp provide quick regime checks for filters and stop logic.
The auto-trading engine can read and control the UI order size directly. This lets you size trades dynamically without hard-coding a quantity.
Pro Tip: Combine Indicators with the Order Book
Define: trend filter, trigger signal, and confirmation. Example: EMA trend + RSI dip + rising bids.
Define: profit target, stop, and invalidation. Example: sell at VWAP touch or stop below last swing.
Use fixed size, percent of equity, or risk‑based sizing. Keep consistency and avoid oversized positions.
Only take trades when all conditions align. If a condition fails, skip the entry. Discipline protects the account more than any single indicator.