how can i solve that i get Ordersend error 134. When i use strategy tester and acccount balance is 10dollar so i get ordersend error 134. But here the ea have to check money before ordersend.
So i have checked that with that function
bool CheckMoneyForTrade(string symb, double lots,int type)
double free_margin=AccountFreeMarginCheck(symb,type, lots);
//-- if there is not enough money
if(free_margin<=0 || AccountInfoDouble(ACCOUNT_MARGIN_FREE) <=10)
string oper=(type==OP_BUY)? "Buy":"Sell";
Print("Not enough money for ", oper," ",lots, " ", symb);
//--- checking successful
and this i call before OrderSend
if (!CheckMoneyForTrade(_Symbol,Entry_Amount,command)) return;//Check money for trade
But it works for Forex pairs but not for Indices and Gold. What can i do here.