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)
| Time (IST) | Summer | Winter | What it means for a scalper |
|---|---|---|---|
| London open | 12:30 | 13:30 | Volume picks up; the Asian range often breaks |
| London–New York overlap | 17:30 – 21:30 | 18:30 – 22:30 | The busiest stretch of the day for gold |
| US data (payrolls, inflation) | 18:00 | 19:00 | Spreads widen and the price can jump; many scalpers stand aside |
| Daily rollover | 02:30 | 03:30 | Spreads widen and many brokers pause gold for about an hour; don't scalp it |
| Asian session | Morning | Morning | Gold 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
20 EMA 50 EMA
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 | |
|---|---|
| Entry | 4,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.
| Cost per trade (per ounce) | Share of the $1.86 risk | Share of the $2.79 target | Win rate needed to break even |
|---|---|---|---|
| None (the chart's view) | 0% | 0% | 40% |
| $0.20 | 11% | 7% | 44% |
| $0.35 | 19% | 13% | 48% |
| $0.50 | 27% | 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
- A hard stop for the day. Three trades, then stop. At 0.5% risk that caps a bad day at about 1.5%. The danger in scalping is often less one bad trade than the tenth trade of a bad day.
- No revenge trades. After two losses in a row, take a break before the next signal.
- Stand aside for big news. Payrolls, US inflation and Fed decisions move gold several dollars in seconds. Check the economic calendar every morning.
- Every trade gets a stop when it's placed. Gold can move against you faster than you can react.
- Keep a journal. Scalpers take many trades, and memory is selective. A simple trading journal shows which hours and setups actually pay.
Common mistakes
- Forex-sized lots on gold. One lot of gold is 100 ounces. Always size from the stop with the gold lot size calculator.
- Scalping the quiet hours. In the Asian morning gold often drifts, the spread is a bigger share of the move, and signals are weaker.
- Ignoring the higher timeframe. A 5-minute pullback against the 15-minute trend is often the start of a reversal.
- Moving the target further after entry. On a 5-minute chart, stretching the target often turns winners into break-even trades.
- 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.
- Open the chart. On TradingView, open XAUUSD on the 5-minute chart.
- 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".
- 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.
- 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.
- 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.