EA Money Management

 

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

Thank you

 
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.
 

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

 
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
Reason: