Loading…

Fractal Swing Marker

A swing high is a bar whose high is the most extreme within K bars on either side of it. The definition itself is what makes this a lagging marker rather than a live signal: you cannot know a bar is the most extreme within K bars to its right until those K bars have closed. This indicator does not guess. It waits for the full window, then places one arrow that never moves and never disappears once drawn. That is worth stating plainly because a lot of published fractal indicators quietly cheat this. They plot the extreme bar as soon as it is the local high seen so far, then erase and redraw as newer bars beat it - a live marker that keeps jumping backwards, which is repainting even if the code never calls it that. This version has no such state: a bar is either not yet decidable (still inside its confirmation window) or permanently decided. Nothing is ever un-drawn. The confirmation window is symmetric and configurable. A small K reacts quickly and marks minor wiggles; a large K only marks swings that mattered enough to hold for many bars either side, at the cost of a longer wait before each arrow appears. Notes and limitations - By construction, every arrow is InpK bars old at the moment it appears. This is a structure marker for reading confirmed swing points, not a real-time entry trigger - do not treat the newest visible arrow as something that just happened on the current bar. - The test is strict (greater than, not greater-or-equal), so a tie between two adjacent bars never produces two arrows for the same turn; ties resolve to "not yet a swing". - Uses no chart objects - both plots are ordinary indicator buffers, so the markers survive a template change and there is nothing to clean up in OnDeinit. - Market Structure Labels, elsewhere in this catalogue, is built on exactly this same K-bars-each-side confirmation rule and takes it one step further - classifying each confirmed swing as a higher high, lower high, higher low or lower low rather than just marking it. The two are companion indicators built from the same underlying logic, coded independently in each file so that either one stands alone.

Indicator · MT4 · v1.0 · Free

About Fractal Swing Marker

Fractal Swing Marker 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 2 settings, such as K and Alerts. MQL source code included.

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

Settings

SettingDefaultWhat it does
K2Bars required on each side to confirm a swing
AlertstrueAlert when a swing is confirmed (closed bars only)

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