Alert_MA_v3

Download script
Author: Kalenzo

This script is designed as a specialized alert tool for traders who use Moving Averages to monitor market trends. Instead of creating complex visual shapes or drawings on your chart, its primary purpose is to provide real-time notifications when the market price interacts with a specific moving average level.

How it Works

The logic follows a straightforward three-step process:

1. Defining the Baseline The script calculates a Moving Average (MA) based on settings you choose (such as the number of periods, the type of average like EMA, and the price source). This acts as your "baseline" or reference point for the current market trend.

2. Monitoring the Price Zone Rather than just alerting you when the price touches the line exactly, this script looks for a specific "range." You can define a small buffer zone around the moving average. The logic checks if the current market price (the Bid) is currently hovering within this defined proximity to the moving average.

3. Real-Time Notification Whenever the market price enters that specific zone, the script immediately triggers an alert on your platform. The notification will display:

  • The name of the currency pair or asset you are trading.
  • The specific Moving Average period being monitored.
  • The current live price at the moment the threshold was reached.

Key Benefits for Traders

  • Reduced Screen Time: You don't have to constantly watch the chart to see if the price is "hitting" your moving average; the script notifies you automatically.
  • Precision Monitoring: By using a customizable range, it ensures you are alerted even if the price fluctuates slightly around the line rather than just crossing it perfectly.
  • Customizable Parameters: You can easily adjust the period length and type of moving average to match your specific trading strategy.
Indicators Used
Moving average indicator
Miscellaneous
It issuies visual alerts to the screen
8 Views
0 Downloads
0 Favorites
Alert_MA_v3
//+------------------------------------------------------------------+
//|                                                     Alert_MA.mq4 |
//|                                                          Kalenzo |
//|                                      bartlomiej.gorski@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Kalenzo"
#property link      "bartlomiej.gorski@gmail.com"
extern int range = 1;
extern int ma_period = 55;
extern int ma_shift = 0;
extern int ma_method = MODE_EMA;
extern int applied_price = PRICE_CLOSE;
 
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
    
//----bb
   double ma = iMA(Symbol(),0,ma_period,ma_shift,ma_method,applied_price,0);
   
   if( (Bid <= ma+(range*Point)) && (Bid >= ma-(range*Point)))
   Alert(Symbol()+" "+ma_period+" Moving Average range reached at ",Bid);
    
   
//----
   return(0);
  }
//+------------------------------------------------------------------+èÇ '53bb45d07b1e79e5a84e574137ff6e46[1].jpgq|pZ9bieߠȶ’ߠȶ’ß ÈԈh9Y¡ÈÐèÇ 53BB45~1.JPG].j‹Üxd9€çæcŸÈœ5õcŸÈœ5õcŸÈœ5õcŸÈ l 5442_thumb[1].jpg‹ÜpZ9€çæcŸÈœ5õcŸÈœ5õcŸÈœ5õcŸÈ l 5442_T~1.JPGfd5p\9PÄöèŽÈPÄöèŽÈPÄöèŽÈPÄöèŽÈ³( 
600x24[1].gifd5pZ9PÄöèŽÈPÄöèŽÈPÄöèŽÈPÄöèŽÈ³ 600X24~1.GIF‡|hT9¼ËgߠȼËgߠȼËgߠȼËgß È
 	65[1].jpg[1‡|hX9¼ËgߠȼËgߠȼËgߠȼËgß È
 65_1_~1.JPGÞ"xb9¾c¾ÏŸÈ¾c¾ÏŸÈ¾c¾ÏŸÈ¾c¾ÏŸÈ 673310SPK[1].jpgpgxf9(8ÃÓfЎÈ$$õfЎÈ$$õfЎÈ$$õfЎÈ è 75354461_47[2].jpg8ÃÓfЎÈ$$õfЎÈ$$õfЎÈ$$õfЎÈ è 75354461_47[2].jpg$$õfЎÈ$$õfЎÈ$$õfЎÈ è 75354461_47[2].jpg$$õfЎÈ$$õfЎÈ$$õfЎÈ è 75354461_47[2].jpg8ÃÓfЎÈ$$õfЎÈ$$õfЎÈ$$õfЎÈ è 75354461_4([2].jpg8ÃÓfЎÈ$$õfЎÈ$$õfЎÈ$$õfЎÈ è 75354461_47[2].jpg98ÃÓfЎÈ$$õfЎÈ$$õfЎÈ$$õfЎÈ è 753544~2.JPG8ÃÓfЎÈ$$õfЎÈ$$õfЎÈ$$õfЎÈ è 753544~2.JPG8ÃÓfЎÈ$$õfЎÈ$$õfЎÈ$$õfЎÈ è 753544~2.JPG(

Comments