This is my python OSO function and it is giving me a #400 Request
In this function im trying to place a buy limit order at 5515 with a TP of 5517
def place_oso_buy(buyprice):
url = “https://demo.tradovateapi.com/v1/order/placeoso”
headers = {
'Accept': 'application/json',
'Authorization': F'Bearer {get_access_token()}',
}
oso = {
# TP
"action": "Sell",
"orderType": "Limit",
"price": 5517,
}
}
intial = {
"accountSpec": 'username',
"accountId": 'id',
"action": "Buy",
"symbol": "ESU4",
"orderQty": 1,
'orderType': "Limit",
'price': buyprice,
'isAutomated': 'true',
"bracket1": oso,
}
response = requests.post(url, data=intial, headers=headers)
print(response)
place_oso_buy(buyprice=5515)