I am having trouble using the OCO endpoint in the API. I’m not sure what I’m doing wrong, any help would be appreciated! For context, I’m using python with the requests library and sending a post request.
I keep getting this error message: <Response [400]> Invalid JSON: expected ‘{’, offset: 0x00000075
That is the same error I had. I also tried json.loads and many other things and nothing worked. I gave up because Tradovate wasn’t helping me and it seems to be a problem on their end. No excuse for bad documentation with a paid API. I agree Alexander is the only one who can help us now…
You should try to use json.dumps({ "dictionary": "items" }). I’m pretty sure that’s all you need to encode the python dictionary to JSON. However, json.loads parses a JSON string into a py dictionary.
I’ve tried json.dumps(), str(), etc, to no avail. however, based on this failure reason, it seems like I’m configuring something wrong here. could you advise?
Pro tip: pickmytrade.trade has been working wonders for me in automating trades between TradingView and Tradovate. If you’re into trading, you should definitely check it out