PipLedger
Today's forex newsNFP, CPI, FOMC and other high-impact eventsEconomic calendarCalendar →

XAUUSD scalping strategy: 5-minute rules for gold, with a free Pine Script

Scalping gold means taking small, quick trades on the 1- or 5-minute chart and getting out within minutes. XAUUSD suits it because it moves a lot and trades heavily in London and New York hours, but its costs eat small targets fast. This guide gives a complete 5-minute strategy: a trend filter, a pullback entry, an ATR stop, daily limits, the hours in IST, a worked example and a free TradingView script.

By M. A. Horaira. Updated 5 October 2026. 12 minute read.

The rules at a glance

  • Chart: XAUUSD on the 5-minute chart, with a 20 EMA and a 50 EMA
  • Trend filter: longs only when the 20 EMA is above the 50 EMA and the 15-minute chart's close is above its own 50 EMA; shorts the other way round
  • Entry: a candle dips to the 20 EMA and closes back above it as a bullish candle (bearish and below for a short)
  • Stop loss and target: 1 × the 14-period ATR from the entry; target 1.5 × the risk
  • Hours: 8 a.m. to 5 p.m. London time: 12:30 to 21:30 IST in summer, 13:30 to 22:30 IST in winter
  • Limits: 0.5% risk a trade and at most 3 trades a day

What scalping gold involves

A scalper holds a trade for minutes, aims for a few dollars of movement on gold, and may trade several times a session. Because each trade is small, two things decide whether it works: the costs on every trade, and the discipline to stop. The scalping guide covers the style in general. This page is one specific, testable way to do it on XAUUSD.

Gold is popular with scalpers for good reasons. It moves several dollars in minutes during London and New York hours, it trends cleanly on many days, and most brokers and prop firms offer it. The catch is that one lot of gold is 100 ounces, so a $1 move is $100 a lot. Position size mistakes cost more on gold than on most forex pairs.

Why this strategy buys pullbacks, not breakouts

On a 5-minute chart, gold breaks small highs and lows constantly, and many of those breaks reverse straight away. Buying the breakout puts you in near the top of the move with a stop that has to sit well below it. Waiting for the price to pull back to the 20 EMA in an uptrend gets you in at a better price, with a stop that's tight because the trend's support is right there. You'll miss the moves that never pull back, and you'll still get caught when a pullback becomes a reversal; the trend filter and the stop handle that.

The rules, step by step

1. Confirm the trend on two timeframes

On the 5-minute chart, the 20 EMA must be above the 50 EMA for a long. On the 15-minute chart, the last closed candle must be above its 50 EMA. If the two disagree, there's no trade. For a short, both must point down.

2. Wait for the pullback to the 20 EMA

The signal candle trades down to the 20 EMA (its low touches or goes below the line) and closes above it, as a bullish candle. That's the trend's support holding. For a short, the high reaches the 20 EMA and the candle closes below it, bearish.

3. Enter at the close, stop 1 ATR away

Enter as the signal candle closes. The stop goes one 14-period ATR away from the entry. The ATR measures how far gold is actually moving at that time of day, so the stop is wider when gold is fast and tighter when it's quiet. The target is 1.5 × the risk.

4. Only in the main hours

Trade only between 8 a.m. and 5 p.m. London time. The script closes any trade still open when the window ends.

5. Three trades a day, then stop

At 0.5% risk, three losing trades cost 1.5% of the account. That's a bad day you can shrug off. The script stops taking signals after three trades.

When to scalp gold from India (IST)

Summer is British Summer Time for London times and US daylight time for US times. In 2026 the UK changes clocks on 25 October and the US on 1 November. In the week between (26 to 30 October), London times use the winter column while US times stay on summer: data at 18:00 IST, the rollover at 02:30 IST and the overlap from 17:30 IST.
Time (IST)SummerWinterWhat it means for a scalper
London open12:3013:30Volume picks up; the Asian range often breaks
London–New York overlap17:30 – 21:3018:30 – 22:30The busiest stretch of the day for gold
US data (payrolls, inflation)18:0019:00Spreads widen and the price can jump; many scalpers stand aside
Daily rollover02:3003:30Spreads widen and many brokers pause gold for about an hour; don't scalp it
Asian sessionMorningMorningGold often moves slowly; signals are weaker

For most traders in India, the overlap in the evening is the practical window: it's the busiest part of the day for gold and it comes after office hours. More on this in the best time to trade gold.

Worked example: one 5-minute scalp

Target 4,281.15Entry 4,278.36Stop 4,276.50Pullback to the 20 EMA1.5R

20 EMA 50 EMA

Illustrative chart drawn for this guide to show the rules. It isn't a real day's prices. XAUUSD, 5-minute candles. The 15-minute trend check isn't drawn.

Gold is in an uptrend, with the 20 EMA above the 50 EMA. A candle dips through the 20 EMA and closes above it at 4,278.36, a bullish candle. The 14-period ATR is $1.86, so the stop goes at 4,276.50 and the 1.5R target at 4,281.15.

XAUUSD long
Entry4,278.36
Stop loss (1 ATR)4,276.50, $1.86 away (18.6 pips at $0.10 a pip)
Target (1.5R)4,281.15, $2.79 away
Account and risk$10,000, risking 0.5% = $50
Lot size$50 ÷ ($1.86 × 100 ounces) = 0.268, rounded down to 0.26 lots
Loss if the stop is hit$48.36
Profit at the target$72.54

Here the target is hit 20 minutes later. With a stop and target this close, many scalps are decided within minutes. The table leaves out costs, and on a trade this small they matter a lot, as the next section shows.

What costs do to a gold scalp

Every trade pays the spread, and many accounts add a commission. On a swing trade with a $20 stop that's a rounding error. On a $1.86 stop it isn't. The table uses example round-trip costs per ounce; check your own broker's.

