Jump to content

Waddah Attar Scalping Indicator ADD ALERT PLEASE!


miko4x

Recommended Posts

Re: Waddah Attar Scalping Indicator

 

This Indicator draws Green and Red Bars .

 

Somtimes it does not draw Bars .

 

That means no trade.

 

Enter Buy when Tow Green Bars appears.

 

Enter Sell when Tow Red Bars appears.

 

you must use trailing stop and exit at closed Res or Sup.

 

Enjoy.

http://codebase.mql4.com/5906

:)

 

PLEASE ADD ALERT.

If you bar appears = ALERT

IF BAR CLOSE = ALERT

 

Regards

Link to comment
Share on other sites

Re: Waddah Attar Scalping Indicator ADD ALERT PLEASE!

 

Here you go, add alert.

extern bool alerts.On=true;
extern bool alerts.OnCurrent=false;   //true, alert on the current bar, will give more false signal. false, alter on the previous bar, better signal but delay 1 bar.
extern bool alerts.Message=true;
extern bool alerts.Sound=true;

 

download at

http://www.4shared.com/file/135620805/cdc9895d/Waddah_Attar_Scalping_Alert.html

Link to comment
Share on other sites

  • 2 weeks later...

Re: Waddah Attar Scalping Indicator ADD ALERT PLEASE!

 

Hello

 

What to change here to get alert in first green or red bar and not 3 bars later?

#property copyright "Copyright © 2009, Waddah Attar"
#property link      "[email protected]"
//----
extern int IPeriod=180;
//----
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_level1 0

extern int P1=1;
extern int P2=5;
extern bool alerts.On=true;
extern bool alerts.OnCurrent=false;
extern bool alerts.Message=true;
extern bool alerts.Sound=true;

//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
  IndicatorShortName("WaddahAttarScalping");
  SetIndexStyle(0, DRAW_HISTOGRAM,0,2);
  SetIndexBuffer(0, ExtMapBuffer1);
  SetIndexEmptyValue(0,EMPTY_VALUE); 
  SetIndexStyle(1, DRAW_HISTOGRAM,0,2);
  SetIndexBuffer(1, ExtMapBuffer2);
  SetIndexEmptyValue(1,EMPTY_VALUE); 
 return(0);
}
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int deinit()
{
 return(0);
}
//+------------------------------------------------------------------+
//| Float Pivot                                                      |
//+------------------------------------------------------------------+
int start()
 {
//----
  int i,j;
  double max,min,pivot,A,B;
  
  i=1000;
  while(i>=0)
  {
    j=iBarShift(Symbol(),P1,Time[i],false);
    max=iHigh(Symbol(),P1,iHighest(Symbol(),P1,MODE_HIGH,IPeriod,j));
    min=iLow(Symbol(),P1,iLowest(Symbol(),P1,MODE_LOW,IPeriod,j));
    pivot=(iClose(Symbol(),P1,j+1)+iClose(Symbol(),P1,j+2)+iClose(Symbol(),P1,j+3))/3;
    A=(Close[i]-((max + min + pivot)/3))/Point;

    j=iBarShift(Symbol(),P2,Time[i],false);
    max=iHigh(Symbol(),P2,iHighest(Symbol(),P2,MODE_HIGH,IPeriod,j));
    min=iLow(Symbol(),P2,iLowest(Symbol(),P2,MODE_LOW,IPeriod,j));
    pivot=(iClose(Symbol(),P2,j+1)+iClose(Symbol(),P2,j+2)+iClose(Symbol(),P2,j+3))/3;
    B=(Close[i]-((max + min + pivot)/3))/Point;


    ExtMapBuffer1[i]=0;
    ExtMapBuffer2[i]=0;
    
    if(A>0 && B>0)
    {
      ExtMapBuffer1[i]=(A+B);
      ExtMapBuffer2[i]= EMPTY_VALUE;
    }

    if(A<0 && B<0)
    {
      ExtMapBuffer2[i]=(A+B);
      ExtMapBuffer1[i]= EMPTY_VALUE;
    }
    
    i--;
  }
   if (alerts.On)
    {
      if (isNewBar()==true)
      {     
           if (alerts.OnCurrent) int forBar = 0;   else      forBar = 1;
           if ((ExtMapBuffer1[forBar]!= EMPTY_VALUE)&&(ExtMapBuffer2[forBar]== EMPTY_VALUE)&&(ExtMapBuffer1[forBar+1]!= EMPTY_VALUE)&&(ExtMapBuffer1[forBar+2]== EMPTY_VALUE)&&(ExtMapBuffer2[forBar+2]!= EMPTY_VALUE)) 
                 doAlert("Buy at "+DoubleToStr(Ask,Digits)+" !");
           if ((ExtMapBuffer2[forBar]!= EMPTY_VALUE)&&(ExtMapBuffer1[forBar]== EMPTY_VALUE)&&(ExtMapBuffer2[forBar+1]!= EMPTY_VALUE)&&(ExtMapBuffer2[forBar+2]== EMPTY_VALUE)&&(ExtMapBuffer1[forBar+2]!= EMPTY_VALUE)) 
                 doAlert("Sell at "+DoubleToStr(Bid,Digits)+" !");
             
       }
    }
  return(0);
 }
 
 
 void doAlert(string doWhat)
{
  string message;
  message =  StringConcatenate("WA scalping "+Symbol()," at ",TimeToStr(TimeLocal(),TIME_SECONDS)," - ",doWhat);
         if (alerts.Message) Alert(message);
        // if (alerts.Email)   SendMail("WAscalping ",message);
         if (alerts.Sound)   PlaySound("alert2.wav");
  
}

bool isNewBar()
{
  static datetime lastbar=0;
  datetime curbar = Time[0];

  if(lastbar!=curbar)
  {
     lastbar=curbar;
     return (true);
  }
  else
  {
     return(false);
  }
} 

 

please someone change this.

 

best Regards

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...