Huge tester bug? Error 131

 
Hi,
on numerous occassions and in different situations, I keep getting Error 131 - Invalid trade volume. Backtesting is working just fine and then at some point in time instead of opening new order the OrderSend keeps failing and giving this error. Metatrader build is 191.
Here are the outputs from the relevant functions and values of the trade volume requested:
Volume (lots to open): 127.1
Total open lots: 119.6
AccountBalance 1357252.5272
AccountEquity 1271049.049
AccountFreeMargin 1149674.7672
AccountMargin 207577.76
AccountLeverage 100

So, there is enough free margin, everything seems (to me) just fine. Is there something I'm missing or is this a real huge bug?
It almost completely cripples backtesting capabilities for my expert.

In hope that there is an explanation/solution...
 
Will someone from Metaquotes please comment on this?
 
I'm having the same problem but in build 195. Everything was working fine until I changed the dates of the backtesting window. After that I started getting error 131 after my expert tried to change the lot size (Maybe volume gets set to a constant number???). I tried changing the dates back to the original settings, but I still get the error. During this whole process I changed nothing but the dates in the backtester. I did not change my expert at all nor did I recompile anything. I changed no other settings besides the dates. Hope this helps.

Loopy
 
See sample in the article https://championship.mql5.com/2012/en/2006 after "//--- check min, max and step" line
 
Thanks for the link. I understand why I'm getting the error now. My lots are sized with a two digit precision, which doesn't fit into the parameters set on that page. My next question though is how is the lot precision set particularly in respect to the backtester? Lot sizes with a two digit precision were ok, but now they're not. Why? How is this number set? Lot size precision is different for different brokers isn't it? I know interbankfx offers microlot sizes and the lots I trade there are always set at a two digit precision and I never have problems. Shouldn't we be able to play with this number in the backtester? Is there a way to change it now? Thanks for your help so far!

Jack
 
See sample in the article https://championship.mql5.com/2012/en/2006 after "//--- check min, max and step" line


Hi Slawa, it's been a while since I posted the question.
If you take a look at my first post, you will see that the EA is trying to open 127.1 lots, therefore it is a single digit precision volume, which should work just fine.

Is there a max volume limit in backtesting (not for the championship, but in general)?
 
You can obtain maximal amount of lots using MarketInfo(Symbol(),MODE_MAXLOT) and analyze it
 
You can obtain maximal amount of lots using MarketInfo(Symbol(),MODE_MAXLOT) and analyze it


Thanks for the answer and sorry for the "huge bug" assertion in the topic.
I wasn't aware of this limitation and of the MAXLOT value so it seemed to me like a silly (but important) bug.

Is there a way to raise the MAXLOT value?
 
Is there a way to raise the MAXLOT value?

Of course. You can change integer offsets 148 bytes from begin of FXT-header. For your reference see "MQL4: FXTHeader"
 
Is there a way to raise the MAXLOT value?

Of course. You can change integer offsets 148 bytes from begin of FXT-header. For your reference see "MQL4: FXTHeader"


Great, thanks
Reason: