Open apimir opened 11 months ago
In the last line, you need a lmtPrice instead of just price, I believe. Lmk if it works
it's did not work lmtPrice
doesn't exist for place_order
:
>>> help(wb.place_order)
Help on method place_order in module webull.webull:
place_order(stock=None, tId=None, price=0, action='BUY', orderType='LMT', enforce='GTC', quant=0, outsideRegularTradingHour=True, stpPrice=None, trial_value=0, trial_type='DOLLAR') method of webull.webull.webull instance
Place an order
price: float (LMT / STP LMT Only)
action: BUY / SELL / SHORT
ordertype : LMT / MKT / STP / STP LMT / STP TRAIL
timeinforce: GTC / DAY / IOC
outsideRegularTradingHour: True / False
stpPrice: float (STP / STP LMT Only)
trial_value: float (STP TRIAL Only)
trial_type: DOLLAR / PERCENTAGE (STP TRIAL Only)
But I have tried with another stock CNVS
and it's works fine:
>>> wb.place_order(stock='CNVS', price='1', stpPrice='1.1', action='SELL', orderType='STP LMT', quant=1, enforce='GTC', outsideRegularTradingHour=False)
{'success': True, 'data': {'orderId': 'CRG6MP450248911EU01PPJM308'}}
I guess in first my post I tried to set wrong price, I mean according to this picture:
You can't set Stop Loss Price
below Stop limit Price
and Stop Limit Price
can't be more than your Buy Price
I think we can close the issue.
I will try to use these WeBull API this week. Any new updates before I run the code?
I can't set stop orders:
How to correct way to use place_order with action=SELL and orderType='STP'?
With orderType='LMT' everything works fine.