Download MetaTrader 5

Invalid Volume / Not enough Money

To add comments, please log in or register
Filip
108
Filip  

Hi Forum ,


Im experimenting with Lot sizes... In my case I try to set the greatest lot allowed. To get this value , I call the function :


acc_info.MaxLotCheck(_Symbol,ORDER_TYPE_SELL,price,100);


which gives me a 7.03


If I do a Sell marketorder with this volume I get the following error:


2013.01.09 14:50:00    2011.05.02 00:36:18   not enough money [exchange sell 7.03 EURUSD at 1.48203]

2013.01.09 14:50:00    2011.05.02 00:36:18   CTrade::OrderSend:  [not enough money]


whats wrong here?


thanks for help...


Filip

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
enbo lu
Moderator
1958
enbo lu  
lynckmeister:

Hi Forum ,


Im experimenting with Lot sizes... In my case I try to set the greatest lot allowed. To get this value , I call the function :


acc_info.MaxLotCheck(_Symbol,ORDER_TYPE_SELL,price,100);


which gives me a 7.03


If I do a Sell marketorder with this volume I get the following error:


2013.01.09 14:50:00    2011.05.02 00:36:18   not enough money [exchange sell 7.03 EURUSD at 1.48203]

2013.01.09 14:50:00    2011.05.02 00:36:18   CTrade::OrderSend:  [not enough money]


whats wrong here?


thanks for help...


Filip








Hey, what is your "price" for  MaxLotCheck? 
Filip
108
Filip  
luenbo:
Hey, what is your "price" for  MaxLotCheck? 

see the code:


   MqlTick lt;
   SymbolInfoTick(Symbol(),lt);
   price=lt.bid;
  
   Alert("price now bid:",price);
  
   symbol_info.RefreshRates();

   double acc_lot_max  = acc_info.MaxLotCheck(_Symbol,ORDER_TYPE_SELL,price);

 (for selling!)

in my example the price is 1.48203

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
enbo lu
Moderator
1958
enbo lu  
lynckmeister:

see the code:


   MqlTick lt;
   SymbolInfoTick(Symbol(),lt);
   price=lt.bid;
  
   Alert("price now bid:",price);
  
   symbol_info.RefreshRates();

   double acc_lot_max  = acc_info.MaxLotCheck(_Symbol,ORDER_TYPE_SELL,price);

 (for selling!)

in my example the price is 1.48203




Maybe you should make the lot a little smaller than "acc_lot_max" because deviration should take into account when selling instantly.


To add comments, please log in or register