Any Indicator Alert: Notifications and Multi-Timeframe Alerts for Any Custom Indicator
Info
The Any Indicator Alert: Notifications and Multi-Timeframe Alerts for Any Custom Indicator is a Indicator for MetaTrader 5 that there are two persistent discussions on this forum: 'indicators with alerts/signal' and 'multi timeframe indicators'. For years, the solution has been to obtain the source code, modify it, and recompile.
Usage
This tool is typically used for enhancing chart analysis and decision making.
Platform
This Indicator works exclusively on MetaTrader 5 (both build 600+ and newer versions).
Setup
Place the downloaded file in MQL5/Indicators folder via File ? Open Data Folder in MetaTrader 5.
How to Install and Use Any Indicator Alert: Notifications and Multi-Timeframe Alerts for Any Custom Indicator
1. Installation: Place your file in the MQL/Indicators folder via "Open Data Folder" and restart your terminal.
2. Loading: Find the indicator in the Navigator, drag it onto your chart, and configure the input parameters in the popup window.
3. Customization: Press Ctrl+I to open the indicator list, select your tool, and click "Properties" to change colors, levels, or visual styles.
4. Updating: Replace the old file in the Indicators folder with the new version and restart the platform to apply changes.
Frequently Asked Questions
Q: Why is my indicator not showing? A: Verify the file is in the MQL/Indicators folder, or try right-clicking the "Indicators" tree in the Navigator and clicking "Refresh."
Q: Do custom indicators slow down the platform? A: Too many complex indicators can impact performance; remove unused ones via the "Indicator List" (Ctrl+I).
Q: Can I use MT4 indicators on MT5? A: No, MQL4 and MQL5 are distinct languages; ensure the indicator is compiled specifically for your platform version.
What this tool does
There are two persistent discussions on this forum: 'Indicators with alerts/signal' and 'Multi Timeframe Indicators'.
Typical Use Case
This Indicator excels in automated trading and technical analysis on MetaTrader 5.
Compatible Platform & Setup
This Indicator works on MetaTrader 5. Place the file in the MQL5/Indicators folder and restart the terminal.
Description & Settings
Related: Trading Session Boxes Indicator for MT4/MT5 - another powerful indicator for MetaTrader 5 traders.
There are two persistent discussions on this forum: 'Indicators with alerts/signal' and 'Multi Timeframe Indicators'. For years, the solution has been to obtain the source code, modify it, and recompile. This approach is not feasible if you only have an .ex5 file without source code, and it does not scale when using multiple indicators.Also recommended: ICT Kill Zones Indicator: Asian, London, New York in New York Time (2026) - similar indicator with strong performance on MetaTrader 5.
This tool addresses this problem externally. Using iCustom, you can load any indicator by its name and access its buffers without needing the source code. This means a single tool can manage all your indicators.
Starting in EXPLORE Mode
Many users hesitate to use iCustom because it requires a buffer number, and it's often unclear which buffer corresponds to the visual elements on the chart. The default EXPLORE mode solves this by probing the buffers, analyzing their content, and displaying this information alongside the last few bars. Buffers with values on most bars are typically lines, suitable for level crosses or crosses between two buffers. Buffers that are empty except when the indicator draws a signal are ideal for 'a value appears' triggers. Once identified, you can note the buffer number, switch to WATCH mode, and set your desired trigger.
Sample of EXPLORE Output
The following is a live example on an XAUUSDm H1 chart using the standard RSI indicator. It lists every buffer for the indicator, showing the number of bars with real values, zeros, and blank entries, followed by the actual values for the last few bars.
Buffers found: 3 (checked up to 16, on XAUUSDm PERIOD_H1)
------------------------------------------------------------------
buffer values zeros blank what it looks like range of the values
0 12 0 0 a line - a value on almost every bar 31.47608 .. 55.28984
1 12 0 0 a line - a value on almost every bar 4.11585 .. 6.11288
2 12 0 0 a line - a value on almost every bar 3.86003 .. 8.96028
------------------------------------------------------------------
bar time buf0 buf1 buf2
0 2026.09.04 20:00 45.61107 5.40493 6.44511
1 2026.09.04 19:00 46.88624 5.82069 6.59381
2 2026.09.04 18:00 43.33095 5.42967 7.10102
3 2026.09.04 17:00 40.80179 5.27080 7.64725
------------------------------------------------------------------
Interpreting the data: Identify the buffer that is mostly empty but contains a value only where the indicator signals. This is the buffer to monitor. Input its number into 'Buffer to watch', set the Mode to WATCH, and select your trigger.
Buffers that have a value on every bar are considered lines. These can be used with level triggers or buffer cross triggers.
In the RSI example, all three buffers are lines. For indicators that draw arrows or signals, the output table will appear different, which is precisely the point:
buffer values zeros blank what it looks like range of the values
0 0 0 8 nothing here on these bars -
11 8 0 0 a line - a value on almost every bar 16.08798 .. 16.25192
14 7 1 0 sparse - looks like a signal 4166.06000 .. 4166.06000
In this case, Buffer 14 is the one to watch because it is empty on most bars and only has a value where the indicator has marked something. Therefore, the 'a value appears' trigger is appropriate. Buffer 11 is an internal line, and Buffer 0 contains no data for these bars.
Late Values and Repaints Distinguished
This tool differentiates between late values and repaints, counting them separately. Every closed bar's value is stored and re-evaluated with each new bar. When a closed bar's value changes, there are two possible reasons:
A Late Value:
The bar was previously blank and now has a value. This occurs when an indicator requires data from later bars to finalize a value for an earlier one. This is typical for indicators like Fractals or certain swing and structure markers. It is not a deliberate distortion but means the signal was not visible on the bar it relates to, which can affect visual strategy analysis.
A Repaint:
A previously existing value has moved or disappeared entirely. This means a signal that was visible is no longer present.
Both scenarios are logged with the bar's timestamp, the old value, and the new value. The chart comment maintains a running count of each. The forming bar's data is not used for this distinction, as changes on the forming bar are considered normal.
This distinction was empirically tested. On XAUUSD H1 for August 1-20, 2026 (299 bars), analyzing buffer 0 of each indicator:
Watched indicator
Late values
Repaints
Examples Fractals, marks a bar two bars after it closes
40
0
Examples ZigZag, redraws its last leg by design
0
83, every one a value that vanished
Examples RSI, settled once a bar closes
0
0
This analysis correctly identifies lagging indicators as 'late' and repainting indicators as 'repaint', while indicators that do neither are not flagged. During the same run, the level trigger activated twice when RSI crossed below 30 (at 28.38 and 29.21). MACD's main line crossed its signal line nine times in each direction. RSI from an H4 chart on an H1 chart generated one alert per H4 bar (77 total), each stamped PERIOD_H4. The tool also processed a 157 KB third-party Smart Money Concepts indicator, identifying 16 buffers and distinguishing three internal lines from two sparse signal buffers.
Triggers
The available triggers include: a value appearing on a bar (whether closed or a lagging indicator's updated earlier bar), crossing above or below a specified level, one buffer crossing another in either direction, or simply a value change. Alerts can be sent via popup, sound, push notification, or email, with one alert per bar. By default, only closed bars are evaluated. When this option is off, the forming bar is evaluated on every tick, allowing for earlier alerts that might be reversed. In either case, only one alert is generated per bar.
Higher Timeframe Analysis
By setting the 'Read it on this timeframe' option, you can instruct the tool to load and analyze the indicator on a different timeframe than the current chart. All bar evaluation, triggering, and repaint checks will adhere to the selected timeframe.
Two Worked Examples
Example 1: Alert when RSI crosses above 70.
This is a familiar indicator, so EXPLORE mode serves primarily as a verification step.
Input
Value
Indicator file
Examples RSI
Its inputs
14
Read it on this timeframe
Current timeframe
Mode
WATCH
Buffer to watch
0
Trigger
buffer crosses above Level
Level
70
Popup alert
true
On the test data, this generated four alerts at values 75.04, 76.31, 70.38, and 74.83. To achieve the same alert from an H4 chart while viewing an H1 chart, simply set 'Read it on this timeframe' to H4 and leave all other settings unchanged.
Example 2: Alerting on an arrow indicator without source code.
Here, EXPLORE mode is crucial for identification.
Attach the indicator to your chart with Mode set to EXPLORE and the 'Indicator file' field populated with the indicator's name. Leave 'Its inputs' blank to use the indicator's default settings.
Open the Toolbox, navigate to the Experts tab, and identify the buffer that appears 'sparse' – meaning it's empty on most bars but shows a value where an arrow is visible on the chart. Let's assume this is buffer 2.
Re-attach the indicator, this time setting Mode to WATCH, 'Buffer to watch' to 2, the Trigger to 'a value appears', and enable Push notifications.
If EXPLORE provided a note indicating that a buffer primarily consists of exact zeros, enable the 'This indicator writes 0 where it means nothing' option and re-examine the table before making your final selection.
Input Parameter Descriptions
Input
What it does
Indicator file
The path to the indicator file located under MQL5 ndicators, excluding the file extension. Use a single backslash, for example, Examples RSI or MyFolder MyArrows. This field is initially empty because not all terminals have the same indicators. No action will be taken until this field is filled.
Its inputs
The specific inputs for the watched indicator, provided as a comma-separated list in the order they are declared. Leaving this blank will use the indicator's default settings. Numeric values are passed as integers (int) or floating-point numbers (double), boolean values as true/false, and other types as text. The log will display the interpreted values for confirmation.
Read it on this timeframe
Specifies the timeframe on which the watched indicator will be loaded and analyzed, overriding the chart's current timeframe. 'Current timeframe' refers to the chart's native timeframe.
This indicator writes 0 where it means "nothing"
Treats an exact value of 0 as empty. This is necessary for indicators like ZigZag. EXPLORE mode will indicate when this option is beneficial. Note that an oscillator genuinely resting at zero would appear identical from an external perspective, hence the need for manual selection.
Mode
EXPLORE: Lists available buffers and their characteristics without generating alerts. WATCH: Generates alerts based on the selected buffer and trigger.
How many buffers to probe
In EXPLORE mode, this setting determines the maximum number of buffers to analyze. If the output indicates this limit was reached, increase this value.
How many recent bars to print
Determines the number of recent bars that EXPLORE mode will display and analyze.
Buffer to watch
The buffer number identified from the EXPLORE mode output that you wish to monitor.
Second buffer
Used exclusively by the two buffer-cross trigger types.
Trigger
Defines the condition for generating an alert: 'a value appears', 'buffer crosses above Level', 'buffer crosses below Level', 'buffer A crossing buffer B' (in either direction), or 'value changing'.
Level
The threshold value used for the 'buffer crosses above Level' and 'buffer crosses below Level' triggers.
Judge closed bars only
When enabled (default), alerts are generated only when a bar closes, ensuring the alert is final. When disabled, the forming bar is evaluated on every tick, allowing for earlier alerts that may be reversed. In both cases, one alert is generated per bar.
Popup, sound, push, email
Enables or disables specific alert channels: popup dialogs, sound alerts, push notifications, and email alerts. Push notifications require your MetaQuotes ID to be configured in MetaTrader's Tools -> Options -> Notifications.
Re-read closed bars and report changes
Activates the reporting of late values and repaints for closed bars. The check looks back a specified number of bars; changes beyond this range are not detected.
How many closed bars to keep watching
Specifies the lookback period for detecting changes in closed bars. Changes occurring further back than this period will not be reported.
Ignore changes smaller than this
Set to 0 to capture all changes. Increase this value to ignore minor fluctuations, such as those in the last decimal place, which might occur with jittery indicators.
Common Pitfalls and Solutions
Some indicators use a plain 0 to signify 'nothing here' instead of the standard EMPTY_VALUE. ZigZag is an example. Naively interpreted, such a buffer appears as a solid line of zeros. An input option is provided for this scenario, and EXPLORE mode will flag buffers that are mostly zeros with a few significant values, assisting you in making the correct selection. This is not automatically determined because an oscillator that genuinely stays at zero would be indistinguishable externally.
A bar that the indicator has not yet written to reads as exactly 0.0. This is the default value in a newly forming buffer. A lagging indicator intentionally leaves its most recent bars in this state until it can incorporate data from subsequent bars. For instance, Fractals typically do not update the last three bars. If read naively, these bars would appear as frequent 'changes', potentially leading to misinterpretations like the three hundred repaints reported by an earlier version of this tool for an indicator with no actual repaints. Bars transitioning from 0.0 to blank are now classified as initialization, and from 0.0 to a value as a late arrival.
Input group parameter slot issue:
When calling this indicator via iCustom or IndicatorCreate from your own code, the six input group labels must be included as strings in the positional parameter list, along with the actual indicator inputs. Failure to do so will result in error 4002. This has been verified through testing. Buffer 0 mirrors the watched buffer's value, allowing your Expert Advisor (EA) to read it directly without duplicating the logic. This was confirmed by comparing it against the watched RSI over 299 out of 299 bars.
Error Handling for Unloadable Indicators:
If the specified indicator cannot be loaded (due to a typo or an uncompiled file), the tool will not detach. It will display a message on the chart and in the Experts log, and it will retry loading every few seconds. Simply correcting the indicator name will resolve the issue.
Limitations
This tool operates by reading indicator *buffers*. Indicators that exclusively use chart objects for drawing do not expose buffers, and therefore, this tool cannot read them. This limitation is inherent to the indicator drawing method.
'No repaint seen over 200 bars' is an observation based on the analyzed period, not an absolute guarantee for all future bars. It serves as strong evidence, superior to the claims often made by indicators, but it is not definitive proof. The analysis covers the number of closed bars specified in 'How many closed bars to keep watching'; any changes beyond this range are not detected.
The tool cannot interpret the meaning of a buffer's values. It will report that buffer 3 holds 1.0 on fourteen bars, but it is up to you to determine if this signifies a buy signal.
An indicator that signals using an exact value of 0.0 will not trigger the 'a value appears' alert, as this value represents an unwritten bar. Signal buffers typically contain a price or flag value, not 0.0, so this limitation is usually inconsequential in practice, but it is a rule to be aware of.
Buffer 0 only mirrors the watched buffer when the watched timeframe matches the chart's own timeframe. Mapping a higher timeframe onto every chart bar is a separate functionality and is not implemented here.
The alert channels themselves (popup, sound, push, email) involve a single function call each and were not tested in the Strategy Tester, as it does not deliver these alerts. All decisions made by the tool prior to the alert channel calls were verified.
Installation Instructions
1. Copy the file AnyIndicatorAlert.mq5 into your terminal's MQL5 ndicators folder. Access this folder via your terminal's File menu, then 'Open Data Folder'.
2. Open the file in MetaEditor and press F7 to compile. It should report 0 errors and 0 warnings.
3. In MetaTrader, press Ctrl+N to open the Navigator window. Locate 'Indicators', then drag and drop AnyIndicatorAlert onto your chart. If it's not listed, right-click in the Navigator and select 'Refresh'.
4. Fill in the 'Indicator file' field (it is initially empty). Keep the Mode set to EXPLORE and click OK. Examples RSI is a good starting point.
5. Press Ctrl+T to open the Toolbox, go to the Experts tab, and view the buffer table.
This tool was written and verified on MetaTrader 5 build 6140. It does not place orders or modify terminal behavior.
You may also like: Spread Monitor Indicator for MetaTrader 5 - excellent alternative for indicator users on MetaTrader 5.
Source Code
#property copyright "RobotFX"
#property version "1.00"
#property description "This code is educational. Feel free to use, modify and upgrade as you wish. Visit ROBOTFX.ORG for professional trading tools"
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_plots 0
double BufOut[];
enum ENUM_RUN_MODE
{
MODE_EXPLORE = 0,
.......
⚠ Limitations & Risk Warning
- This tool is provided for educational and testing purposes only.
- Past performance does not guarantee future results.
- Trading involves substantial risk of loss. Use on a demo account first.
- Results may vary depending on market conditions, broker, and settings.
- We recommend thorough backtesting and forward testing before using with real funds.