Asia 5m
Session00:00–06:00 GMT+1
Rangemax(O,C) – min(O,C)
Fib calclow + range × level
Confluencetoday vs yesterday
SL base1.5 × 5m ATR
Monday 30m
RangeFull Monday body H/L
Measurement30m candle bodies only
Confluencecurr Mon vs prev Mon
On MondayUses prev week levels
SL base1.5 × 30m ATR
⬡ Real hit detection — 5m bar wicks determine whether price reached each level
? Configuration guide — what every setting does
Data & API
Pair
The instrument being tested. This matters beyond just the symbol — it controls the pip size used throughout the engine. EUR/USD and GBP/USD use 0.0001 per pip, JPY pairs use 0.01, and Gold (XAU/USD) uses 1.0. Getting this right ensures confluence distances, SL sizes, and P&L calculations are all in correct pip terms for that instrument.
Lookback
How many weeks of historical bars to pull from Twelve Data and run the backtest over. More weeks means more trades and more statistically meaningful results, but uses more of your 800 daily API calls. 8 weeks is a good starting point. 24 weeks gives you a proper sample across different market conditions. Note: each run uses 1–2 API calls regardless of lookback length because bars are fetched in a single request up to the 5000-bar limit.
Method
Which of the two strategies to run. Asia 5m uses the 00:00–06:00 GMT+1 session body range on 5-minute bars, projecting fib multiples above and below. Monday 30m uses the full Monday candle body high/low on 30-minute bars, comparing this week's Monday against last week's. Both runs them together so you can compare them side by side in the breakdown tables — useful for seeing which method carries more edge on a given pair.
Bar timeframes — what is actually fetched
The backtester fetches two timeframes from Twelve Data: 5m bars for the Asia session method and 30m bars for the Monday range method. No 15m bars are used.
Note on the 15m question: the original lesson description mentioned pulling Monday ranges on a 15-minute chart. When the actual Pine Script indicator code was checked, it uses request.security(syminfo.tickerid, "30", ...) — 30-minute bars — for all Monday body high/low tracking. The 15m reference in the lesson was either an approximation or an earlier version of the indicator. The backtester matches the actual indicator source, so 30m is correct.
Why fib extensions are multiples — the core concept
The indicator does not use traditional Fibonacci retracement levels (0.618, 0.382 etc). Instead it repurposes the fib tool as a range projector. The Asia session body range — say it measures 12 pips — becomes the unit of measurement. That 12 pips is then projected forward repeatedly into price space above and below the session boundary:
1× = 12 pips beyond Asia high/low — one full session range extended
2× = 24 pips — two full ranges
3× = 36 pips — three full ranges, and so on
So a 2× level means price has traveled twice the distance of the entire Asia session from the session boundary. These are exhaustion zones — structural levels where the market has extended significantly and may run out of momentum. They are forward projections of today's volatility, not historical statistical measures.
Min ATR distance from open
Filters out confluence levels that are too close to where price currently is. If a level sits less than 0.5× ATR from the bar's open, there isn't enough room between entry and the SL to make the trade viable — the stop would need to be inside the noise. Default 0.5× ATR. Set to 0 to trade all levels regardless of proximity. Raise to 1.0× to only trade levels with meaningful distance from current price.
Replaces the old min/max fib filter — proximity to price is a more structurally sound filter than which fib multiple a confluence happens to fall at.
Level re-entry
Controls how many times the same confluence level can be traded in a single day. Once only — the level is locked after the first touch regardless of outcome. Twice — allows one re-entry after price has left the level and returned. Unlimited — every valid approach to the level is a trade.
Re-entry mechanics: after a trade exits (TP, SL, BE-stop, or EOD), the level is marked as "not cleared." A re-entry only fires once price has moved at least 0.5× ATR away from the level — confirming it genuinely left the zone. The direction check still applies on re-entry, so price must approach from the correct side. The trade log shows a # column — 1 = first entry, 2 = re-entry, highlighted in orange so you can filter re-entry performance separately.
The unlimited setting is useful for testing the theoretical max — but in practice a level that's been stopped through twice in a day is probably in a trending move and shouldn't be faded a third time. The kill switches act as the backstop regardless.
Confluence — the indicator's signal tiers
Signal filter
Maps directly to the three line colours on the TradingView indicator. Tight only (green lines) — today's fib level and yesterday's are within 10% of the pip threshold of each other. If threshold is 2 pips, tight means within 0.2 pips. These are the highest conviction setups — two independent session projections landing almost exactly on the same price. Fewest signals, highest expected edge. All confluence (orange + green) — includes both tight and normal overlaps within the full pip tolerance. All levels — trades every fib extension regardless of confluence, useful as a baseline to measure how much the confluence filter is actually adding.
Confluence threshold (pip)
The tolerance window for calling two extension levels "confluent." If today's 2.5× level lands at 1.08420 and yesterday's 2.5× level lands at 1.08435, the difference is 1.5 pips — within the 2 pip threshold, so they're marked confluent. 2 pips is the lesson's specification for EUR/USD and is the indicator's default. Tightening to 1 pip gives fewer but cleaner confluences. Widening to 3 pips gives more signals but some overlaps will be loose.
Important: the engine also applies a cap — if the range is very small, confluence distance is capped at 50% of the minimum fib gap to prevent adjacent levels from falsely merging. This matches the indicator's exact logic.
Tight threshold % of main
Defines what separates a "tight" (green line) confluence from a "normal" (orange line) one. At 50% of a 2 pip threshold, tight means the two session levels are within 1 pip of each other. At 10%, tight means within 0.2 pips — very few confluences will qualify. The default is 50% which gives a meaningful split between the two tiers. Raise toward 100% to classify more confluences as tight; lower to make tight very selective. The Signal filter "Tight only (green)" will only trade levels flagged as tight or triple — so if this threshold is too low, almost nothing passes and the trade count drops to near zero.
The indicator uses 10% as its visual default because on screen you want to highlight only the very sharpest alignments. For backtesting, 50% is more useful — it gives enough tight signals to measure performance meaningfully.
Trade management
Min SL (pips)
A floor on the stop loss regardless of what the ATR calculation produces. If the 5m ATR on a very quiet Asian session comes out at 3 pips, the system would set SL at 4.5 pips (1.5 × 3). The minimum SL of 7 pips overrides that to prevent stops so tight they get hit by normal bid/ask noise. Raising this reduces trades in very low volatility conditions. The SL is always calculated on the same timeframe as the method — 5m ATR for Asia trades, 30m ATR for Monday trades.
Risk per component (%)
What percentage of the account is risked on each individual trade signal. At 0.25%, if both an Asia level and a Monday level fire on the same day, up to 0.5% is at risk before kill switches engage. This value flows directly into the kill switch calculation — raising it means you hit daily/weekly limits faster. At 0.75% risk you'd hit the default 2% daily kill in just 3 consecutive losses instead of 9.
The equity curve and P&L figures in the results are illustrative — they show the shape of performance but the actual account impact depends on your real position sizing.
ATR period (bars)
How many bars to use when calculating the Average True Range for stop loss sizing. The ATR is always measured on the matching timeframe — 5m bars for Asia method, 30m bars for Monday method. Shorter periods (5–8) make the SL more reactive to recent volatility, widening in active sessions and tightening in quiet ones. Longer periods (20–50) smooth that out for more consistent stop sizes across conditions. 14 bars is the indicator's default.
Volatility regimes
Regimes are determined automatically from the daily pip range at the time of each trade — you don't set them manually. They change two things: the break-even partial trigger (the R-multiple at which the engine locks in profit and takes a partial) and the SL/TP sizes (which scale automatically because they're ATR-based).
High vol: BE at 2.0R — market is moving freely, give it room before locking in
Med vol: BE at 1.5R — standard conditions
Low vol: BE at 1.0R — compressed market, protect profit sooner as extensions are harder to sustain
Kill switches
Circuit breakers that stop trading once losses hit a threshold within a period. They reset automatically — daily at midnight London, weekly on Monday, monthly on the 1st. Each switch is independent: hitting the daily limit doesn't reset the weekly counter.
Daily %: tightest switch — fires most often, protects against a bad single day
Weekly %: catches runs of bad days that individually stayed under the daily limit
Monthly %: hardest stop — once hit, no more trades for the rest of the calendar month
The Kill% column in the regime breakdown shows what percentage of trades in that category were immediately preceded by a kill switch firing — useful for identifying which conditions tend to cluster into the losing runs that trigger them. You can adjust all three thresholds freely in the sidebar.
How real hit detection works
This version replaces probabilistic simulation entirely with actual 5m price data. No random numbers are used for hit detection or trade outcomes.
Step 1 — Hit detection: for each fib extension level, every 5m bar in the entry window (07:15–20:00 London) is scanned. A level is hit when a bar's wick crosses the fib price — bar high for short setups, bar low for long setups. If price never reaches the level that day, no trade is recorded.

