ZeroLag TrendCandle Signal - No Repaint - MT5 indicator

ZeroLag TrendCandle Signal - No Repaint - MT5 indicator

26 May 2025, 21:53
Martin Alejandro Bamonte
0
69
ZeroLag TrendCandle — Real-time Candle Coloring & Alerts System (No Repaint)

ZeroLag TrendCandle is a real-time trend detection tool that applies non-repainting candle coloring based on an advanced Williams Percent Range (WPR) analysis. It highlights trend shifts, momentum changes, and potential reversals through a dynamic color-coded system—allowing traders to instantly understand current market direction with a clean, intuitive chart, as shown in the images. At a glance, you can clearly identify the prevailing momentum and its strength.

Core Features:

No Repaint
  • No repaint, no backpainting, no signal disappearance, and no false alerts during live trading -Please refer to the detailed technical explanation below.-  What you see on the chart stays there.

Live Detection (Zero Lag)
  • Signals are generated instantly after the closing of the current candle—no delays, no recalculations. This ensures you always react to confirmed market moves, not lagging ones.


Clear chart


Works on All Assets and Timeframes
Fully compatible with:

  • Forex pairs (majors, minors, exotics)
  • Commodities (Gold, Silver, Oil)
  • Indices (S&P500, NASDAQ, DAX, FTSE, etc.)
  • Cryptocurrencies (Bitcoin, Ethereum, etc., depending on your broker)
  • Futures and CFDs
  • Stocks (if supported by your broker)
  • All timeframes (from M1 to MN)

Clear Candle Color Logic
  • Green: Bullish candle with bullish momentum (signal is triggered when a gray candle turns green)
  • Olive: Bullish candle with bearish pressure (indicates possible reversal or conflict of forces)
  • Red: Bearish candle with bearish momentum (signal is triggered when a gray candle turns red)
  • Orange: Bearish candle with bullish pressure (indicates possible reversal or conflict of forces)
  • Gray: Neutral or undecided state (no signal is issued while candles remain gray)
  • Blue: Current forming candle (color is only finalized at its close)

Candle Color logic

Smart Alerts System
  • The indicator offers configurable alerts via popup, sound, email, and push notification. Alerts are only triggered when a new green candle (buy) or red candle (sell) appears after one or more gray candles. This avoids noise and focuses only on confirmed transitions.


Alerts


Flexible WPR-Based Trend Logic

  • The underlying WPR calculation adapts to market changes. You can customize the SensitivityLevel and WPR Period to fine-tune the indicator for your preferred asset, timeframe, or trading style.

Customizable Chart Appearance
For a more comfortable trading experience, the indicator allows you to adjust visual settings directly from its parameters:
  • Enable or disable the grid
  • Customize candle colors
  • Change the background color
  • Modify axis, scale, and text color
  • Show or hide volume and customize its color

Technical explanation only for advanced users: Why this indicator does NOT repaint

This indicator has been designed to strictly avoid any form of repainting, backpainting, or false visual feedback. Here's how its internal logic guarantees clean and reliable behavior:

1. Signals are only defined on the previous candle (bar == 1)
The system exclusively evaluates and finalizes signals on bar index 1 (i.e., the most recently closed candle). The current candle (bar == 0) is never used to confirm or trigger entries.

2. The current candle (bar == 0) shows only a temporary visual color
A special buffer color (code 5) is used to mark the forming candle, purely for clarity. This is a visual aid and has no effect on signal generation.

3. Final color is fixed in buffer ExtColorsBuffer[1]
Once bar 1 is closed, its color is stored in the color buffer and is never overwritten in future OnCalculate() calls.

4. No use of risky logic like iBarShift, Time[0], or backward recalculations
These functions are often sources of repainting. This indicator avoids them entirely.

5. Signals remain visible and unchanged after rendering
The loop structure ( for (int bar = limit; bar >= 0; bar--) ) updates candle buffers without deleting past values. What you see on the chart stays there.

6. It uses standard iWPR as signal base
The logic is built around the Williams Percent Range (WPR), a standard MetaTrader indicator that does not repaint by design.

7. Data is obtained directly using CopyBuffer without reinterpretation
CopyBuffer is used to fetch raw WPR values without modifying or shifting the data dynamically. This ensures signal integrity.

Conclusion:
No repaint, no false refresh, no retroactive changes. What you see is exactly what was there at the time of the signal — even if you reload the chart later.

Technical Note: Why iWPR does not repaint

The Williams Percent Range (iWPR) is a built-in MetaTrader indicator that does not repaint, as long as it is used correctly. Its calculation is based on the highest high, lowest low, and close of the last N closed candles—meaning once a candle closes, the corresponding WPR value becomes final and does not change.

This indicator uses CopyBuffer() to access WPR values directly from the terminal’s internal buffer, without applying any dynamic reinterpretation or shifting logic. Additionally, the logic only references candle bar == 1 (i.e., the last fully closed candle), which ensures all WPR values used for signal generation are stable and confirmed.

As a result, iWPR is fully non-repainting by design, and this indicator preserves that integrity with strict buffer handling and signal timing.


For any questions or inquiries, please send a private message and I will respond as soon as possible!