Closed cnoffsin closed 2 years ago
I am also having this problem. I am going to guess it is an endpoint implementation issue
Added some print statements here
response2 = requests.post(self._urls.place_otoco_orders(self._account_id), json=data2, headers=headers, timeout=self.timeout)
# print('Resp 2: {}'.format(response1))
result2=response2.json
print(result2)
return response2.json()
And got:
{'msg': 'Inner server error', 'traceId': 'REDACTED', 'code': 'trade.secAcct.mismatch.with.user', 'data': {}, 'success': False}
Really sorry I had paper_webull() imported at a lower spot in my script.
Per issue 275 you cannot do otoco orders with paper_webull.
Thanks for looking!
Yeah, paper_webull() won't allow otoco orders. I should've thought to mention. Did fixing your print statement allow the order to now go through?
The print statement gave me this message:
{'msg': 'Inner server error', 'traceId': 'REDACTED', 'code': 'trade.secAcct.mismatch.with.user', 'data': {}, 'success': False}
Which helped me search the github issues on the project and find the other issue.
Otherwise I was just getting 'forward' as a response which didn't make it so I could troubleshoot it.
I have gotten it to give some other output:
{'forward': False, 'checkResultList': [{'code': 'trade.webull.DAY_ORDER_NOT_ALLOWED_AFT_CORE_TIME_LIMIT', 'msg': "Regular trading hours has ended. If you would like to place this order, please select the Exten
Which shows this without the print statement I think:
Regular trading hours has ended. If you would like to place this order, please select the Extended Hours Tab; or you can change the Time-in-Force to Good 'Til Canceled.
Same for this:
{'forward': False, 'checkResultList': [{'code': 'trade.order.param.error', 'msg': 'Invalid request parameter'}]}
trade.order.param.error
Invalid request parameter
So I think the json output for that trade.secAcct.mismatch.with.user just isn't caught.
I have tried to run:
And it doesn't place the orders, just seems to output:
I made sure I wasn't in paper mode and I am able to place orders with wb_place_order OK.
I tried to dig a bit into the response headers but haven't been able to find a reason why it doesn't work yet since I can't seem to figure out how to get it to output more of the response json for some more info.