Download MetaTrader 5
To add comments, please log in or register
Enable MQL5 Storage to store your source codes. It is free!
Zainab El Issaoui
570
Zainab El Issaoui 2016.01.11 19:53 
Help me please finish my EA
Mq4 need a code that makes my EA only work on EURUSD M30
Only work in this currency pair and if they try to work in another Time Frame or another currency pair does not work and the alert is reflected in the Journal of MT4

Thank you
Alain Verleyen
Moderator
29638
Alain Verleyen 2016.01.11 20:07  
Zainab El Issaoui:
Help me please finish my EA
Mq4 need a code that makes my EA only work on EURUSD M30
Only work in this currency pair and if they try to work in another Time Frame or another currency pair does not work and the alert is reflected in the Journal of MT4

Thank you
It's 10 USD job, you can ask on the freelance section.
Snelle Moda
598
Snelle Moda 2016.01.11 20:13  

Hi put this in the beginning of your code.


// Check if current symbol is different then EURUSD.
// Check if current chart period is different then M30 
   if(Symbol() != "EURUSD" || Period() != PERIOD_M30)
         {         
         Alert("Wrong symbol or chart period.");            
         return;                
         }
Zainab El Issaoui
570
Zainab El Issaoui 2016.01.11 20:23  
Snelle Moda:

Hi put this in the beginning of your code.


Thanks but no work ... The alert appears but the robot makes operations ...
I just want to open operations in EURUSD M30

  Thank you
Siti Latifah
6214
Siti Latifah 2016.01.11 20:29  
Zainab El Issaoui:
Thanks but no work ... The alert appears but the robot makes operations ...
I just want to open operations in EURUSD M30

  Thank you

put the code in the beginning of start() function.

if(Symbol() != "EURUSD" || Period() != PERIOD_M30)
         {         
         Alert("Wrong symbol or chart period.");            
         return(0);                
         }
Zainab El Issaoui
570
Zainab El Issaoui 2016.01.11 20:36  
Siti Latifah:

put the code in the beginning of start() function.

Thanks to the 2 support ... and works well ...
A hug from Spain
Osama Shaban
1348
Osama Shaban 2016.01.11 23:56  

As you need it to be printed in the journal, Print( ) is used instead of Alert( ) ...

if(Symbol() != "EURUSD" || Period() != PERIOD_M30)
         {         
         Print("Wrong symbol or chart period.");            
         return(0);                
         }
/
To add comments, please log in or register