[Invalid Volume] error when using close partially block
-
Hello Gents
I have an EA that closes some profits out based on the number of pips travelled however I keep getting these errors when backtesting.
I had my lots set to 1 on EURUSD for testing and at some point the EA has to close part of the trade.2020.02.14 17:57:15.141 Trades '50182356': failed market buy 0.147 EURUSD, close #36912598 sell 0.49 EURUSD 1.08815 [Invalid volume]
This is on MT5. What do I need to do to stop this. Can't the system calculate 50% of the current volume?
-
Yes, the systame can, but maybe your broker doesn't. Are you sure that partial close is possible in your broker?
-
@jzfusion Check symbol's specification for minimum lot size and lot step. Looks like it's 1 lot and hence cannot be closed below.
-
That is a common reason behinh that issue. Maube you should change your broker.
-
@l-andorrà
Yes, but on mine you can decrease the minimum lot size on a specified symbol by switching to macro or even nano account. Maybe can help -
Sure. Try it and let us know.
-
Hello people,
I´m having the same problem. If I test the EA on a demo account the partial closing is automatically rounded up, but not on the backtest. Do you know a way to round it up directly fron the EA?
Thank you.
-
You will need to create a variable and then follow the idea here:
https://fxdreema.com/forum/topic/8188/how-can-i-round-a-number