tedchou12 / webull

Unofficial APIs for Webull.
MIT License
597 stars 183 forks source link

wb.place_order_otoco needs additional error check.... for PAPER_TRADE account. #275

Closed tlh45342 closed 2 years ago

tlh45342 commented 2 years ago

FROM (or about 523) if I print "result1" I get

{'msg': 'Inner server error', 'traceId': '7d3e987458fc4fbda6aadb481050ee15', 'code': 'trade.secAcct.mismatch.with.user', 'data': {}, 'success': False}

This is from my call as follows

Traceback (most recent call last): File "/opt/tradinghook/test2.py", line 14, in a = wb.place_order_otoco(stock='AAPL', price=90.0, quant=2, limit_profit_price=100.0, stop_loss_price=80.0) File "/usr/local/lib/python3.9/dist-packages/webull/webull.py", line 523, in place_order_otoco if result1['forward'] :

result1 did not come back with key "forward" which I guess was expected.

Crap.. I see the light now. I am betting I did this on the webull_papertrade account... and I am betting webull won't let you do a OTOCO on the paper trade account.

I would call this low hanging fruit ... but just so you know dumb people like me might try a stunt like this.

tedchou12 commented 2 years ago

Crap.. I see the light now. I am betting I did this on the webull_papertrade account... and I am betting webull won't let you do a OTOCO on the paper trade account.

Yes. Webull doesn't let you do otoco and limit with paper trade I believe.