
12-22-2008, 05:28 PM
|
|
Senior Member
|
|
Join Date: Aug 2008
Location: INDONESIA
Posts: 294
|
|
Quote:
Originally Posted by crossy
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,LotSize; int lotsdigit,LotsDigit;
LotSize = MarketInfo(Symbol(), MODE_LOTSIZE);
MD = NormalizeDouble(MarketInfo(Symbol(), MODE_LOTSTEP), 2);
RM = NormalizeDouble(MarketInfo(Symbol(), MODE_MARGINREQUIRED), 4);
//==========================================================================
if (MD==0.01) lotsdigit=2;
else
if (MD==0.10) lotsdigit=1;
else lotsdigit=0;
LotsDigit=lotsdigit;
//==========================================================================
if (LotsOptimized==true) lots = 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 == 2) MinLots = 0.01;
if (LotsDigit == 1) MinLots = 0.1;
if (LotsDigit == 0) MinLots = 1;
if (lots < MinLots) lots = MinLots;
if (maxlot > MaxLots) maximlot = MaxLots; else maximlot=maxlot;
if (lots > maximlot) lots = maximlot;
return (lots);
}
//==========================================================================
|