jnidzwetzki / bitfinex-v2-wss-api-java

This project provides a Java client library for the Bitfinex WebSocket API (v2). Public and private channels (candles, ticks, executed trades, (raw) orderbooks, orders, and wallets) are implemented.
Apache License 2.0
91 stars 55 forks source link

price_oco_stop parameter missing in order manager. #346

Open fotto412 opened 5 months ago

fotto412 commented 5 months ago

Hi Guys, I am trying to use OCO order type but can not find price_oco_stop field in order manager. It is used in LIMIT orders. There is, however, BitfinexOrderFlag.OCO flag defined. Can you please add like withPriceOcoStop method to the order manager. Note that price_oco_stop parameter should be added to the order request.

As always thank you all for the great job. Cheers.

wgolyakov commented 5 months ago

Example without withPriceOcoStop:

BitfinexOrder order = BitfinexOrderBuilder.create(pair, BitfinexOrderType.LIMIT, amount).
        withPrice(price).withOrderFlag(BitfinexOrderFlag.OCO).build();
order.setPriceOcoStop(BigDecimal.valueOf(price));
client.getOrderManager().placeOrder(order);