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:
order = client.create_order(
symbol='BNBBTC',
side=SIDE_BUY,
type=ORDER_TYPE_MARKET,
timeInForce=TIME_IN_FORCE_GTC,
quantity=100)
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
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
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