Break-even win rate = (risk + cost) ÷ (risk + target). With no costs, a 1.5R strategy breaks even at 40%.
Cost per trade (per ounce)Share of the $1.86 riskShare of the $2.79 targetWin rate needed to break even
None (the chart's view)0%0%40%
$0.2011%7%44%
$0.3519%13%48%
$0.5027%18%51%

At 50 cents a trade, the same strategy needs to win about half its trades just to break even. That's why the trading window skips the thin hours, when spreads are wider, and why it's worth putting your real costs into the backtest before you believe any result. The scalping calculator works this out for your own numbers.

Daily rules that keep a scalper in the game

Common mistakes

  1. Forex-sized lots on gold. One lot of gold is 100 ounces. Always size from the stop with the gold lot size calculator.
  2. Scalping the quiet hours. In the Asian morning gold often drifts, the spread is a bigger share of the move, and signals are weaker.
  3. Ignoring the higher timeframe. A 5-minute pullback against the 15-minute trend is often the start of a reversal.
  4. Moving the target further after entry. On a 5-minute chart, stretching the target often turns winners into break-even trades.
  5. Trading through the news. Stops can fill well past their level when gold jumps.

Backtest it yourself on TradingView

This page doesn't quote a win rate or a profit figure, and you should be wary of anyone who does without showing the test. Results change with the market, the dates, the data feed and the costs you put in. The honest way is to run the test yourself, and the free script below does the work in a couple of minutes.

  1. Open the chart. On TradingView, open XAUUSD on the 5-minute chart.
  2. Add the script. Open the Pine Editor from the Pine icon in the panel on the right of the chart (older layouts have it as a tab under the chart), delete the code that's already there, paste this strategy's code and click "Add to chart".
  3. Put in your costs. Open the strategy's settings and go to Properties. Enter your broker's commission and a little slippage. A test without costs flatters every strategy, and short-term ones most of all.
  4. Read the Strategy Tester. The panel under the chart shows the net profit, the maximum drawdown, the profit factor, the number of trades and a list of every trade. Click a few trades and check on the chart that each one follows the rules. Trade sizes are shown in units rather than lots: 100,000 units is one lot of a forex pair, and 100 ounces is one lot of gold.
  5. Change one setting at a time. Start with the costs, because they decide this strategy. Then try the ATR multiple for the stop (0.8 to 1.5), the target (1 to 2R), the trading window and the 15-minute trend filter, and compare the 5-minute chart with the 1-minute.

As a rough guide, don't trust a result with fewer than 100 trades, a profit factor under 1 once costs are in, or a drawdown you couldn't sit through with real money. Settings tuned to look good on one stretch of history often fail on the next, so check the same settings on dates you didn't tune them on, then demo trade the strategy for a few weeks.

The script sizes each trade from the stop loss and your risk percentage, starts with $10,000 and assumes 1:100 leverage (a 1% margin setting), so the tester doesn't flag margin calls on normal forex trade sizes. Change these under Properties to match your account. By default TradingView fills orders at the open of the candle after the signal, so the fill can differ a little from the signal candle's close. On a 5-minute chart the stop and target are only a few dollars apart, so both can sit inside one candle. The tester then has to assume which was hit first, so treat trades decided inside a single candle with suspicion. TradingView's intrabar option in the strategy's Properties (called Bar Magnifier, and Bar detalization in newer versions; it needs a higher-tier plan) uses lower-timeframe data to reduce this.

Download the free Pine Script and PDF

The script is written in Pine Script version 6 for this guide and follows the rules above. It can't read the economic calendar, so skipping news days is up to you. It's free to use, change and share. The PDF is a one-page cheat sheet with the rules, the hours in IST, a worked example and a checklist, to keep next to your chart.

Show the code (Pine Script v6, 77 lines)
//@version=6
// XAUUSD Scalping strategy by PipLedger (https://pipledgerfx.com/xauusd-scalping-strategy)
// 5-minute EMA pullback scalp in the direction of the 15-minute trend, during London and New York hours.
// Free to use and change. For education and backtesting only; not financial advice.
strategy("PipLedger: XAUUSD Scalping (EMA pullback)", shorttitle="Gold Scalp", overlay=true, initial_capital=10000, pyramiding=0, default_qty_type=strategy.fixed, default_qty_value=1, margin_long=1, margin_short=1, currency=currency.USD)

// ---------- Inputs
fastLen   = input.int(20, "Pullback EMA", minval=2)
slowLen   = input.int(50, "Trend EMA (chart timeframe)", minval=5)
htf       = input.timeframe("15", "Higher timeframe for the trend")
htfLen    = input.int(50, "Trend EMA on the higher timeframe", minval=5)
atrMult   = input.float(1.0, "Stop loss (x ATR 14)", minval=0.2, step=0.1)
rr        = input.float(1.5, "Target (R multiple)", minval=0.5, step=0.25)
sess      = input.session("0800-1700", "Trading window (London time)")
tz        = input.string("Europe/London", "Session time zone")
maxTrades = input.int(3, "Maximum trades a day", minval=1)
riskPct   = input.float(0.5, "Risk per trade (% of equity)", minval=0.1, maxval=5.0, step=0.1)

// ---------- Helpers
fx = strategy.convert_to_account(1.0)  // one unit of the chart's quote currency in account currency (1 on USD-quoted charts)
calcQty(float entry, float stop) =>
    float dist = math.abs(entry - stop)
    dist > 0 and not na(fx) ? strategy.equity * riskPct / 100 / (dist * syminfo.pointvalue * fx) : 0.0

emaF     = ta.ema(close, fastLen)
emaS     = ta.ema(close, slowLen)
atr      = ta.atr(14)
htfEma   = request.security(syminfo.tickerid, htf, ta.ema(close, htfLen)[1], lookahead=barmerge.lookahead_on)
htfClose = request.security(syminfo.tickerid, htf, close[1], lookahead=barmerge.lookahead_on)

upTrend    = emaF > emaS and htfClose > htfEma
dnTrend    = emaF < emaS and htfClose < htfEma
touchLong  = low <= emaF and close > emaF and close > open
touchShort = high >= emaF and close < emaF and close < open

inSess = not na(time(timeframe.period, sess, tz))
// the candle that closes as the window ends: no new trades on it, and open trades are closed at its close
winEnd  = timestamp(tz, year(time, tz), month(time, tz), dayofmonth(time, tz), int(str.tonumber(str.substring(sess, 5, 7))), int(str.tonumber(str.substring(sess, 7, 9))))
lastBar = inSess and time_close >= winEnd
d      = dayofmonth(time, tz)
newDay = d != d[1]

var int trades = 0
if newDay
    trades := 0

longSig  = upTrend and touchLong and inSess and not lastBar and trades < maxTrades and strategy.position_size == 0
shortSig = dnTrend and touchShort and inSess and not lastBar and trades < maxTrades and strategy.position_size == 0

// ---------- Orders
if longSig
    float sl = close - atr * atrMult
    float tp = close + (close - sl) * rr
    float q  = calcQty(close, sl)
    if q > 0
        strategy.entry("Long", strategy.long, qty=q)
        strategy.exit("Long exit", "Long", stop=sl, limit=tp)
        trades += 1

if shortSig
    float sl = close + atr * atrMult
    float tp = close - (sl - close) * rr
    float q  = calcQty(close, sl)
    if q > 0
        strategy.entry("Short", strategy.short, qty=q)
        strategy.exit("Short exit", "Short", stop=sl, limit=tp)
        trades += 1

if strategy.position_size != 0 and (not inSess or lastBar)
    strategy.close_all(comment="Outside the trading window")

// ---------- Chart
plot(emaF, "Pullback EMA", color=color.new(color.orange, 0), linewidth=2)
plot(emaS, "Trend EMA", color=color.new(color.gray, 0))
bgcolor(inSess ? na : color.new(color.gray, 92), title="Outside the trading window")
plotshape(longSig, "Long pullback", shape.triangleup, location.belowbar, color.teal, size=size.small)
plotshape(shortSig, "Short pullback", shape.triangledown, location.abovebar, color.red, size=size.small)

Trading this from India

The rules work on any gold chart, and TradingView's XAUUSD chart is a fine place to learn and backtest them. To trade gold legally from India, though, use MCX gold futures, including the smaller Gold Mini and Gold Petal contracts, through a SEBI-registered broker. Trading XAUUSD as a CFD with an offshore forex platform isn't allowed for residents under FEMA. MCX gold trades into the late evening, which covers the London and New York hours in this guide. The contract is priced in rupees, and the script's stop and target come from the ATR, so it needs no pip setting. The full picture is in is forex trading legal in India and XAUUSD market timings in India.

More strategies with free Pine Scripts: London breakout, break and retest, liquidity sweep, 9 and 21 EMA crossover.

Quick answers

What is the best time to scalp gold in India?

The London–New York overlap, 17:30 – 21:30 IST in summer and 18:30 – 22:30 IST in winter, is the busiest stretch for gold and suits most traders in India because it's in the evening. The London open, at 12:30 or 13:30 IST, is also active. Avoid the minutes around big US data releases and the daily rollover.

Which timeframe is best for XAUUSD scalping?

The 1-minute and 5-minute charts are the most common. This strategy uses the 5-minute chart for entries and the 15-minute chart for the trend, which gives fewer, less noisy signals than the 1-minute chart.

How much money do I need to scalp gold?

At 0.01 lot, a $1 move in gold is $1. With a stop of about $1.86, 0.01 lot risks $1.86, so at 0.5% risk per trade the smallest account that fits is about $372. On a faster day with a $4 stop it's about $800. With less than that, even the smallest trade risks more than 0.5%.

What is a good stop loss for gold scalping?

One that matches how much gold is moving at the time. That's why this strategy uses one 14-period ATR rather than a fixed number of dollars: in the example it was $1.86, but on a fast day it can be much wider.

Is gold scalping profitable?

For some traders it is, but costs, slippage and the number of decisions make it one of the hardest styles. A strategy that looks good on a chart can lose money once spreads and commissions are in. Backtest with your real costs and demo trade it before using real money.

Can I scalp gold on a prop firm account?

Many prop firms allow scalping, but some restrict very short trades, high-frequency trading or trading around high-impact news. Read your firm's rules on trade duration and news before you start, especially if you plan to automate the strategy.

More guides

All 46 guides →

हिंदी में पढ़ें: Lot size kaise nikale?, Prop firm challenge kaise pass kare?, Gold trading kaise kare?, Forex trading kya hai, और India में यह legal है या नहीं?

Trading psychology

The habits that decide whether a good strategy makes money.

All 14 trading psychology guides

8 popular prop firms

Well-known firms for forex, gold and index traders that were still operating in 2026. Compare their rules before you buy a challenge.

If a link in this list is a referral link, PipLedger may earn a commission if you sign up, at no extra cost to you. This list is not a recommendation. Programs, prices and rules change often, so check each firm's own site, including its margin and drawdown rules, before you buy a challenge.