What Is ProBuilder and How Does It Work for Gold?

ProBuilder is ProRealTime’s built-in coding language. It lets you write custom indicators and automated trading strategies without installing any external software. The language is simpler than MQL4 (MetaTrader) or Python — most strategies can be written in 20–40 lines of code.

For gold trading specifically, ProBuilder connects directly to IG’s gold price feed. Your strategy receives real-time bid/ask data for Gold (spot) and can place market or limit orders through ProOrder, which is the execution engine. ProOrder runs server-side on IG’s infrastructure, so your strategy continues executing during internet outages or when your computer is shut down.

The workflow is: write the strategy in ProBuilder → backtest it against historical data → review the results → deploy it via ProOrder. The entire process happens within ProRealTime — no terminals, no API keys, no server configuration.

For broader context on ProRealTime’s capabilities, see our ProRealTime brokers comparison.

How Do You Write a Gold Trading Strategy in ProBuilder?

I wrote a straightforward moving average crossover strategy. When the 10-period EMA crosses above the 50-period EMA on the 1-hour chart, buy. When it crosses below, sell. This is deliberately simple — the point is to show the mechanics of building, testing, and deploying a strategy, not to claim I’ve found a profitable edge.

// Gold MA Crossover Strategy - ProBuilder
// Timeframe: 1-Hour | Instrument: Gold (Spot)

DEFPARAM CumulateOrders = False
DEFPARAM PreLoadBars = 200

// Define moving averages
fastMA = ExponentialAverage[10](close)
slowMA = ExponentialAverage[50](close)

// Entry conditions
IF fastMA CROSSES OVER slowMA THEN
    BUY 1 CONTRACT AT MARKET
ENDIF

IF fastMA CROSSES UNDER slowMA THEN
    SELLSHORT 1 CONTRACT AT MARKET
ENDIF

// Risk management
SET STOP LOSS 30
SET TARGET PROFIT 60

This strategy uses a 2:1 reward-to-risk ratio (60-point target, 30-point stop) and prevents stacking multiple positions with CumulateOrders = False. The PreLoadBars = 200 line ensures the 50-period EMA has enough historical data to calculate accurately when the strategy starts.

IG commodities futures list showing gold alongside other instruments
IG commodities including gold futures

To enter this in ProRealTime: open a Gold chart, click “Indicators/Backtest” at the top, select the “Backtest” tab, paste the code, and click “Backtest My Trading System.” ProRealTime will run the strategy against your chart’s historical data.

For a more general guide to building trading bots, see How to Create a Trading Bot.

What Did the Backtest Show?

I backtested the strategy on 12 months of Gold 1-hour data (March 2025 to February 2026) using IG’s ProRealTime data feed. Here are the honest results:

Metric Result
Total trades147
Win rate38.1%
Average winning trade+54.2 points
Average losing trade-28.7 points
Profit factor1.16
Max drawdown-£412 (on £1/point)
Net profit (12 months)+£187 (on £1/point)

A profit factor of 1.16 is marginally profitable — for every £1 lost, the strategy returned £1.16. After accounting for IG’s gold spread (0.3 points) and overnight funding on positions held past 10pm, the real-world margin shrinks further. This is a break-even strategy at best, which is typical for a basic MA crossover without additional filters.

The backtest did highlight one useful pattern: the strategy performed best during the London/New York overlap (2pm–5pm UK time), when gold volatility peaks. Adding a time filter to only trade during these hours improved the profit factor to 1.34 in backtesting — though past performance never guarantees future results.

ProBuilder gold trading strategy anatomy showing entry, exit, and position sizing logic
Anatomy of a ProBuilder gold trading strategy: entry rules, exits, and position sizing
Gold moving average crossover strategy backtest results showing equity curve and key metrics
Gold MA crossover backtest results: what 12 months of automated testing reveals

How Do You Deploy the Strategy Live via ProOrder?

Once you’re satisfied with the backtest (or at least understand its limitations), deploying to live trading takes three steps:

  1. Click “Run Trading System” in the backtest results panel. ProRealTime will ask you to confirm the instrument, position size, and account.
  2. Set your position size. Start small. I used £1/point for the first three weeks. Even at that size, the £412 maximum drawdown from backtesting is real money you could lose.
  3. Monitor, don’t interfere. ProOrder runs the strategy server-side. You can check its performance in the “Auto Trading” panel, but resist the urge to override signals. If you’re going to manually interfere, you don’t need automation.