Step 2 — Outcome walk: from the touching bar, the engine walks forward bar by bar checking SL and TP against real highs and lows. Break-even fires once price reaches beR × SL distance, moving the stop to entry + 1 pip. Exit is at SL, TP, BE-stop, or 22:00 London EOD — whichever comes first.

Step 3 — Exit types: TP (full target hit), SL (stopped out before BE), BE (moved to breakeven then stopped), EOD (open at session close). These appear in the trade log and fib breakdown table.
The entry direction (short vs long) is determined by whether the level is above or below the Asia range midpoint — the correct structural logic. The one remaining limitation: 5m OHLC bars don't tell you the intrabar sequence of high vs low. If a bar has both its high and low beyond your SL and TP, the engine assumes TP was hit first (slightly optimistic). Real tick data would resolve this ambiguity but is behind a paywall on all providers.
Trade management
One open trade at a time
While a trade is running, no new entries fire on any level. This prevents opposing trades on the same level (e.g. a short still open when a long fires on re-entry) and stops over-trading in general. The market is "locked" from entry bar until the exit bar — TP, SL, BE-stop, or EOD — then the next bar is free to enter any level.
This is the correct simulation of real trading — you would not open a second position while managing the first. The single-trade lock means oscillation trades within a ranging session are not captured, but it prevents the unrealistic stacking of losses that would occur with multiple simultaneous positions.
TP buffer before next level (pips)
The take profit is set at the next confluence level in the trade direction, minus this buffer. For a short from SD2.50, if the next confluence below is SD-1.50 @ 1.16520, the TP fires at 1.16520 + 0.00050 = 1.16570 (5 pips above the level). The buffer prevents the trade running all the way to the next level where price may bounce before fully reaching it. Set to 0 to exit exactly at the level price.
The TP always targets a confluence level — not just any SD level. If no confluence exists beyond the entry in the trade direction, the fallback ATR multiple is used instead (shown as ATR in the trade log TP basis column).
Re-enter at confluence after TP
When a TP fires (price reached X pips before the next confluence level), this setting pre-clears that confluence level's re-entry state so it's immediately available as the next trade entry. The trade lock releases one tick early, and the confluence level the TP was targeting becomes the first candidate for the next bar's entry walk — no distance-cleared check required.
Example: Short from SD2.50, TP at SD-1.50 + 5 pip buffer. When TP fires, the engine immediately makes SD-1.50 available as a long entry. If the next 5m bar touches SD-1.50, a long fires — going the other direction back toward the sell zone above. This is the chain-trading behaviour where each confluence level acts as both the TP for the current trade and the entry for the next.
Turn this off for a more conservative model where each trade is fully independent — the standard 0.5×ATR cleared distance must be satisfied before the same level can be re-entered.
Level re-entry (once / twice / unlimited)
Controls how many times the same confluence level can trigger an entry in a single day. Once — the level is locked after the first touch regardless of outcome. Twice — allows one re-entry after price has left the level (0.5×ATR cleared) and returned. Unlimited — every valid approach fires a trade, subject to the single-trade lock.
The # column in the trade log shows entry number per level per day — 1 = first entry, 2+ = re-entry, highlighted in orange. Compare first-entry vs re-entry win rates to see whether re-entries add or subtract edge.
Entry window
Trades only fire during this London-time window. Asia session levels are established at 06:00 and the default entry window opens at 06:00 to capture the London open move immediately. All bars outside this window are ignored for entry purposes — the walk-forward outcome logic still uses them for SL/TP detection.
SD level filter
The checkbox grid lets you include or exclude specific SD levels from trading. All levels are checked by default — every fib from SD-10.50 to SD+10.50 is eligible. Untick any level that is consistently losing across your backtest runs.
Ext only preset — ticks SD≥1.50 and SD≤−1.00, the pure extension zones outside the Asia range. These are the levels where price has genuinely overextended and exhaustion is most likely.

