Mq4 need a code that makes my EA only work on EURUSD M30

 
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
 
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.
 

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;                
         }
 
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
 
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);                
         }
 
Siti Latifah:

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

Thanks to the 2 support ... and works well ...
A hug from Spain
 

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);                
         }
 

Is there away to include multiple instruments i.e. different brokers have different prefix / suffix "EURUSD" "EURUSDSB" etc?

Thanks

 
Steve: Is there away to include multiple instruments i.e. different brokers have different prefix / suffix "EURUSD" "EURUSDSB" etc?

Yes, just read the following post: https://www.mql5.com/en/forum/215391#comment_5738146

My code at that post includes a function "boolRestrictSymbols()" for doing exactly what you described!

EA limit code
EA limit code
  • 2017.09.10
  • www.mql5.com
help me i need to limt my Ea to work under certain accounts that i choose...
 

is it possible to convert demo ea to live? i have a good script

 
Alain Verleyen:
It's 10 USD job, you can ask on the freelance section.

 

I believe the minimum budget is now $30.
Reason: