Error 4110: ERR_LONGS__NOT_ALLOWED

 
In backtesting I get the following error: ERR_LONGS__NOT_ALLOWED 4110 Longs are not allowed!

OK, longs are not allowed (that part of the message is clear) but why?
I haven't been able to find a solution by searching the forum.

Who can help?

Thanks in advance!
 

Tester window - Settings tab - Expert properties button - Testing tab - second line of parameters, "Positions". Select Long & Short

 
Thanks worked.
 
Slava:

Tester window - Settings tab - Expert properties button - Testing tab - second line of parameters, "Positions". Select Long & Short

This seems a pointless or flawed option.  If you set it to, say, "Long Only" and the EA tries to open a short, all that happens is that no more trades of either direction are permitted to open.

Surely the whole point of it should be that you want to test an EA with it only opening long (or short) positions.  If the EA has a property to enable you to test it in this way, then the settings option is not required.  If the EA does not have such a property, then the setting should simply ignore attempts to open short (or long) positions - not stop the test!

This is something which I check with every new release of terminal, but am disappointed when it is still not fixed.  I'm not sure how to raise a service request to get it fixed, but I would have thought it was so fundamental that it would have been done by now.

 
Mr David Frederick Roberts #:

This seems a pointless or flawed option.  If you set it to, say, "Long Only" and the EA tries to open a short, all that happens is that no more trades of either direction are permitted to open.

Surely the whole point of it should be that you want to test an EA with it only opening long (or short) positions.  If the EA has a property to enable you to test it in this way, then the settings option is not required.  If the EA does not have such a property, then the setting should simply ignore attempts to open short (or long) positions - not stop the test!

This is something which I check with every new release of terminal, but am disappointed when it is still not fixed.  I'm not sure how to raise a service request to get it fixed, but I would have thought it was so fundamental that it would have been done by now.

I found the best way around it is to use external global bools in your logic to toggle the long and/or short logic on and off. I actually never saw the error until today which landed me on this forum, and it was because I had the tester set for short only, but had my long position logic toggled on. Fortunately I created that toggle logic from the beginning. I agree with you about the frustration, but it may not be possible to just ignore a coded call to open a position of a certain type when that type is not set to be used in the tester, at least not without somehow disregarding the ordersend data created.