WAJDYSS_SSL_channel_chart_alert_indicator_v2

Download script
Author: wajdyss
WAJDYSS_SSL_channel_chart_alert_indicator_v2

This script is an automated technical analysis tool designed for the MetaTrader trading platform. Its primary purpose is to identify specific trend shifts in price action and provide visual and audible signals to help traders make timely decisions.

Core Functionality and Logic

1. Trend Detection (The SSL Channel) The tool tracks market momentum by comparing current prices against moving averages of previous highs and lows. It dynamically adjusts its "boundary lines" based on whether the market is currently behaving in an uptrend or a downtrend:

  • When the price shows strength, the script calculates specific upper and lower boundaries to create a "channel."
  • These boundaries act as dynamic zones; if the price stays within them, the current trend is considered intact.

2. Signal Generation (Crossovers) The heart of the logic lies in detecting when the price "breaks" out of these calculated zones. The script looks for specific crossover moments:

  • Buy Signals: When the upper boundary crosses above the lower boundary, the tool identifies a potential upward shift.
  • Sell Signals: When the lower boundary crosses below the upper boundary, the tool identifies a potential downward shift.
  • When these crossovers occur, the script places visual markers (arrows) directly on your chart to highlight the exact point of the trend change.

3. Automated Alerts and Notifications To ensure traders don't miss these moments while away from their screens, the script includes an automated notification system:

  • Visual Pop-ups: It triggers a text alert on the screen providing the specific instruction (e.g., "Close Sell Orders and Buy" or vice versa).
  • Audio Feedback: It plays a sound file to grab the trader's attention immediately upon a signal.
  • Execution Timing: The logic includes a built-in delay/check to ensure that alerts are only triggered once per candle, preventing your screen from being flooded with repetitive notifications during a single price movement.

User Interface Features

  • On-Screen Information: The tool displays a dashboard directly on the chart showing the indicator's name and contact information.
  • Expiration Management: The script contains a built-in "timer" or validity check. It displays a countdown or a specific expiration date, informing the user when the tool is set to stop functioning based on the developer's intended timeframe.
  • Visual Clarity: It uses distinct colors (Red, Green, Magenta, and Lime) for different lines and arrows, allowing for quick interpretation of market direction at a glance.
Price Data Components
Series array that contains close prices for each barSeries array that contains close prices for each bar
Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1It plays sound alerts
11 Views
0 Downloads
0 Favorites
WAJDYSS_SSL_channel_chart_alert_indicator_v2
#property copyright "wajdyss"
#property link      "wajdyss@yahoo.com"
//----
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 Green
#property indicator_color3 Magenta
#property indicator_color4 Lime

#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 2
#property indicator_width4 2


//----
extern int  Lb           =10;
extern  bool alert = true;
//----
double ssld[];
double sslu[];
double Hlv[];

double CrossUp[];
double CrossDown[];

 string file="alert.wav";
 int TextSize=14;
 extern color TextColor1=White;
 extern  color TextColor2=Yellow;
 extern color TextColor3=Aqua;
 extern color TextColor4=Red;
 color TextColor5=Chartreuse;
 string Name=" wajdyss_SSL_Channel_Chart_Alert_Indicator";
int eyear=9999;
int emonth=9;
int eday=9;
bool al1=false;
bool al2=false;
int D;
 int second=20;

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {
   
   IndicatorBuffers(8);
    SetIndexBuffer(0,ssld); SetIndexDrawBegin(0,Lb+1);
   SetIndexBuffer(1,sslu); SetIndexDrawBegin(0,Lb+1);
   SetIndexBuffer(4,Hlv);
  
   SetIndexStyle(3, DRAW_ARROW, EMPTY);
   SetIndexArrow(3, 233);
   SetIndexBuffer(3, CrossUp);
   SetIndexStyle(2, DRAW_ARROW, EMPTY);
   SetIndexArrow(2, 234);
   SetIndexBuffer(2, CrossDown);

D=Time[1];

   return(0);
  }

