Loading…

Break Of Structure Detector

"Break of structure" is a simple idea that gets sloppy in practice: which swing counts as the level being broken, and when exactly did the break happen? This indicator answers both plainly. The level is the most recently CONFIRMED swing high or low - a fractal-style extreme with InpK bars closed on both sides - and a break is only registered when a later bar's CLOSE moves beyond it. Confirmation delay is unavoidable and worth being honest about: a swing at bar i is not known to be a swing until InpK bars past it have closed, so the level any break is tested against is always at least InpK bars old by construction. This is not a flaw to be engineered away, it is what "confirmed" means - a level that could still be overtaken by the next tick is not a real level yet. The break test itself only ever looks at closed bars. Testing the forming bar's close would let an arrow appear and then vanish as price wicks back inside the level within the same bar, which is exactly the kind of flip-flopping a repainting indicator produces. Once a level is broken it is "consumed" - the indicator will not flag another break of the same level until a fresh swing has formed to replace it. Notes and limitations - Every level tested is at least InpK bars old. This indicator does not, and cannot, flag a break the instant the underlying swing forms - that swing is not confirmed yet. - Breaks are evaluated on closed bars only; nothing here repaints once drawn. - A broken level cannot be broken again until a new swing on that side replaces it, so a strong sustained move produces one arrow at the first break, not one per bar that continues past it. - No trade or stop-loss logic - visual and alerting only. - On a fresh chart load the indicator replays the whole confirmable history to rebuild its internal swing-level state, so the first calculation after attaching or after a history reload can take a moment on a long chart.

Indicator · MT4 · v1.0 · Free

About Break Of Structure Detector

Break Of Structure Detector is an indicator for MetaTrader 4. It draws buy and sell arrows on the chart and can alert you with a pop-up, sound, email or push message. It has 3 settings, such as K, Alerts and Segment bars. MQL source code included.

Files in the download: BreakOfStructure.ex4, BreakOfStructure.mq4, BreakOfStructure.txt.

Settings

SettingDefaultWhat it does
K2Bars required on each side to confirm a swing
AlertstrueAlert on a new break (closed bar only)
Segment bars10How many bars back the broken-level segment is drawn

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Fractals · Buy/Sell Arrows · Alerts · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria