Gold Futures Pine Script Strategy for Prop Firms
GC and MGC bring high volatility, a near-24-hour session, and a tick value that scales cleanly onto a micro-sized evaluation account. Here's how to build and automate a gold futures strategy for a prop firm eval.
Why gold futures work well for prop firm algos
Gold futures on COMEX combine a few traits that make them a reasonable fit for automated prop firm trading:
- High average daily range — GC typically covers 15–30+ points in a session, giving a strategy room to capture a move that clears spread and commission with profit left over.
- Near around-the-clock access — gold trades from Sunday evening to Friday afternoon ET with only a short daily maintenance break, opening more windows than an equity-only instrument allows.
- Session-structured behavior — the London open tends to set the first directional push, and the New York overlap brings the day's cleanest volume and signal quality.
- A micro contract — MGC is 1/10th of GC, giving precise sizing across account sizes from $10k up.
- Lower correlation to equity index futures — running a gold strategy alongside an ES or NQ strategy adds some diversification at the account-portfolio level.
GC vs. MGC — which contract for prop firm sizing
Contract selection is the single highest-leverage decision when setting up a gold futures strategy for a prop firm account — getting it wrong is a common way to burn through a drawdown buffer on a handful of trades.
GC — standard gold futures
GC is priced in dollars per troy ounce over a 100-ounce contract. Each point of movement is worth $100/pt, and the minimum tick ($0.10/oz) is worth $10.00. A 10-point adverse move — a routine swing during the London/NY overlap — costs $1,000 on a single contract. On a $2,500 trailing drawdown account, that's 40% of the entire buffer gone on one trade. That's overleveraged for most evaluation sizes.
MGC — micro gold futures
MGC is exactly 1/10th of GC — $10/pt per point, $1.00 per tick. The same 10-point move costs $100 on one contract, which is manageable even on a $10k evaluation. MGC is the right default for most evaluation accounts, with room to scale up contract count as the account grows or proves consistent.
Contract selection by account size
| Account Size | Drawdown Buffer | Recommended Contract | Guideline Risk/Trade (~2%) |
|---|---|---|---|
| $10,000 | $1,000 | MGC | ~$20 (2 points) |
| $25,000 | $1,500 | MGC × 2–3 | ~$50 (5 points × 1 MGC) |
| $50,000 | $2,500–$3,000 | MGC × 3–5 | ~$100 (5 points × 2 MGC) |
| $100,000+ | $5,000+ | 1 GC or MGC × 8–10 | $200–$500 target range |
Gold trading sessions and when to trade
Gold responds to order flow out of Asia, Europe, and North America across the day — knowing which windows to trade, and which to skip, is one of the highest-leverage decisions for an automated strategy.
London open — roughly 3:00am–5:00am ET
European desks come online and typically produce the day's first significant directional push. Volume is decent but not peak. Strategies here tend to look for breaks out of the overnight Asian range; European data releases can also produce sharp, low-warning reversals.
New York overlap — roughly 8:00am–11:30am ET
This is the strongest window for gold automation — London and New York are both active, spreads tighten, and scheduled US data (CPI, PPI, NFP, FOMC) routinely drives the day's largest moves. A session filter restricting entries to this window is the most common configuration for a GC/MGC Pine Script strategy. Volume and signal quality both fall off noticeably once the window closes.
Afternoon NY session — roughly 1:00pm–5:00pm ET
Volume ticks up slightly but gold often consolidates or mean-reverts here. Most strategies are already flat by early-to-mid afternoon to avoid drift into the day's settlement and the gap risk that can follow at the Sunday reopen.
Asian session — roughly 6:00pm–2:00am ET
Thin, choppy, and prone to reversing sharply at the London open. Automated strategies should sit this window out entirely and carry a hard flatten rule well before it begins.
Key Pine Script parameters for GC/MGC strategies
ATR-based stop losses
Gold's daily range moves a lot with the news calendar — a quiet day might cover 8 points, an FOMC or CPI day 40+. A fixed-point stop is either too tight on quiet days or too wide on volatile ones; an ATR-based stop scales with whatever the market is actually doing.
// ── ATR stop sizing for gold futures ──────────────────────────────
atrLen = input.int(14, "ATR Length")
atrMult = input.float(1.5, "ATR Multiplier", step = 0.1)
atrVal = ta.atr(atrLen)
stopPoints = atrVal * atrMult
// Dollar risk per contract — set the multiplier to match your instrument:
mgcRiskDollars = stopPoints * 10 // MGC: $10/point
gcRiskDollars = stopPoints * 100 // GC: $100/point At an ATR of 3 points on a 15-minute chart and a 1.5× multiplier, the stop works out to 4.5 points — $45 per MGC contract or $450 per GC contract. Tune the multiplier against your drawdown buffer and risk tolerance.
Session time filter
// ── Session filter — New York overlap only ────────────────────────
inSession = not na(time(timeframe.period, "0800-1130", "America/New_York"))
longCondition = buySignal and inSession
shortCondition = sellSignal and inSession
// Flatten on session end or day change
closeAll = ta.change(time("D")) or not inSession Point value — set correctly for accurate backtests
In TradingView's Strategy Properties, the point value must match the contract or backtested P&L will be meaningless:
- GC (full-size): contract size 100 troy oz. 1 point = $100/pt. Set "Contract size" to 100.
- MGC (micro): contract size 10 troy oz. 1 point = $10/pt. Set "Contract size" to 10.
// Declared directly in Pine Script v5 for MGC:
strategy("MGC Range Expansion", overlay = true, default_qty_type = strategy.fixed,
default_qty_value = 1, commission_type = strategy.commission.cash_per_contract,
commission_value = 0.85) Daily loss circuit breaker
On a firm with a published daily loss limit — Topstep's $1,000 on the 50k — a strategy needs to track intraday P&L and halt new entries once the threshold is approached. On a firm without a daily cap (Apex, for example), the same logic is still good practice as a self-imposed guard rail:
// ── Daily circuit breaker ──────────────────────────────────────────
dailyLossLimit = input.float(-800, "Daily Loss Limit ($)", maxval = 0)
var float dayStartEquity = na
if ta.change(time("D"))
dayStartEquity := strategy.equity
dayPnl = strategy.equity - dayStartEquity
tradingAllowed = dayPnl > dailyLossLimit Prop firm rules most relevant to gold trading
Overnight position policy
Most futures prop firms don't outright prohibit overnight gold positions, unlike some equity-index-only rule sets. Holding overnight still exposes the account to gap risk at the next session's open, so most automated strategies close all gold positions by mid-to-late afternoon regardless of the firm's specific policy — the gap risk usually isn't worth the potential overnight drift.
Margin considerations
Intraday margin on MGC runs a small fraction of GC's — check your broker's current margin schedule, since it varies by broker and moves with volatility. Position sizing should be driven by risk as a percentage of the drawdown buffer, not by how many contracts margin technically allows — margin availability isn't a risk limit.
News event handling
CPI, PPI, NFP, and FOMC releases can move gold 20–50+ points within seconds. A news filter that disables entries for a short window before and after scheduled high-impact releases avoids the worst of the slippage and whipsaw that these events produce — losses during that window often reflect news risk rather than a flaw in the strategy itself.