GithubHelp home page GithubHelp logo

Comments (2)

lucasege avatar lucasege commented on July 18, 2024 1

You simply need to provide a negative value for amount:
Excerpt from bitfinex-api-py/bfxapi/websockets/order_manager.py:89

async def submit_order(self, symbol, price, amount, market_type=Order.Type.LIMIT,
                           hidden=False, price_trailing=None, price_aux_limit=None,
                           oco_stop_price=None, close=False, reduce_only=False,
                           post_only=False, oco=False, time_in_force=None,
                           onConfirm=None, onClose=None, gid=None, *args, **kwargs):
        """
        Submit a new order
        @param gid: assign the order to a group identitfier
        @param symbol: the name of the symbol i.e 'tBTCUSD
        @param price: the price you want to buy/sell at (must be positive)
        @param amount: order size: how much you want to buy/sell,
          a negative amount indicates a sell order and positive a buy order
        @param market_type	Order.Type: please see Order.Type enum
          amount	decimal string	Positive for buy, Negative for sell

Also, the fourth parameter is market_type as in the type of the order: market, limit, Immediate-or-Cancel, etc. These are enumerated in bitfinex-api-py/bfxapi/models/order.py.

So for your example this is what you're looking for: await bfx.ws.submit_order('tBTCUSD', 10944, -0.01, Order.Type.EXCHANGE_MARKET).

Tested with my account and it works just fine, I would suggest closing the issue, unless this does not address it sufficiently. Let me know.

from bitfinex-api-py.

mprestonise avatar mprestonise commented on July 18, 2024

Thanks @lucasege, this is missing from the documentation.

from bitfinex-api-py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.