mt4 EA backtesting lot size mistake..

Erdinc Ozkan
133

hello, i have big problem ea lot size..


im write 0.07 lots but backtesting 0.10 lots

im write 0.12 lots but backtesting 0.20 lots...

example: 0.46 lots   after backtesting 0.50 lots..


interesting.


my account  fxtime  eurusd 1:500 laverage   1 min testing...


and but I've used this robot before and there was no such error. how can I fix this?



 




0.10 LOT







0.07 LOT

Seng Joo Thio
1855
Seng Joo Thio  
Erdinc Ozkan:

hello, i have big problem ea lot size..

im write 0.07 lots but backtesting 0.10 lots

im write 0.12 lots but backtesting 0.20 lots...

example: 0.46 lots   after backtesting 0.50 lots..

interesting.

my account  fxtime  eurusd 1:500 laverage   1 min testing...

and but I've used this robot before and there was no such error. how can I fix this?

Have you checked the value of "MarketInfo(_Symbol,MODE_MINLOT)"?

if it's 0.1, that is the answer... if it's 0.01, then we'll need to see the codes from where you set your lots to where you send your order before concluding anything.

Erdinc Ozkan
133
Erdinc Ozkan  

hi, thank you for answer me.

I made the fix but the problem is still the same

Backtest between 0.01 and 0.05 does not work.
From 0.06 to 0.09 doing the backtest 0.10






extern string lot_set="///////////////Lot settings///////////////////";
extern double Lot=0.02;                  ////1
extern double Lot_multiplier=4;         ////6
extern double max_lot = 100;              ////10
extern double min_lot = 0.01;
///////////// LOT /////////////////
   double Lotss=Lot;    CountOpenedPositions_f();    Lotss=Lot* MathPow(Lot_multiplier,Orders_Total); //user limit    if(max_lot>0 && Lotss>max_lot) Lotss=max_lot;    if(min_lot>0 && Lotss<min_lot) Lotss=min_lot; //broker limit    double Min_Lot =MarketInfo(Symbol(),MODE_MINLOT);    double Max_Lot =MarketInfo(Symbol(),MODE_MAXLOT);    if(Lotss<Min_Lot) Lotss=Min_Lot;    if(Lotss>Max_Lot) Lotss=Max_Lot;
Erdinc Ozkan
133
Erdinc Ozkan  

im fixed try

///////////// LOT /////////////////
   double Lotss=Lot;
   CountOpenedPositions_f();
   Lotss=Lot*MathPow(Lot_multiplier,Orders_Total);
//user limit
   if(max_lot>0 && Lotss>max_lot) Lotss=max_lot;
   if(min_lot>0 && Lotss<min_lot) Lotss=min_lot;
//broker limit

   double Min_Lot =MarketInfo(_Symbol,MODE_MINLOT);
   double Max_Lot =MarketInfo(Symbol(),MODE_MAXLOT);
   if(Lotss<Min_Lot) Lotss=Min_Lot;
   if(Lotss>Max_Lot) Lotss=Max_Lot;


but still dosnt work.. same problem

Seng Joo Thio
1855
Seng Joo Thio  
Erdinc Ozkan:

I made the fix but the problem is still the same

Backtest between 0.01 and 0.05 does not work.
From 0.06 to 0.09 doing the backtest 0.10

I meant, why not add this line somewhere in your code:

Print ("Minimum Lot = ", MarketInfo(Symbol(),MODE_MINLOT));

And check the log to confirm whether your account limits your minimum lotsize to 0.1, rather than 0.01.

Seng Joo Thio
1855
Seng Joo Thio  
Erdinc Ozkan:

all code here:

Well, since you included the codes, I did a run, and this is what I get:


Which means the problem should be with your account - your broker has set the minimum lot size to 0.1, not 0.01. The 'Print' statement I suggested that you add would have helped you see it for yourself...

Erdinc Ozkan
133
Erdinc Ozkan  
The program has been running for a long time. I reinstalled mt4 and it was no such problem. It worked on xm and fxpro
Erdinc Ozkan
133
Erdinc Ozkan  

thank you for help. i must call my broker :)


becouse other  broker account working..