The chaos semafor indicator marks swing points at three separate depths on one chart. Each depth runs the same fractal test with a different window. Yellow dots catch small turns, aqua dots catch intermediate ones, and magenta dots appear only at swings that hold across a long stretch of bars. Reading all three together shows you which turns are noise and which are structure.
This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.
| Platforms | MT4 (.ex4) + MT5 (.ex5) |
|---|---|
| Chart window | Main price chart |
| Plots | 6: L1 Up, L1 Down, L2 Up, L2 Down, L3 Up, L3 Down |
| Alerts | popup |
| Inputs | 5 |
What the Chaos Semafor Indicator draws on the chart
L1 Up and L1 Down put small yellow dots above and below the shallowest fractals.
L2 Up and L2 Down use aqua at a wider window, drawn thicker and further from price.
L3 Up and L3 Down use magenta for the deepest swings, the thickest of the three and furthest out.
Nothing appears between the dots. There is no connecting line and no zone.
- L1 Up: arrow, yellow, width 2, arrow code 233
- L1 Down: arrow, yellow, width 2, arrow code 234
- L2 Up: arrow, aqua, width 3, arrow code 233
- L2 Down: arrow, aqua, width 3, arrow code 234
- L3 Up: arrow, magenta, width 4, arrow code 233
- L3 Down: arrow, magenta, width 4, arrow code 234

How the Chaos Semafor Indicator calculates its values
One fractal test, three windows
A helper called IsFractalHigh checks whether a bar’s high beats every high within a half-window on both sides. IsFractalLow does the same for lows. The three levels differ only in the number they pass in: `L1Bars`, `L2Bars` or `L3Bars`. Reusing that single test is why the levels nest cleanly, since any bar passing the deep test also passes the shallow one.
Stacking the levels visually
Without separation the dots would sit on top of each other, so the code scales the offset per level. L1 uses offset, L2 uses offset * 2.0 and L3 uses offset * 3.0, where offset comes from `OffsetPips` through the point size. Width also steps up from 2 to 3 to 4, so you read depth at a glance.
Writing or clearing each bar
The code assigns every buffer on every bar. A bar that passes the test receives a price. A bar that fails receives EMPTY_VALUE. Nothing persists, so a dot describes that bar and its neighbours only, and the chart never carries an old level forward.
How to read the signals
A magenta dot sharing a bar with yellow and aqua dots is the strongest agreement the tool can show.
Clusters of yellow dots without deeper confirmation mark chop rather than a turn.
Vertical spacing is presentation, not price. All three dot types refer to the same candle high or low.
Because the test looks both ways, the deepest dots confirm well after the bar that formed them.
Alert channels in this build: popup, one message per closed bar.
Alerting means a single terminal popup under `EnableAlerts`, which defaults to `true`. It announces a newly confirmed fractal on the close of the bar rather than while the bar forms, and the guard permits one message per closed bar.
Every Chaos Semafor Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
L1Bars |
Level 1 fractal half-window (5-bar swing -> 2 each side). Half-window for the shallowest level, default `2`, the classic five-bar swing. | 2 |
L2Bars |
Level 2 fractal half-window (15-bar swing -> 7 each side). Half-window for the middle level, default `7`, giving a fifteen-bar swing. | 7 |
L3Bars |
Level 3 fractal half-window (40-bar swing -> 20 each side). Half-window for the deepest level, default `20`, a forty-bar swing. Raise it on fast timeframes to keep magenta dots rare. | 20 |
OffsetPips |
Dot offset from price (in pips). Base gap between dot and candle, default `1.0` pip, doubled and tripled for the deeper levels. | 1.0 |
Alert settings
| Setting | What it does | Default |
|---|---|---|
EnableAlerts |
Alert on new fractal close. | on |

Settings that fit your chart
The three windows count bars, so what they represent depends entirely on the chart. EURUSD H1 is the reference capture, where 20 bars either side of a magenta dot covers most of two trading days. On M5 that same setting spans under three hours and the deep dots stop meaning major swings. Scale the numbers up as you drop down in timeframe.
When the Chaos Semafor Indicator fails
Confirmation lags by design. A magenta dot cannot print until 20 further bars pass without a higher high, so the deepest signal also arrives latest.
A strong one-way trend yields very few dots on the side you care about, because the fractal test needs bars on both flanks.
Two bars with identical highs both fail the test, since the comparison uses greater-or-equal, so an exact double top can go unmarked.
Copy the compiled Chaos Semafor Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.
Background reading on the method behind the Chaos Semafor Indicator: Billion Dollar Day on Wikipedia, Trendtrading at Investopedia.
Download the Chaos Semafor Indicator for MT4 and MT5
The zip holds the compiled Chaos Semafor Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.
Download this indicator free
Enter your email and the file is yours. You also get the full MT4 and MT5 library.
FAQ
Why do the L1, L2 and L3 dots sit at different distances from the candle?
So you can tell them apart when they land on the same bar. The code multiplies the offset by one, two and three for L1, L2 and L3, and steps the plot width from 2 to 4 across that range. The price each dot refers to stays identical in all three cases: the candle’s own high or low.
What does L3Bars set to 20 actually require?
For an up fractal, no bar in the twenty before or the twenty after may hold a higher high. That is a forty-bar window with the candidate in the middle. The consequence follows directly: the magenta dot appears only once those twenty later bars exist, so it always confirms well after the turn.
Can I run only the L1Bars level?
There is no per-level switch, but you can make the others unreachable. Setting `L2Bars` and `L3Bars` very high makes those tests almost impossible to satisfy. Most traders leave all three on, since comparing depths against each other is the whole point of the tool.
Do the L2 Up dots move once printed?
No. The code writes each buffer from completed bar data and never reads the bar still forming. Once bars exist on both sides the answer is fixed. What changes is that new dots keep appearing as the right-hand side of each window fills in.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Chaos Semafor Indicator as one input. Always backtest before trading live.
Category: this is part of our Trend collection. Also, truly, browse more Trend for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.
External references
- Learn more about the underlying method in Billion Dollar Day on Wikipedia.
- For wider market background, see Trendtrading at Investopedia.
