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

Order-Flow Simulator

Indicator Code Examples

10+ advanced indicator formulas you can paste into the Custom Indicator box.

Each example returns a price‑scaled value (so it overlays cleanly on the price chart). You can paste one formula at a time.

Example 1 — VWAP Pullback Line

Tracks a blend of price and VWAP to smooth pullbacks while staying near the price scale.

// VWAP Pullback Line
return (vwap * 0.7) + (close * 0.3);

Example 2 — EMA Trend Blend

A weighted blend of EMA10 and EMA20 to create a responsive trend line.

// EMA Trend Blend
return (ema10 * 0.6) + (ema20 * 0.4);

Example 3 — ATR‑Weighted Price

Shifts price by volatility to highlight expansion moves.

// ATR-Weighted Price
return close + (atr14 * 0.5 * bodyDir);

Example 4 — Momentum‑Adjusted SMA

Adds momentum (MACD histogram) to SMA20 for faster response.

// Momentum-Adjusted SMA
return sma20 + (macdHist * 0.8);

Example 5 — RSI‑Bias Midline

Tilts the midline higher when RSI is bullish and lower when RSI is weak.

// RSI-Bias Midline
const bias = (rsi14 - 50) / 100;
return close + (atr14 * bias);

Example 6 — Volume‑Weighted Close

Boosts the close when volume is above average, dampens when below.

// Volume-Weighted Close
const vBoost = Math.max(0.5, Math.min(1.5, volRel));
return close * vBoost;

Example 7 — Bollinger Percent‑B Price

Projects where price sits within Bollinger Bands and maps it back to price scale.

// Bollinger Percent-B Price
if (bbUpper === null || bbLower === null) return close;
return bbLower + (bbWidth * bbPctB);

Example 8 — Trend Strength Line

Combines EMA spread and slope to show trend strength as a price overlay.

// Trend Strength Line
const strength = (emaDiff * 2) + (ema10Slope * 5);
return close + strength;

Example 9 — Mean Reversion Anchor

Anchors to HLC3 and pulls toward it when price is stretched.

// Mean Reversion Anchor
const stretch = (close - hlc3);
return close - (stretch * 0.6);

Example 10 — Wick Rejection Line

Moves the line toward the wick that shows stronger rejection.

// Wick Rejection Line
const wickBias = (upperWickPct - lowerWickPct) / 100;
return close - (atr14 * wickBias);

Example 11 — Stochastic‑Weighted Price

Uses Stochastic to bias price higher or lower based on momentum position.

// Stochastic-Weighted Price
const kBias = (stochK - 50) / 50;
return close + (atr14 * 0.3 * kBias);

Example 12 — OBV Drift Overlay

Adds OBV slope to price to highlight volume‑driven drift.

// OBV Drift Overlay
const drift = Math.tanh((obv / Math.max(1, volSma20)) * 0.01);
return close + (atr14 * drift);