Choose which Asian hours the range represents
This baseline uses GBPUSD on standard five-minute candles from one recorded TradingView provider. Define H and L as the highest high and lowest low of the 72 bars opening from 09:00 through 14:55 in Asia/Tokyo. Freeze them at 15:00 Tokyo, which is 06:00 UTC. This six-hour sample is a chosen reference window, not a claim to cover every Asian forex session.
- Reset the range for each new reference date. Require all 72 expected timestamps and valid OHLC values. Missing bars invalidate the day; do not carry yesterday's range forward or fill gaps with zero.
- Use 0.0001 as one pip for this GBPUSD example. Record the actual symbol minimum tick separately. A five-decimal quote can have several ticks per pip; do not apply this pip definition to JPY pairs or gold.
- Record the full symbol identifier, including its provider prefix. TradingView distinguishes composite forex data from individual broker feeds, and provider trading hours can differ. A range measured on one feed is not an execution quote from another.
- An alternative 00:00 to 07:00 London range is a different experiment: its UTC window changes in summer. Do not merge results from that definition into this Tokyo-anchored sample.
Keep the London window local through daylight saving
Use Europe/London for the 08:00 to 10:00 entry window and the London calendar date. TradingView documents that named IANA time zones follow offset changes, while a fixed UTC offset does not. Changing the chart display timezone does not change a script's calculation timezone. Both reference and entry calculations need their explicit zone.
- GOV.UK lists March 29 and October 25 as the 2026 clock-change dates. Check the trading days on both sides, even if the chart labels use your own local timezone.
- The gap between the frozen range and London entry is intentional. From 06:00 UTC through 08:00 London, reject the day if any completed five-minute close is strictly above H plus one pip or below L minus one pip. Include the bar that closes at 08:00; no entry can use it.
- Only bars opening at or after 08:00 London and closing strictly before 10:00 can trigger. The earliest trigger close is 08:05 and the last is 09:55. This leaves the next bar open inside the window under normal continuous data.
| Test date | Reference range in UTC | London entry window in UTC | Gap after range |
|---|
| January 15, 2026 | 00:00 to 06:00 | 08:00 to 10:00 (GMT) | 2 hours |
| July 15, 2026 | 00:00 to 06:00 | 07:00 to 09:00 (BST) | 1 hour |
| March 27 / March 30, 2026 | Unchanged | 08:00 / 07:00 start | 2 hours / 1 hour |
| October 23 / October 26, 2026 | Unchanged | 07:00 / 08:00 start | 1 hour / 2 hours |
Fix breakout confirmation and order prices
Require a weekday London date, an eligible calendar day, a complete reference range, and a range width from 10 through 60 pips inclusive. The buffer is one pip. These thresholds are illustrative test settings, not validated market defaults. Apply rejection checks before looking for the first signal.
- An exact touch of the buffered boundary fails the strict trigger. A wick beyond it with a close back inside does not enter; a later qualifying close can still count.
- Start flat; an unresolved earlier position blocks new entries. Use a fixed 10,000 GBP position for this comparison baseline, with sufficient capital and margin. Submit the protective stop and target with the entry, and verify their activation on the fill. Round stops away from the entry and targets toward it if a feed requires coarser ticks.
- With default bar-close strategy execution, a market order normally fills at the next available tick, usually the following bar open in historical testing. The target uses the trigger close, so a different fill changes the realized reward-to-risk ratio. Do not silently recalculate the target after a gap.
- If a missing bar delays a fill past 10:00, flag that session as a data-quality failure. Keep the execution record visible; it does not demonstrate a valid in-window trade. Audit gaps rather than claiming a hard live execution guarantee.
| Rule | Long | Short |
|---|
| Trigger | First eligible close C > H + 0.0001, with previous close <= H + 0.0001. | First eligible close C < L - 0.0001, with previous close >= L - 0.0001. |
| Entry | Submit a market buy after the trigger closes. | Submit a market sell after the trigger closes. |
| Stop S | L - 0.0001, fixed at submission. | H + 0.0001, fixed at submission. |
| Target T | C + 2 × (C - S), fixed at submission. | C - 2 × (S - C), fixed at submission. |
| Daily limit | One submitted entry across both directions. | No reversal or second entry after the first order. |
Define a failed breakout before inspecting outcomes
For this variation, a failed breakout is an entry followed by a close inside the original range, including either boundary, within the next three completed bars after the trigger. If the position remains open at that close, submit a market exit. The stop and target remain active until the exit fills. This definition is a rule for managing a trade, not evidence that stop orders were deliberately hunted.
- Count the first bar after the trigger as bar one, including the entry-fill bar. For an 08:10 trigger close, inspect closes at 08:15, 08:20, and 08:25. A return at 08:30 is outside this early-failure rule.
- Once these three bars pass, use only the fixed stop, target, and time exit. Submit a market exit at the first close at or after 12:00 London if the position remains open. Record the actual fill time and price.
- Allow no replacement entry after a failed breakout or stop. Count no-signal days, rejected days, submitted orders, and filled trades separately.
- If a candle spans both stop and target, OHLC alone does not reveal which came first. Inspect the emulator assumptions and finer intrabar data where available; do not choose the favorable outcome manually.
A hypothetical GBPUSD trade and its failure case
Assume H = 1.2740 and L = 1.2720. The 20-pip range passes the 10-to-60-pip filter. Assume a complete feed, no excluded holiday, no pre-window disqualification, and a previous close below the long trigger. All prices below are invented; they are arithmetic checks, not backtest results.
- Gaps, spread, commission, and slippage can increase the loss or reduce the gain. A stop is an order instruction, not a guaranteed maximum loss.
- If the range were 1.2740 minus 1.2735, its width would be five pips and the day would be excluded. A strong later move cannot override that recorded decision.
| Event | Calculation or observation | Result |
|---|
| 08:10 London close | C = 1.2742, above H + 0.0001 = 1.2741. | Submit the only entry for the day. |
| Frozen exits | S = 1.2719; C - S = 0.0023; T = 1.2742 + 2 × 0.0023. | Stop 1.2719; target 1.2788; reference risk 23 pips. |
| Next bar open | Assume fill E = 1.2743 before costs. | Actual stop distance 24 pips; target distance 45 pips; ratio 45/24 = 1.875. |
| Position arithmetic | 10,000 GBP × 0.0001 USD/GBP per pip. | USD 1 per pip; USD 24 loss at the stop price or USD 45 gain at the target price before costs. |
| Early failure alternative | At 08:20, close = 1.2738, inside [1.2720, 1.2740]. Assume the next exit fills at 1.2737. | Exit on the second monitored close: (1.2737 - 1.2743) × 10,000 = USD -6 before costs. |
| Wick-only alternative | 08:10 high = 1.2743, but close = 1.2739. | No entry from this bar, despite its high crossing the trigger. |
Exclude holidays and invalid ranges consistently
For this baseline, exclude every England and Wales bank holiday by London date using a saved calendar for each tested year. The GOV.UK calendar lists August 31, 2026 as a bank holiday, so that date is excluded even if the chosen forex feed prints candles. This is a research filter, not a claim that the entire forex market closes on UK holidays.
- Do not infer holidays from unusually low activity. Preserve the source calendar and its year with the run; weekday filters alone do not identify holidays.
- This baseline does not exclude scheduled economic releases. If a separate experiment adds a news filter, specify the event classes, timezone, exclusion interval, and historical calendar before selecting results.
- A fixed slippage assumption cannot reproduce variable bid/ask spreads around news or thin trading. Record spread treatment separately and run a stated higher-cost scenario.
| Case | Decision | Reason |
|---|
| August 31, 2026 | Skip and log holiday. | The saved England and Wales calendar excludes the date. |
| Range below 10 pips or above 60 pips | Skip and log width. | The baseline threshold was chosen before the outcome. |
| Range exactly 10 or 60 pips | Pass the width test only. | The endpoints are inclusive; all other filters still apply. |
| Flat range or fewer than 72 reference bars | Skip and log invalid data. | The reference is unusable or incomplete. |
| A qualifying pre-window close outside the buffer | Skip and log early break. | The first expansion happened before this entry protocol. |
Validate the baseline, then compare a small parameter set
Give Pine Script AI Coding Agent the full clock, range, calendar, trigger, and exit specification. Ask for visible timestamps and a rejection-reason log. Check the winter, summer, DST-transition, holiday, equality, and missing-bar cases before interpreting any profit figure. This page supplies the rulebook, not a downloadable strategy or a measured performance claim.
- Once the baseline matches, use Strategy Optimizer to compare exposed buffer inputs of 1 and 2 pips and minimum ranges of 10 and 15 pips: four combinations. Keep the 60-pip maximum, session clocks, feed, costs, and exits unchanged.
- Reserve later dates before choosing a setting, then evaluate the chosen rule on that untouched period. Keep the same holiday policy and include both GMT and BST coverage when the available sample permits.
- Import a supported TradingView trade-list CSV into Backtest Deep Report to inspect trade count, profit factor, equity drawdown, and individual trades. Review its capital and open-trade settings. The report cannot reconstruct rejected signals or fix an incorrect session clock from the CSV alone.
- Save script version, full symbol, chart interval, date ranges, calendar, parameters, position size, and execution assumptions. Compare counts and timestamped trades alongside aggregate metrics. Parameter search does not prove a tradable advantage or execute live orders.