View Single Post
  #548 (permalink)  
Old 12-22-2008, 05:28 PM
_rdb_ _rdb_ is offline
Senior Member
 
Join Date: Aug 2008
Location: INDONESIA
Posts: 294
_rdb_ is on a distinguished road
Quote:
Originally Posted by crossy View Post
hello freinds,

First for Holger, Don't worry, you have an insurence for that, and
i'm happy that it was coucht fast enough.

second, I need help, I'm was using MINI account and the EA
worked nice, but now I'm checking a new broker, which workes
with only Standarts accounts. I got an error (131) "the order volume is bad".

I think that there is a problem with the following function, which is a part
of v1E.

Can someone help me, Thankes
code on v1e :
PHP Code:
//==========================================================================
double GetLots() 
{
   
double lots,MD,RM,FMM,MinLots,maxlot,maximlot,LotSizeint lotsdigit,LotsDigit;
   
LotSize MarketInfo(Symbol(), MODE_LOTSIZE);
   
MD NormalizeDouble(MarketInfo(Symbol(), MODE_LOTSTEP), 2); 
   
RM NormalizeDouble(MarketInfo(Symbol(), MODE_MARGINREQUIRED), 4);
//==========================================================================
   
if (MD==0.01lotsdigit=2;
   else
   if (
MD==0.10lotsdigit=1;
   else 
lotsdigit=0;
   
LotsDigit=lotsdigit;
//==========================================================================
   
if (LotsOptimized==truelots NormalizeDouble((AccountFreeMargin()*Risk/LotSize)/MaxTrades,LotsDigit);
   else 
lots=Lots;
   
MinLots=NormalizeDouble(MarketInfo(Symbol(),MODE_MINLOT),2);    
   
maxlot=NormalizeDouble(MarketInfo(Symbol(),MODE_MAXLOT),2);    
   if (
LotsDigit == 2MinLots 0.01
   if (
LotsDigit == 1MinLots 0.1
   if (
LotsDigit == 0MinLots 1
   if (
lots MinLotslots MinLots;  
   if (
maxlot MaxLotsmaximlot MaxLots;  else maximlot=maxlot;   
   if (
lots maximlotlots maximlot;     
   return (
lots);      
}
//========================================================================== 
Reply With Quote