Hi
leeb,
please tell me what broker you used for backtest ?
how minlot and how spread my friend...
I use Auto decimal with this code :
//===========================================
double MD = NormalizeDouble(MarketInfo(Symbol(), MODE_LOTSTEP), 2);
if (MD==0.01) lotsdigit=2;
else
if (MD==0.10) lotsdigit=1;
else lotsdigit=0;
LotsDigit=lotsdigit;
//===========================================
and I use MoneyManagement like this :
//=====================================
double GetLots()
{
double lots,MD,RM,FMM,MinLots,maxlot,maximlot,LotSize; int 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_M INLOT),2);
maxlot=NormalizeDouble(MarketInfo(Symbol(),MODE_MA XLOT),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);
}
//=====================================
Point code
//=====================================
double SetPoint()
{
double mSetPoint;
if (Digits==5 || Digits==3)
mSetPoint = 0.00001;
else
mSetPoint = 0.0001;
return(mSetPoint);
}
//=====================================
I hope you can give instructions for me if there is any wrong code...
