alpaca-java
alpaca-java copied to clipboard
Closing a position without parameters
Hello,
a position can be closed through the API without parameters: https://docs.alpaca.markets/reference/deleteopenposition-1
(qty or percentage). In this case, the total position is sold, which results in closing it entirely.
With the alpaca-java, it's not possible to close a full position, we have to pass both qty and percentage: https://javadoc.io/doc/net.jacobpeterson.alpaca/alpaca-java/latest/net/jacobpeterson/alpaca/openapi/trader/api/PositionsApi.html#deleteOpenPosition(java.lang.String,java.math.BigDecimal,java.math.BigDecimal)
Btw, javadoc mentions that those parameters are optional. But how to call deleteOpenPosition without passing those parameters ?
Thanks