简体   繁体   中英

Stop Limit Order in python-binance API

I'd like to place a Stop Limit Order as described on their site . In other words, I want to place a limit order to buy once a certain stop price is reached.

The API documentation only has one example of the client.create_order function which is a basic limit order. TheBinance documentation also doesn't give examples of this type of order.

I'm having trouble figuring out which settings to use for the client.create_order function through the API. Should the order type be STOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT ? What is the difference between these? In other words, can they both be used to Buy in different ways or do they each require a specific side ?

EDIT: I found some more clarification here . This explains that a stop-limit buy order triggers a "Take Profit" order once the target price is met. However, it doesn't specify if this is a Market or Limit order. If it's a limit order, the example doesn't make much sense because they offered way more money than the stop price. If it's a market order, there should be no need to specify a price at all. What am I missing?

I'd like to place a Stop Limit Order as described on their site . In other words, I want to place a limit order to buy once a certain stop price is reached.

The API documentation only has one example of the client.create_order function which is a basic limit order. TheBinance documentation also doesn't give examples of this type of order.

I'm having trouble figuring out which settings to use for the client.create_order function through the API. Should the order type be STOP_LOSS_LIMIT or TAKE_PROFIT_LIMIT ? What is the difference between these? In other words, can they both be used to Buy in different ways or do they each require a specific side ?

EDIT: I found some more clarification here . This explains that a stop-limit buy order triggers a "Take Profit" order once the target price is met. However, it doesn't specify if this is a Market or Limit order. If it's a limit order, the example doesn't make much sense because they offered way more money than the stop price. If it's a market order, there should be no need to specify a price at all. What am I missing?

order = client.create_order(
    symbol = symbol, 
    side = SIDE_BUY, 
    type = ORDER_TYPE_STOP_LOSS_LIMIT, 
    timeInForce = TIME_IN_FORCE_GTC, 
    quantity = quantity, 
    price = price, 
    stopPrice = stopPrice)

Reference:

https://binance-docs.github.io/apidocs/spot/en/#new-order-trade

https://github.com/sammchardy/python-binance/blob/master/binance/client.py

After facing this problem myself, I concluded that these types of orders are not possible for Spot trading. I may be wrong so quote me on that. To solve it myself I switched to Futures trading and it works without trouble:

link to my own similar question and brief instructions on how to use stop loss orders

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM