S T O C K G A M E P R O

Ultimate Simulation

HTS WORKSPACEDrag modules onto the board
ABOUT
Drag or click modules to create windows.
Drag the grid to move. Zoom the grid with your wheel. Drag modules from the palette to place them.
Blank Trading Floor Drag modules from the palette to build your HTS layout.

Simulator Overview

STOCK GAME is a real-time trading simulator designed to teach price action, indicators, and execution flow.

Build your own indicator formulas and connect them directly to automated trading logic.

  • Indicator coding: write custom formulas and visualize results instantly.
  • Strategy sandbox: create auto-trading rules and test them safely.
BALANCE$50,000.00
HOLDINGS0 EA
UNREALIZED P/L$0.00
TOTAL RETURN 0.00%
Equity$1,000.00
PRICE$10.00
UP / DOWN RATE (START PRICE) +0.00%
RESET
TRADE LOG
ORDER QTY
Order size exceeds available quantity.
LIMIT PRICE
GAME DIFFICULTY 3
SPIKE FREQUENCY 2%

Adds short, sudden bursts of volume to the tape. Higher values increase how often spikes appear (not their size), making momentum shifts faster and more erratic. Set to 0 for smooth, steady flow.

BUY / SELL FLOW

BUY 0 SELL 0 BIAS 50%

Histogram + curve follow live engine ticks and your pressure settings. To adjust, go to Pressure Lab.

REAL-TIME RETURN CURVE

LIVE
Equity$1,000.00
Return0.00%
Drawdown0.00%

AUTO TRADING PROFIT CHECK

OFF
Auto Equity$1,000.00
Return0.00%
Realized P/L$0.00
Trades0
Win Rate0%
Max Drawdown0.00%
Auto verification isolates auto-only trades. Manual mix: 0
For more detailed explanations, please visit the Guide page.

Full Variable & Auto-Trading Reference

All indicator and auto-trade variables are listed below. The Custom Indicator panel expects price-scale outputs.

Index & Time

  • t: normalized bar position (0-1)
  • i: bar index
  • time: bar timestamp bucket

OHLCV

  • open, high, low, close, vol
  • prevOpen, prevHigh, prevLow, prevClose, prevVol
  • prev2Open, prev2High, prev2Low, prev2Close, prev2Vol

Candle Structure

  • range, rangePct, body, bodyPct, bodyDir
  • isBull, isBear, isDoji
  • gap, gapPct, gapDir
  • upperWick, lowerWick, upperWickPct, lowerWickPct
  • hlRangePct, closePos, hl2, hlc3, ohlc4, typical

Returns & Range

  • change, changePct, logReturn, trueRange
  • atr7, atr14, atr21, atrPct

Moving Averages

  • sma5, sma10, sma20, sma50, sma100
  • ema5, ema10, ema20, ema50, ema100
  • smaDiff, emaDiff, ema10Slope, sma20Slope
  • priceAboveSma20, priceAboveEma20, trendUp

Momentum

  • rsi7, rsi14, rsi21, rsiSlope
  • roc12, stochK, stochD
  • macdLine, macdSignal, macdHist

Volume & Bands

  • vwap, obv, closeAboveVwap
  • volSma5, volSma20, volSma50, volChange, volChangePct, volRel
  • bbUpper, bbMiddle, bbLower, bbWidth, bbPctB

Arrays & Helpers

  • data, opens, highs, lows, closes, vols
  • sma, ema, highest, lowest, sum, avg, std

Auto-Trading Variables & Pro Syntax

Portfolio

  • balance, holdings, avgPrice, price
  • equity, pnl, returnRate, positionValue
  • lastTrade: { type, price, qty, time }

Order Helpers

  • orderQty, setOrderQty(qty)
  • buyOrderQty(), sellOrderQty()
  • buy(qty), sell(qty), hold()
  • buyMarket(qty), sellMarket(qty)
  • buyLimit(price, qty), sellLimit(price, qty)
  • buyStop(stop, qty, limitPrice?), sellStop(stop, qty, limitPrice?)
  • buyPct(pct), sellPct(pct)
  • buyValue(amount), sellValue(amount)
  • riskQty({ riskPct, stopPct, price, equityValue })

Execution Control

  • cooldown(key, ms): true when allowed, then sets timer
  • oncePerBar(key): true once per candle index
  • mem: persistent memory object
  • ctx: { now, barIndex, barTime, tick, mem }

Order Types (Market / Limit)

Market orders execute immediately at the current price. Limit orders are reserved and fill only when price crosses the limit; filled limit/stop orders show a (LIMIT)/(STOP) tag in the trade log and a toast notification.

// Manual buttons: BUY MKT / SELL MKT / BUY LIMIT / SELL LIMIT
// Auto-trade example:
if (rsi14 < 30) buyMarket(3);
if (holdings > 0 && rsi14 > 70) sellLimit(price * 1.01, 2);

Tip: Use mem to store strategy state (e.g., mem.mode = 'trend').

// Example (advanced auto trade)
if (oncePerBar('entry') && cooldown('rsi', 4000) && rsi14 < 30 && trendUp > 0) {
  const qty = riskQty({ riskPct: 1, stopPct: 1.5 });
  if (qty > 0) buy(qty);
}
if (holdings > 0 && (macdHist < 0 || priceAboveEma20 === 0)) {
  sellPct(50);
}
if (!mem.lastTick) mem.lastTick = ctx.tick;
// Example (order types)
// Enter on breakout, then protect with stop or stop-limit.
if (oncePerBar('entry') && cooldown('brk', 3000) && closeAboveVwap === 1) {
  buyStop(price * 1.01, 5);
}
// Scale out using a limit if price stretches.
if (holdings > 0 && rsi14 > 70) {
  sellLimit(price * 1.02, 3);
}
// Optional: stop-limit instead of stop-market
if (holdings > 0 && rsi14 < 45) {
  sellStop(price * 0.985, 5, price * 0.98);
}