Opening position gives BadVolume error

Created at 06 Jun 2017, 18:48
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
obaum1@gmail.com's avatar

obaum1@gmail.com

Joined 06.06.2017

Opening position gives BadVolume error
06 Jun 2017, 18:48


Hey Guys :)

I'm getting BadVolume when trying to open\close position in volume like: 12,120, 13,542
Buy 12,000 do work..

how can i submit a request with volume of 12,120?
Or get the same result by other way.

Thanks!!


@obaum1@gmail.com
Replies

Mikro
07 Jun 2017, 17:30

RE:

obaum1@gmail.com said:

Hey Guys :)

I'm getting BadVolume when trying to open\close position in volume like: 12,120, 13,542
Buy 12,000 do work..

how can i submit a request with volume of 12,120?
Or get the same result by other way.

Thanks!!

Hi obaum,

you can't ;). For every symbol there are specific smalest dividers to which you trading volumes have to comply.

But using

ExecuteMarketOrder(...,Symbol.NormalizeVolume(12.120),...)

should do the job with some deviation from you calculated trade setup. But since you also have to compesate for for slippage in your algo it should do the job.

cheers

Mirko


@Mikro