knowm / XChange

XChange is a Java library providing a streamlined API for interacting with 60+ Bitcoin and Altcoin exchanges providing a consistent interface for trading and accessing market data.
http://knowm.org/open-source/xchange/
MIT License
3.86k stars 1.94k forks source link

need advice to OKX future placeOrder #4728

Closed rizer1980 closed 1 year ago

rizer1980 commented 1 year ago

@makarid Hello I want to ask for advice. For now placing an order on OKX Futures does not work, since "posSide" should not contain "null", but "long" or "short". Your comment from there OkexAdapters.java

        .posSide(null) // PosSide should come as a input from an extended LimitOrder class to
        // support Futures/Swap capabilities of Okex, till then it should be null to
        // perform "net" orders

Can you explain/suggest about the extended LimitOrder class? It only occurs to me to implement this through somethinbg like order.hasFlag(OkexOrderFlags.LONG ))

Thanks!

douggie commented 1 year ago

Depends how you have your account set up on net or gross at okx. You can set an order flag on you okx to set it, if you need to keep.long and short positions separated.

On Mon, Jun 5, 2023, 4:05 PM Ilya Smirnov @.***> wrote:

@makarid https://github.com/makarid Hello I want to ask for advice. For now placing an order on OKX Futures does not work, since "posSide" should not contain "null", but "long" or "short". Your comment from there OkexAdapters.java

    .posSide(null) // PosSide should come as a input from an extended LimitOrder class to
    // support Futures/Swap capabilities of Okex, till then it should be null to
    // perform "net" orders

Can you explain/suggest about the extended LimitOrder class? It only occurs to me to implement this through somethinbg like order.hasFlag(OkexOrderFlags.LONG ))

Thanks!

— Reply to this email directly, view it on GitHub https://github.com/knowm/XChange/issues/4728, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBUO2Q53MKIXEW5W32QN2LXJXYT5ANCNFSM6AAAAAAY3DMMWM . You are receiving this because you are subscribed to this thread.Message ID: @.***>