Loop for predefined #of Limit Orders, each with more volume and higher prices - page 2

 
Lorentzos Roussos #:

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.

 
Johannes Vogel #:

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

          NextPrice=(positionOpenPrice*PriceDev*PriceDev*StepScale*StepScale);

          NextVolume=(positionVolume*VolumeScale*VolumeScale);