Gold M15 Signal Engine
with H4 Trend Filter
This indicator detects intraday entry setups on the 15-minute chart and attaches a complete, pre-calculated trade frame to each one: an entry, a stop-loss and three targets. It then tracks that setup bar by bar and reports what actually happened to it.
On the chart
Every signal appears with its entry, stop and three targets, and its outcome is marked on the chart — target reached or stop hit.
Open the interactive chart on TradingView →
Why it differs from a standard signal script
Most published signal scripts stop at the arrow. They mark an entry and leave the trader to guess the rest. Three design choices separate this one.
1. Every signal ships with its own risk frame
The stop-loss is derived from the structural level that produced the signal, not from a fixed pip distance, and is then capped by a percentage-of-price ceiling so a single wide candle cannot create an unreasonable stop. The first target is ATR-based. The second prefers a real support or resistance level detected on the chart, and only falls back to an ATR multiple when no suitable level exists — so targets sit where price is actually likely to react.
2. The higher timeframe has a veto
A 4-hour EMA200 trend filter gates every signal. A long is only permitted when the 4-hour close is above its own EMA200, and a short only when it is below. This removes the most common failure mode of intraday signal scripts: firing counter-trend entries during a strong higher-timeframe move.
3. Signals report their own outcome
Once a signal is active the script follows it. It marks the bar where each target was reached, moves the displayed stop to breakeven after the first target and to the first target after the second, and hides the setup once the stop is hit. Setups that neither complete nor fail within a configurable number of bars are marked expired rather than left on the chart indefinitely.
How the signal engine works
Three independent detection paths can produce a signal. All must additionally pass the RSI gate, the higher-timeframe filter and a cooldown period.
- EMA pullback. In an aligned trend, price wicks into the EMA20 and closes back on the trend side of it. The candle must close in the outer 55% of its own range, which filters out indecisive bars.
- Support and resistance reaction. Price tests a detected level within a 0.15% tolerance and closes back on the correct side, with the same candle-strength requirement.
- N-bar breakout. Price closes beyond the highest high or lowest low of the previous N bars with a directional close.
Support and resistance levels are built from confirmed pivot highs and lows. A minimum-gap rule prevents clustered levels from stacking, and the number of active levels on each side is capped.
Reading the panel
The panel shows the direction of the active signal, its entry, the current stop, all three targets, the bar it was created on, its live status, and the current 4-hour trend state. The status line progresses through: active, first target reached with the stop moved to entry, second target reached with the stop moved to the first target, complete.
Limitations — please read
- It runs on the 15-minute timeframe only. On any other timeframe it draws a warning and produces nothing. The thresholds were tuned for 15-minute gold behaviour and do not transfer.
- It was tuned on gold. Tolerances, ATR multipliers and RSI bounds reflect how XAU/USD moves. On other instruments the defaults will need adjustment.
- Signals are evaluated on confirmed bars only, so the script does not repaint — but a signal appears at the close of its bar, not during it.
- Target and stop levels are calculated when the signal fires and are not recalculated. If volatility changes after entry, the levels do not adapt.
- When both the stop and a target fall inside one bar's range, the stop is resolved first. Real intrabar sequence may have differed.
- It does not know about scheduled news. Economic releases routinely produce moves that invalidate technical setups.
- This is an analysis tool, not a trading system. It does not account for spread, commission, slippage or position sizing.
Originality
The three detection paths use well-known building blocks — EMAs, RSI, ATR, pivot-based levels. The original work is in how they are combined: a structural stop bounded by a percentage ceiling, a second target that prefers real chart levels over a fixed multiple, a higher-timeframe veto applied uniformly across all three paths, and a per-signal outcome tracker with automatic stop progression and expiry.
No performance claim. This publication makes no claim about win rate or profitability, because no such claim can be substantiated for future market conditions. We did measure it on a limited sample and published the figures with their limits on the method page, along with the full measurement code.