int deinit()
  {
  Comment("");
 ObjectDelete("a label");
 ObjectDelete("b label");
 ObjectDelete("c label");
 ObjectDelete("d label");
 ObjectDelete("e label");

   return(0);
  }

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
  
    //a
          if(ObjectFind("a label") != 0)
   {
      ObjectCreate("a label", OBJ_LABEL, 0,0,0);
      ObjectSetText("a label","ÈÓã Çááå ÇáÑÍãä ÇáÑÍíã" , TextSize, "Arial", TextColor1);
      ObjectSet("a label", OBJPROP_XDISTANCE,350);
     ObjectSet("a label", OBJPROP_YDISTANCE,0);
   }
   
   //b
      if(ObjectFind("b label") != 0)
   {
      ObjectCreate("b label", OBJ_LABEL, 0,0,0);
      ObjectSetText("b label",Name , TextSize, "Arial", TextColor2);
      ObjectSet("b label", OBJPROP_XDISTANCE,230);
     ObjectSet("b label", OBJPROP_YDISTANCE,25);
   }
   
   // c

   
      if(ObjectFind("c label") != 0)
   {
      ObjectCreate("c label", OBJ_LABEL, 0,0,0);
      ObjectSetText("c label","wajdyss@yahoo.com"  , TextSize, "Arial", TextColor3);
      ObjectSet("c label", OBJPROP_XDISTANCE,335);
     ObjectSet("c label", OBJPROP_YDISTANCE,50);
   }

//if (Symbol()!="EURJPY" || Period()!=1440) return(0);
   
    if ((Year()>eyear) || (Year()==eyear && Month()>emonth) || (Year()==eyear && Month()==emonth && Day()>eday))
    {
       //d
   if(ObjectFind("d label") != 0)
   {
      ObjectCreate("d label", OBJ_LABEL, 0,0,0);
      ObjectSetText("d label","the indicator has expired , contact us by E-mail" ,TextSize, "Arial", TextColor4);
      ObjectSet("d label", OBJPROP_XDISTANCE,250);
     ObjectSet("d label", OBJPROP_YDISTANCE,75);
   }
      return(0);
    } 
   else 
       if(ObjectFind("d label") != 0)
   {
      ObjectCreate("d label", OBJ_LABEL, 0,0,0);
      ObjectSetText("d label","the indicator well expire after ( " + eday+"-"+emonth+"-"+eyear+" )",TextSize, "Arial", TextColor4);
      ObjectSet("d label", OBJPROP_XDISTANCE,265);
     ObjectSet("d label", OBJPROP_YDISTANCE,75);
   }

   int counted_bars=IndicatorCounted();
   int i,limit;
//----
   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//----
   for(i=limit;i>=1;i--)
     {
      Hlv[i]=Hlv[i+1];
      if(Close[i]>iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_HIGH,i+1)) Hlv[i]= 1;
      if(Close[i]<iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_LOW,i+1))  Hlv[i]=-1;
      if(Hlv[i]==-1)
        {
         ssld[i]=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_HIGH,i+1);
         sslu[i]=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_LOW ,i+1);
        }
      else
        {
         ssld[i]=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_LOW ,i+1);
         sslu[i]=iMA(Symbol(),0,Lb,0,MODE_SMA,PRICE_HIGH,i+1);
        }
    if (sslu[i]>ssld[i] && sslu[i+1]<=ssld[i+1])   { CrossUp  [i] = Low[i] -5*Point; al1=true; al2=false;}
    if (sslu[i]<ssld[i] && sslu[i+1]>=ssld[i+1])   { CrossDown[i] = High[i]+5*Point; al1=false; al2= true;}
    
     }
     //Comment ("i= ",i," sslu= ",sslu[1]," ssld= ",ssld[1]);
//----
//----
if (al1==true && D!=Time[i] && alert==true && Seconds()<second)
   {D=Time[1]; Alert (Name," Close Sell Orders And Buy  ",Symbol()," AT ",iClose(Symbol(),0,i)); PlaySound(file); }

if (al2==true && D!=Time[i] && alert==true && Seconds()<second)

 {D=Time[1];  Alert (Name," Close Buy Orders And Sell  ",Symbol()," AT ",iClose(Symbol(),0,i)); PlaySound(file); }


   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+

Comments