which may has up to 11 decimals in converting to String.
In my application, I have passed notional like :
msg.order.notional.setScale(2, RoundingMode.DOWN).doubleValue()
However in Alpaca Paper Trading, it has caused issue repeatedly and let to order rejections, since it became something like : 135.69 --> 135.68941440804
(Not sure why same code doesn't cause issue in Alpaca Live Trading environment ?!)
Hi Peter,
Is it possible to release an update for "net.jacobpeterson.alpaca.rest.endpoint.orders.requestOrder() notional to String with 9 decimal truncation".
In requestOrder(), notional is passed in Double, when converting into Restful call :
which may has up to 11 decimals in converting to String. In my application, I have passed notional like : msg.order.notional.setScale(2, RoundingMode.DOWN).doubleValue()
However in Alpaca Paper Trading, it has caused issue repeatedly and let to order rejections, since it became something like : 135.69 --> 135.68941440804 (Not sure why same code doesn't cause issue in Alpaca Live Trading environment ?!)
This issue is logged on Alpaca Community Forum : https://forum.alpaca.markets/t/notional-increment-does-not-fulfill-minimum-pricing-criteria/12844/2
It seems this is beyond my control unless overriding requestOrder() myself.
Hope you can help! And appreciate everything you have done and for all your contributions to the community! Thx