Seddboy30MA

Author: Copyright � 2007, GwadaTradeBoy
Seddboy30MA

This tool is designed as a visual and auditory monitoring system for traders who use the 30-period Simple Moving Average (SMA) to track market trends. It functions by automatically calculating this specific average and comparing the current market price against it in real-time.

Core Functionality

The script performs three primary actions to keep you informed of market movements:

1. Visual Mapping The tool draws a continuous line on your trading chart representing the 30-period Simple Moving Average. This allows you to see the general trend of the asset clearly, helping you distinguish between upward and downward momentum.

2. Trend Break Notifications Instead of requiring you to watch the screen constantly, the script "watches" the price for you. It triggers a notification whenever the current closing price crosses the moving average line:

  • Bullish Signal: If the price closes above the 30MA, the system recognizes a potential upward shift.
  • Bearish Signal: If the price closes below the 30MA, the system recognizes a potential downward shift.

3. Multi-Channel Alerts When a crossover occurs, the script provides immediate feedback through several channels:

  • Visual Pop-ups: An alert box appears on your trading platform screen showing the exact price and the current value of the moving average.
  • Audio Cues: The system plays an alert sound to grab your attention instantly.
  • Email Notifications (Optional): If you enable this feature in the settings, the tool will automatically send an email to your registered address, providing a written record of the price action for that specific symbol and timeframe.

Summary for Users

Essentially, this script acts as a digital sentinel. It automates the observation of the 30-period moving average, ensuring that you are notified the moment the market price breaks through this key trend line, whether that happens while you are away from your desk or in the middle of another task.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screenIt plays sound alertsIt sends emails
13 Views
0 Downloads
0 Favorites
Seddboy30MA
//+------------------------------------------------------------------+
//|                                                 Seddboy30SMA.mq4 |
//|                                  Copyright © 2007, GwadaTradeBoy |
//|                                           gwadatradeboy@yahoo.fr |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, GwadaTradeBoy"
#property link      "gwadatradeboy@yahoo.fr"

#property indicator_chart_window
//----Section #property
#property indicator_buffers 1
#property indicator_color1 LightCoral

//---- extern
extern bool Email = False;
//---- Variables
int         counted_bars,digits,limit,i;
double      SMA30Current;

//---- Buffers
double      ExtMapBuffer1[];    //SMA30
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
   {
//---- indicators
//---- Styles et couleur des Lignes
      SetIndexStyle(0,DRAW_LINE);
      SetIndexBuffer(0,ExtMapBuffer1);
//---- initialisation de digit/paire      
      digits = MarketInfo(Symbol(),MODE_DIGITS);
//----
      return(0);
   }

//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
   {
//----
   
//----
      return(0);
   }

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
   {
      counted_bars=IndicatorCounted();
//----
/*      if(Period() > 1440)
         {
            Print("Error - Chart period is greater than 1 day.");
            return(-1); // then exit
         }*/
      if(counted_bars<0) 
         return(-1);
      if(counted_bars>0) 
         counted_bars--;
      limit=Bars-counted_bars;
      for(i=0; i<limit; i++)
         {
            SMA30Current=iMA(NULL,0,30,0,MODE_SMA,PRICE_CLOSE,i);
            ExtMapBuffer1[i]=SMA30Current;
         }
//---- Buy
      if (Close[0]>SMA30Current)
         {
            Alert("Price close above 30MA ",SMA30Current," Price ",Close[0]," for ", Symbol(),"-",Period());
            PlaySound("alert.wav");
            if (Email)
               SendMail("Seddboy30MA","Price close above 30MA "+DoubleToStr(SMA30Current,digits)+" Price "+DoubleToStr(Close[0],digits)+" for "+Symbol()+"-"+Period());
         }
//---- Sell
      if (Close[0]<SMA30Current)
         {
            Alert("Price close below 30MA ",SMA30Current," Price ",Close[0]," for ", Symbol(),"-",Period());
            PlaySound("alert.wav");
            if (Email)
               SendMail("Seddboy30MA", "Price close below 30MA "+DoubleToStr(SMA30Current,digits)+" Price "+DoubleToStr(Close[0],digits)+" for "+Symbol()+"-"+Period());
         }
      //}            
//----
      return(0);
   }
//+------------------------------------------------------------------+

Comments