Download MetaTrader 5

EA Money Management

To add comments, please log in or register
SSX666
11
SSX666  

Is there a way to limit the max margin used by a EA to a fixed amount like $100?

Thank you

Alain Verleyen
Moderator
29908
Alain Verleyen  
SSX666:

Is there a way to limit the max margin used by a EA to a fixed amount like $100?

Thank you

It depends if you have to source code or not. With the code, no problem to get this limit.
SSX666
11
SSX666  

I do. But I am new to MT4. I got the EA from a third party and it keeps trading until has exhausted the margins. So I want it to stop to a specific margin value i.e. $100 is there a function/command to do so? Is something that a newbie can handle?

Thank you

Alain Verleyen
Moderator
29908
Alain Verleyen  
SSX666:

I do. But I am new to MT4. I got the EA from a third party and it keeps trading until has exhausted the margins. So I want it to stop to a specific margin value i.e. $100 is there a function/command to do so? Is something that a newbie can handle?

Thank you

Provided that you are using an USD account :

         if(AccountInfoDouble(ACCOUNT_MARGIN)>100)
         // You can trade
         else
         // You can't trade
To add comments, please log in or register