Does it work if you add instead of multiplying ? If yes then your issue is probably invalid price and you could try normalize double. (assuming based on that the first one passes the rest don't)
Also check the volume limits and the volume step (i'm not checking for volume step in the code) since you are multiplying
Cheers
PS :
If i recall how the volume step works , you can do this :
The strategy tester does not show any problems with invalid volumes, prices or stops. It seems to be a problem with my loop.
The strategy tester does not show any problems with invalid volumes, prices or stops. It seems to be a problem with my loop.
shouldn't these be NextPrice instead of positionOpenPrice and NextVolume instead of positionVolume ? I assume you are on a hedging account and not a netting one
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Does it work if you add instead of multiplying ? If yes then your issue is probably invalid price and you could try normalize double. (assuming based on that the first one passes the rest don't)
Also check the volume limits and the volume step (i'm not checking for volume step in the code) since you are multiplying
Cheers
PS :
If i recall how the volume step works , you can do this :
The strategy tester does not show any problems with invalid volumes, prices or stops. It seems to be a problem with my loop.
The strategy tester does not show any problems with invalid volumes, prices or stops. It seems to be a problem with my loop.
shouldn't these be NextPrice instead of positionOpenPrice and NextVolume instead of positionVolume ? I assume you are on a hedging account and not a netting one