Download MetaTrader 5

alert message for 15 to 30 pips long bars

To add comments, please log in or register
Have you installed MetaTrader 5? Find out more about it!
ravibala
8
ravibala 2016.01.12 05:07 

Hi friends,


Good Day and a very happy new year. Iam a new member.


I need to get automatic alerts whenever the bar length is 15 to 30 pips in a 30 minute bar chart for specified currency pairs. How do I start. Pla help.

Thanks

Ravibala

Sherif Hasan
7290
Sherif Hasan 2016.01.12 08:02  

You can hire a programmer.

https://www.mql5.com/en/job

Freelance service at MQL5.com
Freelance service at MQL5.com
  • www.mql5.com
Orders for the development of automated trading programs
Snelle Moda
603
Snelle Moda 2016.01.12 09:34  

Hi

Try this example:


// Rates structure array for the data of the last complete bar 
   MqlRates MyBar[];                 
   CopyRates(Symbol(), PERIOD_M30, 1, 1, mrate);

// Distance between HIGH/LOW of 30 min BAR multiplied by pip factor value.
   double dHigh_Low_Distance = (MyBar[0].high - MyBar[0].low) * 10000;
   
// Check if distance is greater than or smaller than 30 pips
   if(dHigh_Low_Distance > 15 && dHigh_Low_Distance < 30)
         {
         Alert("The BAR value of symbol = ", Symbol(), " is between 15 and 30 pips ", dHigh_Low_Distance);        
         }
To add comments, please log in or register