Gold Balance Breakout
Each morning at the 08:20 ET day-session open it checks whether gold has been "in balance": the value areas (where 70 % of the day-session volume traded) of the last two sessions overlap, and their combined high-low range is not wide compared with the average daily range.
- Market
- gold futures only - COMEX GC and MGC (full-size and micro), MCX GOLD and GOLDM.
- Runs on
- GC1! or MGC1! (or MCX GOLD / GOLDM), 5-minute chart (required).
Free on request during the launch period.
Open on TradingViewThe rules, in full
- Value area of a session = the price zone holding 70 % of its 08:20-13:30 ET volume, built tick by tick outward from the busiest price.
- Balance test at 08:20 ET: the value areas of the last 2 full sessions overlap, and BH - BL is at most 1.5 x ADR20. BH / BL = highest high / lowest low of those 2 sessions between 08:20 and 13:30 ET. ADR20 = average 08:20-13:30 ET range of the prior 20 full sessions. Holiday and incomplete sessions are left out. If the test fails, there is no trade that day.
- Signal: the first 5-minute bar from 08:20 ET that ends by 12:00 ET with its LOW above BH (long) or its HIGH below BL (short). Only the first such bar counts. One trade per day.
- Entry: market order on the next bar's open.
- Close stop: if a 5-minute bar closes 0.35 x U or more against the entry price, the trade is closed at the next bar's open. U = median full-session (18:00-17:00 ET) range of the prior 20 full sessions.
- Band exit: Bollinger band of 5-minute closes (20 bars, 2 standard deviations). After the first close outside the band in the trade's direction (long: above the upper band), the first close back inside exits at the next bar's open.
- Hard stop: a resting stop 2 x U from the entry (emergency only).
- No fixed target. Any trade still open is closed at 16:10 ET.
- If U or ADR20 is not available, or today's data start after 08:15 ET, the day is skipped.
That is the whole rule set, exactly as published. Nothing is held back for subscribers.
What you see on the chart
- Green ▲ LONG label below the signal bar or red ▼ SHORT label above it (hover for the bar, levels, estimated entry and stops). Optional signal-bar highlight.
- Balance high and balance low lines (08:20-13:30 ET) on days the balance test passed, and light blue shading while the signal window is open.
- In a trade: white entry line, red close-stop line with a light red zone, and an orange line for the band that triggers the band exit. The balance, entry and close-stop lines are named with their price at the right edge. There is no target line because the rule has no fixed target.
- "EXIT +/- pts" label at each exit; hover for the reason (Stop (close), Band exit, Stop (hard), Time exit 16:10 ET, Session end) and the trade P/L after commission.
- Compact status box (top right by default): the symbol and how it was read (gold futures, or spot / CFD gold or gold ETF if you have overridden the market lock); state (WAITING, SETUP, ENTERING, SIGNAL when "Enable trading" is off and no order is placed, IN LONG / IN SHORT with entry time and close stop or "EXIT next bar" once an exit order is sent, DONE, NO TRADE today, or OFF on a symbol that is not gold futures or an unsupported timeframe); balance levels or the reason the day was skipped; signals on chart, Strategy Tester trades and days loaded, or a short yellow note. If you override the lock onto a non-futures symbol, an extra orange row warns you what to check first. Hover a row for more.
- The ▲ LONG / ▼ SHORT label sits on the signal bar; the Strategy Tester's entry is on the next bar (its open). The entry line, close-stop line, label tooltip ("Filled ...") and EXIT labels use the Strategy Tester's actual fill prices.
- Banner in the middle of the chart: red on any symbol that is not gold futures (no orders unless "Allow orders on other symbols" is on), orange when the chart is not 5-minute (no signals).
Alerts
1. Open a 5-minute GC or MGC chart and add the strategy.
2. Create Alert: Condition = this strategy, then "alert() function calls only". TradingView calls this a technical alert, and a free Basic account cannot create one - Basic allows 3 price alerts and no technical alerts at all, so the Create Alert dialog will not let you save it. Essential is the lowest plan that works (20 technical alerts); Plus 100, Premium 400. On Essential and Plus an alert also expires after two months and has to be created again; on Premium and Ultimate it does not expire. Phone notifications themselves are free on every plan - tick "Notify on app" and have the TradingView app installed and signed in on the same account.
3. Each message is one short line: what happened and at what price first, then the exchange and ticker, then the rest, separated by "|". Nothing else to read.
ARMED on COMEX:GC1! | LONG above 3886.0 | SHORT below 3840.0 | until 12:00 ET
LONG 3886.9 on COMEX:GC1! | close SL 3858.4 | hard SL 3724.9 | no TP | flat 16:10 ET | fills next open
LONG 3887.1 on COMEX:GC1! | close SL 3858.6 | hard SL 3725.1 | no TP | filled
EXIT 3904.2 on COMEX:GC1! | back inside the band | +17.10 pts | fills next open
EXIT 3904.5 on COMEX:MGC1! | Band exit | +17.40 pts | position 0
The exchange and ticker are in every line, so if you run it on both GC and MGC you can still tell them apart at a glance. Alerts are per chart: create one on each symbol you want watched.
4. Messages fire once per bar close. Four toggles in the Alerts group: the LONG / SHORT signal, the entry fill, the EXIT, and the optional "ARMED" message at 08:20 ET (off by default). An EXIT decided by the close stop or the band rule is sent on the bar that decides it ("fills next open"); the exit the broker actually filled is sent with the real price and the resulting position. Signal and ARMED alerts also fire when "Enable trading" is off, but not on unsupported symbols unless "Allow orders on other symbols" is on.
5. FREE BASIC PLAN - the "Price alert" row. A Basic account cannot create the alert in step 2 at all, so the status box prints a "Price alert" row instead: the balance high and low while the day is armed, "none yet" before the 08:20 ET check and after the day is done.
Those numbers go into ordinary price alerts on the SYMBOL (Alt+A, Condition = GC1! or MGC1! and not the strategy, operator "Crossing", tick "Notify on app"), which Basic does allow - three of them, and editing one does not use up another.
It rings when price reaches the level, not when the strategy trades: the rule still needs a whole 5-minute bar to close outside the balance, so it will sometimes ring on a day with no trade. Treat it as "look at the chart now". The setup is two-sided, so it needs two alerts.
Settings
- Enable trading: off = levels, signals, labels and alerts only, no orders.
- Allow orders on other symbols (off by default). The script reads the symbol's contract root together with its instrument type, so it knows gold futures from spot / CFD gold, from a bullion ETF, from a gold mining share - and places orders only on gold futures. Turn the override on only to experiment elsewhere; the status box then tells you what it thinks the symbol is and what you still have to set yourself.
- Balance setup and Exit groups: 2 sessions, 1.5 x ADR20, ADR from 20 sessions, 70 % value area, 12:00 ET last signal bar, 0.35 x U close stop, 2 x U hard stop, band 20 x 2, 16:10 ET hard close, U from 20 sessions within 40 days. These are the defaults the strategy is designed around; changing them changes the strategy.
- Alerts (one toggle per message type), Display Options (lines, labels, shading, status box position, dark/light theme) and Colors.
- Show details: adds the two value areas, ADR20 and the range check, U and stop sizes, the exit rule and the window to the status box.
- Properties default to 100,000 USD initial capital, 1 contract, no pyramiding, 1.20 commission per contract per side (a micro-futures figure), 1 tick slippage and 5 % margin. Enter your own commission, especially for full-size GC.
Limits, and what this cannot do
- Market orders fill at the next bar's open plus 1 tick, the hard stop on touch (also plus 1 tick); Pine estimates the price path inside each bar; results on chart bars can differ from live fills.
- The 08:20-13:30 ET session, the 12:00 ET window end and the 16:10 ET hard close are wall-clock New York times, and the balance test needs that whole session on the chart. That is the reason the market lock stays on gold futures.
- Value areas are built from the chart's 5-minute bars and volume, so they can differ by a few ticks from a tick-by-tick volume profile; on borderline days this can change whether the balance test passes.
- The first 2-3 days on the chart never trade (the balance test needs 2 full prior sessions). A missing bar between 08:20 and 13:30 ET makes that session not count.
- ADR20 and U come from 10-minute data of the chart's own symbol (for example GC1! / MGC1!). On a continuous chart, around a contract roll the two prior sessions can be in the old contract, which shifts the value areas and the balance high / low; turning on back-adjustment for contract changes in the chart settings keeps them in the same terms.
- Early-close days use the normal 16:10 ET hard close; any trade still open when a new session starts is closed at the open of that session's second bar ("Session end").
- The script only sees its own trades.
Educational tool. Not financial advice. Past behaviour does not predict future results.
Before you decide
The script page on TradingView carries TradingView's own Strategy Tester report, generated by TradingView from this script. We do not write those numbers and we do not repeat them here. Read them at the source: Gold Balance Breakout on TradingView.