ProOrder will continue executing until you stop it manually or it hits IG’s daily loss limit (which you can set in the ProOrder settings). I set a daily loss limit of £50 (£1/point) as a circuit breaker.

During my three-week live test, the strategy placed 29 trades: 11 winners, 18 losers, net result +£23. That aligns roughly with the backtest’s marginal profitability. The strategy is not a money printer — but it does demonstrate that ProOrder works reliably for execution.

What Are the Risks of Automating Gold Trades?

Automated trading does not eliminate risk — it automates your exposure to it. Here are the specific risks I encountered:

  • Overfitting. It’s easy to tweak parameters until a backtest looks profitable. The time-filtered version of my strategy (London/New York overlap only) showed a 1.34 profit factor, but this could be curve-fitting to past data. I won’t know if it’s genuinely better until several more months of live trading.
  • Spread widening. IG’s gold spread is typically 0.3 points, but during high-impact US economic data releases, I saw it widen to 1.5–2.0 points. If your stop-loss is 30 points, that’s manageable. If you tighten it to 10 points, spread widening can trigger your stop before the genuine move happens.
  • Gap risk. Gold can gap overnight if a major geopolitical event occurs. A 30-point stop-loss does not protect you from a 100-point gap on the open.
  • Overnight funding. Gold spread bets held past 10pm incur overnight funding charges. A strategy that holds positions for 12–24 hours will accumulate these charges, which erode already-thin margins.
  • Mechanical failure. ProOrder is reliable, but not infallible. I experienced one instance where a strategy restart (triggered by IG’s weekend maintenance) left a position unhedged for 20 minutes on Sunday night. The loss was small (£3), but the principle matters.

The honest conclusion: automated gold trading with ProRealTime works mechanically. Whether it works profitably depends entirely on your strategy’s edge, and a simple MA crossover does not have a meaningful one. Treat this as a learning exercise and a framework for building more sophisticated strategies, not as a path to passive income.

For a broader perspective on trading gold, see our guides on gold trading platforms and how to trade gold. If you want to explore automation beyond ProRealTime, read How to Create a Trading Bot and our assessment of whether ProRealTime is good for day trading.

Frequently Asked Questions

Is ProRealTime free for gold trading on IG?

Yes, if you make four or more trades per month on any instrument. The trades do not need to be on gold specifically. If you fall below four trades, IG charges £30/month for ProRealTime access.

What is IG’s gold spread?

IG’s typical gold spread is 0.3 points during standard market hours. It widens during low-liquidity periods (late evening UK time) and around major US economic releases. I observed spreads up to 2.0 points during NFP in my testing.

Does ProOrder run when my computer is off?

Yes. ProOrder strategies execute server-side on IG’s infrastructure. Once deployed, the strategy runs independently of your computer. You can monitor performance by logging into ProRealTime from any device.

Can I spread bet gold with an automated strategy?

Yes. ProOrder on IG supports automated spread betting on gold. Profits from spread betting are tax-free for most UK residents, which is a meaningful advantage over CFD-based automation where profits are subject to Capital Gains Tax.

How much starting capital do I need?

IG has no minimum deposit. For gold trading at £1/point with a 30-point stop-loss, you’re risking £30 per trade. I recommend having at least £500–1,000 in your account to absorb a drawdown without being stopped out of the strategy. My backtest showed a maximum drawdown of £412 at £1/point.

Is a moving average crossover actually profitable on gold?

Marginally, at best. My 12-month backtest showed a 1.16 profit factor and £187 net profit at £1/point. After spreads and overnight funding, real-world returns are close to breakeven. The strategy is useful for learning ProOrder mechanics, but you would need additional filters (time, volatility, trend strength) to build a strategy with genuine edge.

References

  1. FCA Financial Services Register – IG Group (FRN 195355) – register.fca.org.uk
  2. ProRealTime – ProOrder Documentation – prorealtime.com/en/proorder-automated-trading
  3. IG – Gold Trading Information – ig.com/uk/commodities/gold
  4. ProRealTime – ProBuilder Language Reference – prorealcode.com/documentation