Hello, I have placed a new order for BANKNIFTY 49900 CE at 10rs.
I wanted to place an SL-LIMIT order for that position at a price of 6 and the trigger price is 7.
This is the code for SL order
#place SL order
url = 'https://api-v2.upstox.com/order/place'
headers = {
'accept': 'application/json',
'Api-Version': '2.0',
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
data = {
"quantity": 15,
"product": "I",
"validity": "DAY",
"price": 3,
"tag": "dft",
"instrument_token": "NSE_FO|50564",
"order_type": "SL",
"transaction_type": "SELL",
"disclosed_quantity": 0,
"trigger_price": 4,
"is_amo": False
}
response = make_request('POST', url, headers=headers, data=data)
response['data']['order_id']
but when I run that above code, I can see an open order which I wanted but also, I can see a rejected order in the closed section says “You need to add Rs. 69573.41 in your account to place this trade.”
There is a SELL order also placing along with the sl-limit order.
Please check the below screenshot