Download MetaTrader 5

error 134

To add comments, please log in or register
MQL5 library has more than 1500 apps already. Contribute your own one!
Amin Asgari Hezaveh
19842
Amin Asgari Hezaveh 2016.07.28 08:36 

Hello

when i want test my EA with minimum deposit $1 , i see error 134 (not enough money) , i haven't any inputs on my EA for initial deposit , guide me please .

double Lot_Cal()
{
double l=(NormalizeDouble(((AccountBalance()* Percent_risk/100) )*0.01,Max_Digit));
if (l<Min_Lot) l=Min_Lot;
if (l>MarketInfo(Symbol(),MODE_MAXLOT)) l = MarketInfo(Symbol(),MODE_MAXLOT);
if (Money_management) return(l);

return(lotsize);

Osama Shaban
1448
Osama Shaban 2016.07.28 12:24  

I guess you are talking about this error during the backtesting.

Check the initial deposit in the backtester. 

Amin Asgari Hezaveh
19842
Amin Asgari Hezaveh 2016.07.28 20:22  
Osama Shaban:

I guess you are talking about this error during the backtesting.

Check the initial deposit in the backtester. 

yes in backtests . i set $1 from testing , i need my EA work on minimum deposits .
Jose Francisco Casado Fernandez
2405
Jose Francisco Casado Fernandez 2016.07.30 12:20  

You will not be able to open a position if your free margin is lower than the required margin for min allowed lot.

To check this, if you are coding on mql4,  you could check if: lot * MarketInfo(_Symbol, MODE_MARGINREQUIRED) < AccountInfoDouble(ACCOUNT_MARGIN_FREE)

Or you could use:

AccountFreeMarginCheck(

string  symbol,     // symbol  

int     cmd,        // trade operation

double  volume      // volume

   );

https://docs.mql4.com/account/accountfreemargincheck


Regards




AccountFreeMarginCheck - Account Information - MQL4 Reference
AccountFreeMarginCheck - Account Information - MQL4 Reference
  • docs.mql4.com
AccountFreeMarginCheck - Account Information - MQL4 Reference
To add comments, please log in or register