Python-binance: ORDER_TYPE_STOP_LOSS_LIMIT = 'STOP_LOSS_LIMIT'

Created on 28 Mar 2019  路  1Comment  路  Source: sammchardy/python-binance

Hello there!

Had a simple question. Trying to understand API syntax for placing a market order to go long any symbol, but using the ORDER_TYPE_STOP_LOSS_LIMIT = 'STOP_LOSS_LIMIT' in order to set a limit to exit and a stop to preserve loss downside at same time. Looking through the api docs, I do not see a clear example of this in practice.

Was thinking something like this:

Create market order first:

order = client.create_order(
symbol='BNBBTC',
side=SIDE_BUY,
type=ORDER_TYPE_MARKET,
timeInForce=TIME_IN_FORCE_GTC,
quantity=100)

Create stop loss limit order:

order = client.create_order(
symbol='BNBBTC',
side=SIDE_BUY,
type=ORDER_TYPE_STOP_LOSS_LIMIT,
timeInForce=TIME_IN_FORCE_GTC,
quantity=100,
limit=?
stop =?)

I have bolded above, because for the stop loss limit order, what do we define , or how do we define the actual stop price and limit price in terms of syntax? (what I have bolded above) Appreciate the kind help as always!

Best,

Sam

Most helpful comment

Hi.

Here are some examples of orders:

case the price drop down:

client.create_oco_order(
symbol='BTCUSDT',
side='SELL',
stopLimitTimeInForce='GTC',
quantity= 1,
stopPrice= 9891.55,
stopLimitPrice= 9890.55,
price= 9908.18)

if the price goes up:

client.create_oco_order(
symbol='BTCUSDT',
side='BUY',
stopLimitTimeInForce='GTC',
quantity= 1,
stopPrice= 9958.70,
stopLimitPrice= 9957.70,
price= 9908.18)

i hope this helps

>All comments

Hi.

Here are some examples of orders:

case the price drop down:

client.create_oco_order(
symbol='BTCUSDT',
side='SELL',
stopLimitTimeInForce='GTC',
quantity= 1,
stopPrice= 9891.55,
stopLimitPrice= 9890.55,
price= 9908.18)

if the price goes up:

client.create_oco_order(
symbol='BTCUSDT',
side='BUY',
stopLimitTimeInForce='GTC',
quantity= 1,
stopPrice= 9958.70,
stopLimitPrice= 9957.70,
price= 9908.18)

i hope this helps

Was this page helpful?
0 / 5 - 0 ratings

Related issues

noahwoodin picture noahwoodin  路  8Comments

rightx2 picture rightx2  路  4Comments

Wyctus picture Wyctus  路  6Comments

wattwei picture wattwei  路  6Comments

scalpounet picture scalpounet  路  6Comments