error 134

 

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

 

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

Check the initial deposit in the backtester. 

 
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 .
 

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