-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Order flag issue #347
Comments
I experimented a bit with the POS_CLOSE flag.
Working example:
|
Great!
But if there is already a buy(long) position as market order, your req
supposed to close it. In api documentation it says that that flag closes
any existing position of that pair. Your case looks exactly like closing a
buy position with a post only order. May be I am wrong.
Cheers,
Devrim
…On Sun, Apr 21, 2024 at 12:27 PM Vladimir Golyakov ***@***.***> wrote:
I experimented a bit with the POS_CLOSE flag.
1.
The error "pos_close: invalid" occurs if there is no position or the
amount is wrong.
Amount should be the same as in the position, but with the opposite
sign.
2.
LIMIT order causes error "RSN_ORD_TYPE was: ACTIVE (note:POSCLOSE)".
Apparently POS_CLOSE is not supported by LIMIT orders. But MARKET
order works.
Working example:
BitfinexOrder order = BitfinexOrderBuilder.create(pair, BitfinexOrderType.MARKET, -amount).
withOrderFlag(BitfinexOrderFlag.POS_CLOSE).build();
client.getOrderManager().placeOrder(order);
—
Reply to this email directly, view it on GitHub
<#347 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AG4QU5LIAYSZQCGC7IFU5P3Y6OBABAVCNFSM6AAAAABGMFCCL2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRXHE3TMMRRGE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I get following error when trying to creat LIMIT ORDER with POS_CLOSE flag:
01:33:16.742 [ tyrus-jdk-client-52] ERROR com.github.jnidzwetzki.bitfinex.v2.callback.channel.AccountInfoHandler - Got error message: [1713393193690,"on-req",null,null,[null,4711,1713393194482,"tNEOUSD",null,null,-4.45419698554374,null,"LIMIT",null,null,null,512,null,null,null,17.748,null,0,17.872236,null,null,null,0,0,null,null,null,null,null,null,null],null,"ERROR","pos_close: invalid"]
01:33:16.743 [ tyrus-jdk-client-52] ERROR com.github.jnidzwetzki.bitfinex.v2.callback.channel.account.info.NotificationHandler - State for order null is ERROR, reason is pos_close: invalid
The text was updated successfully, but these errors were encountered: