Structure Break Trend Filter
- 지표
- 버전: 1.1
- 활성화: 10
Structure Break Trend Filter marks swing highs and lows, draws every break of market structure (BOS and CHoCH) and shows a signal arrow only when the break goes in the direction of an established trend on a higher timeframe.
Most structure indicators show every break. Many of them are against the larger trend and end up as noise. This indicator keeps the full picture on the chart, but highlights only the breaks that agree with the higher timeframe, and only when that trend has existed for a while.
How it works
A swing high is a bar whose high is the highest of N bars on each side; a swing low is the opposite. A break happens when a bar closes beyond the last unbroken swing. A break in the same direction as the previous one is labeled BOS, a break that changes direction is labeled CHoCH.
A signal arrow is shown when all of the following are true:
- the break is in the direction of the trend on the trend timeframe;
- the trend has lasted at least the set number of bars of the trend timeframe;
- there is an opposite swing to place a stop behind, and it is not closer than the set fraction of ATR(14).
The trend is taken from the last bar of the trend timeframe that closed before the signal bar closed, so the indicator does not look into the future. The suggested stop is drawn as a short dashed line behind the opposite swing.
Signals do not repaint. A signal is calculated only after the bar has closed and is never changed afterwards. Swing points appear N bars after the swing bar, because that is when the swing is confirmed.
Trend filter modes
- EMA cross: fast EMA above or below slow EMA on the trend timeframe (default 50/200 on H4), with a minimum trend age.
- Close vs EMA: close of the trend timeframe above or below the fast EMA (for example D1 and EMA 50 for H2 charts).
- Off: arrows on every break.
If the trend timeframe is not higher than the chart timeframe, the indicator uses the first standard timeframe at least four times the chart timeframe instead (for example H4 for H1, D1 for H4, W1 for D1).
Alerts
Popup, push notification, email and sound. An alert is sent once, on the close of the signal bar.
For Expert Advisor developers
Buffers available through iCustom: 0 buy arrow price, 1 sell arrow price, 2 stop level, 3 swing high, 4 swing low, 5 signal direction (+1 buy, -1 sell, 0 none), 6 ATR(14). Empty values are EMPTY_VALUE. Input group headers count as parameters in iCustom.
Inputs
- Structure: swing strength (bars on each side).
- Trend filter: mode, trend timeframe, EMA fast, EMA slow, minimum trend age in bars of the trend timeframe.
- Signal: minimum stop distance in ATR(14).
- Drawing: BOS/CHoCH lines, swing points, number of history bars for lines, colors.
- Alerts: popup, push, email, sound, sound file.
Notes
The default settings (swing 3 on H1, H4 EMA 50/200, trend older than 30 bars, minimum stop 0.3 ATR) are the settings we use on gold. The indicator works on any symbol and timeframe; the settings may need adjustment for other markets. The indicator does not open trades. Past signals on the chart do not guarantee future results.

