Author: Copyright © 2016, Oluwatosin Aboluwarin: www.mychartist.com
Notify

This script is a specialized utility library designed for MetaTrader 4 (MT4) to streamline how traders receive information and notifications from their trading charts. Instead of manual alerts, it provides a structured way to automate messages across different platforms.

Core Functionality

The primary purpose of this tool is to handle three types of communications simultaneously:

  • Sound Alerts: Audible pings within the MetaTrader platform.
  • Push Notifications: Messages sent directly to your mobile device via the MetaTrader app.
  • Print Logs: Data recorded in the platform's internal journal for later review.

Key Features and Logic

1. Automated Message Formatting The script automatically constructs a clear, standardized message for every notification. It attaches the specific trading pair (Symbol) and the current timeframe (e.g., "EURUSD 60 mins") to your custom message. This ensures that you immediately know which chart triggered the alert without having to switch screens.

2. Smart Notification Management A common frustration in automated trading is receiving dozens of repetitive alerts for a single price movement. This script includes an intelligent "Once Per Candle" logic:

  • Standard Mode: If disabled, the script will trigger every time the underlying condition is met (useful for high-frequency data).
  • Single Notification Mode: When enabled, the script tracks the current candle's time. It will only send one notification per candle. Once a message is sent, it "locks" until a new candle begins on the chart. This prevents your phone or computer from being overwhelmed by repeated alerts during a single price fluctuation.

3. Customizable Delivery Options The logic allows the user to choose exactly how they want to receive information. You can set it to send only a sound, only a mobile push, only a log entry, or all three at once. This flexibility makes it a versatile tool for different trading styles—whether you prefer to stay glued to your screen or want to trade while away from your desk.

10 Views
0 Downloads
0 Favorites
Notify
ÿþ//+------------------------------------------------------------------+

//|                                                       Notify.mq4 |

//|                                       Copyright 2016, MyChartist |

//|                                        http://www.mychartist.com |

//+------------------------------------------------------------------+

#property library

#property copyright "Copyright © 2016, Oluwatosin Aboluwarin: www.mychartist.com"

#property link      "http://www.mychartist.com"

#property description "This library has smart notification(alert, push and alert) function with an option of having a single notification per candle at a time."

#property version   "1.0"



datetime notifyTag=0;

//+------------------------------------------------------------------+

//| Notify                                                     |

//+------------------------------------------------------------------+

void Notify(bool isAlert,bool isPush,bool isPrint,string msg,bool isNotifyOncePerCandle)

  {

   string msgDetail=Symbol()+" "+(string)Period()+" mins- "+msg;



   if(!isNotifyOncePerCandle)

     {

      if(isAlert) Alert(msgDetail);

      if(isPush) SendNotification(msgDetail);

      if(isPrint) Print(msgDetail);

     }

   else

     {

      if(notifyTag!=Time[0])

        {

         if(isAlert) Alert(msgDetail);

         if(isPush) SendNotification(msgDetail);

         if(isPrint) Print(msgDetail);



         notifyTag=Time[0];

        }

     }

  }

//+------------------------------------------------------------------+

Comments