Inside-range levels (SD0.25, SD0.50, SD0.75) — tradeable on ranging days where price oscillates within the Asia session without breaking out. Direction is context-dependent: the bar's open relative to the level determines whether it's a short or long approach.

The SD leaderboard at the bottom of results shows win%, net pip, and P&L per SD level — use it to identify which specific levels are profitable and untick the losers.
Momentum scoring
An optional pre-entry filter that scores each touch bar on three independent components before firing a trade. Only fires if the score meets the minimum threshold (default: 2 out of 3). All three components are computed from the 5m bars already in memory — no additional API calls needed.
① Bar deceleration — the last N bars before the touch are getting progressively smaller. Price arriving at a sell level on shrinking bars suggests momentum is fading, increasing the probability of a reversal. Score +1 if true.

② Wick rejection — the wick that touched the level is ≥ X% of the full bar range. A large rejection wick (e.g. upper wick = 40% of bar range at a sell level) is the most direct price action signal that the level pushed back. Score +1 if true.

③ Rate of change — price moved ≥ X × ATR in the last N bars before the touch. Confirms the move into the level was meaningful — not a slow drift but a real push. Score +1 if true.
The Mom column in the trade log shows each trade's score (0–3) colour-coded: green=3, orange=2, red=1. Compare score=3 vs score=1 win rates after running to validate whether each component is genuinely adding edge. Turn off components that don't improve results without affecting the others.
No data yet
Enter your Twelve Data API key in the sidebar,
select a pair and lookback period, then run.