Is there a balance limit in the Strategy Tester?

 
Hello, when using the Strategy Tester my EA stops placing new orders once the balance has reached about 20 mio. The tester is still running and the progress bar expanding. I don't have any conditions in my EA which would cause it to stop trading so I think the strategy tester stops itself for some reason. Is there any upper limit in terms of account balance or tradable lot size or something else that could prevent the tester from trading. And is there a way to avoid that?
 
Do you check that your lot size is not exceeding the max allowed by your Broker ? that value is used by the Strategy Tester. Do you check return values from standard functions such as OrderSend ? do you report errors back to the log ?
 
Tweetle:
Hello, when using the Strategy Tester my EA stops placing new orders once the balance has reached about 20 mio. The tester is still running and the progress bar expanding. I don't have any conditions in my EA which would cause it to stop trading so I think the strategy tester stops itself for some reason. Is there any upper limit in terms of account balance or tradable lot size or something else that could prevent the tester from trading. And is there a way to avoid that?

I think the profit on my scambot is higher than your value, so that is not the limit.

https://www.mql5.com/en/forum/137121/page4#560454

 
Thank you, I found the error now. I'm getting error 131 due to exceeding the maximum Lot size. Is there a way to increase it for testing?
 
Tweetle:
Thank you, I found the error now. I'm getting error 131 due to exceeding the maximum Lot size. Is there a way to increase it for testing?

Firstly you need to modify your code so you check for MODE_MAXLOT and do not exceed it.

Then, as far as I can see, you have 2 options:

  • find a different Broker that allows a larger position size
  • edit the file that holds MODE_MAXLOT and increase it

 
Tweetle:
Thank you, I found the error now. I'm getting error 131 due to exceeding the maximum Lot size. Is there a way to increase it for testing?

On my small micro-account the MAXLOT is 2 whereas my standard account is 99999 lots, which should be enough!

Note that my demo account also has 99999 lots max but suffers from the liability that the spread is unrealistically low.

You could spend a lot of time hacking the binary files to change MAXLOT when you are offline from the broker, but you are better to spend that time on other matters. I would just scale your trades down or used fixed lot sizes for testing. A profitable system will still be profitable.

 
Tweetle:
Thank you, I found the error now. I'm getting error 131 due to exceeding the maximum Lot size. Is there a way to increase it for testing?
Or you could modify your code to open multiple orders when max lot is exceeded. From my code
    // If a trade size is bigger than maxlot, it must be split.
    double  lotStep     = MarketInfo(chart.symbol, MODE_LOTSTEP),   //IBFX= 0.1
            maxLot      = MarketInfo(chart.symbol, MODE_MAXLOT );   //IBFX=50.0
    for(int nSplit=MathCeil(lotsNew/maxLot); nSplit>0; nSplit--){
        double size = MathRound(lotsNew/lotStep/nSplit)*lotStep;
        lotsNew -= size;                            // 100.1 =33.34+33.34+33.33
        refreshRates();                             //  99.99=50.00+49.99
        orderSend...
 
WHRoeder:
Or you could modify your code to open multiple orders when max lot is exceeded. From my code
Well as an interesting little wrinkle on this, my micro account has a limit on the total open positions. It is not at all clear how this is readable from MT4, if at all. On this micro account you can only have 2 lots open across all positions. It is unclear if the tester would actually simulate this extra limit correctly.
Reason: