Loading…

Pivot Cluster Support Resistance

Most fractal-based support/resistance indicators draw a line at every single confirmed swing, which on a few hundred bars of history means dozens of overlapping lines and no way to tell which ones actually mattered. This one inverts that: it collects every confirmed swing over the lookback window, then groups the swings that land within a tolerance of each other into a single cluster. A cluster that only ever caught one swing is noise and is dropped by default. A cluster that caught four or five separate swings, sometimes weeks apart, is a level the market keeps coming back to - and that is the only kind of level this indicator draws. Clustering uses one sorted pass rather than comparing every swing to every other swing: swings are sorted by price, then a new cluster starts the moment the gap to the running cluster average exceeds the tolerance. The tolerance itself scales with ATR rather than being a fixed pip value, so the same settings behave sensibly on a tight range-bound pair and a wide, volatile one without retuning. Zones are recalculated once per new bar and their edges can shift as new swings confirm or old ones age out of the lookback window - this is a live structural map, not a one-off signal, so there is nothing to repaint in the sense that matters: no arrow ever appears then vanishes, no buy/sell judgement is made and reversed. The zones simply reflect the current best read of where price has clustered, the same way AutoChannel and AutoTrendlines elsewhere in this catalogue redraw their trendlines as structure develops. Notes and limitations - A zone's price is the average of the swings clustered into it, not the exact price of any single swing - by design, since the point is the level several swings agree on, not any one extreme. - Re-clusters the full swing list once per new bar rather than maintaining clusters incrementally. This is deliberate: incremental cluster maintenance would add real complexity for a cost that is unmeasurable at the swing counts this indicator works with. - The resistance/support colour split is based on the cluster's price relative to the current close at redraw time, so a zone can visually switch colour if price crosses through it - that is expected, not a bug. - This is a structural map, not an entry signal. It does not predict that price will react at a zone, only that it has repeatedly done so within the lookback window.

Indicator · MT5 · v1.0 · Free

About Pivot Cluster Support Resistance

Pivot Cluster Support Resistance is an indicator for MetaTrader 5 based on ATR. It has 11 settings, such as Swing bars, Lookback bars and Max swings. MQL source code included.

Files in the download: PivotClusterLevels.ex5, PivotClusterLevels.mq5, PivotClusterLevels.txt.

Settings

SettingDefaultWhat it does
Swing bars5Bars each side required to confirm a swing
Lookback bars500How far back to collect swings from
Max swings300Cap on swings kept, oldest dropped first
Cluster tolerance atr0.50Cluster grouping tolerance, as a multiple of ATR
Atr period14ATR period used to scale the tolerance
Min touches2Minimum swings required to draw a cluster
Max clusters8Maximum number of zones drawn, strongest first
Extend bars80Bars to extend each zone to the right
Resistance colorclrCrimsonColour for clusters above current price
Support colorclrDodgerBlueColour for clusters below current price
Show touch counttrueLabel each zone with its touch count

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 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: Pivot Points · Support & Resistance · Fractals · ATR · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria