Download MetaTrader 5

Questions about EA

To add comments, please log in or register
Juan Carlos Alcalde
1032
Juan Carlos Alcalde  

Hi, I have a few questions, hope someone can help me!

1) How to add max spread to the EA?

2) How to lock the EA into one trading account number, and can use only for that account?

Regards and thanks for the help! 

Osama Shaban
1555
Osama Shaban  

1)

input int MaxSpread = 30;
...
...
...

int start(){
...
...
...
   int spread = MarketInfo(Symbol(),MODE_SPREAD);  
   if(spread > MaxSpread){
      Comment("Spread is ",IntergetToStr(spread));
      return(0);
   }
...
...
...

 2)

To add comments, please log in or register