webull icon indicating copy to clipboard operation
webull copied to clipboard

get_history_orders() returning empty array

Open mustafamasody opened this issue 1 year ago • 1 comments

get_history_orders() returns empty for me. I modified a few files:

endpoints.py (line 144, orders function): def orders(self, account_id, page_size): # &startTime=1970-0-1 return f'{self.base_ustradebroker_url}/trade/v2/option/list?secAccountId={account_id}&dateType=ORDER&pageSize={page_size}&status='

webull.py (line 374, get_history_orders() function): ` def get_history_orders(self, status='All', count=20): ''' Historical orders, can be cancelled or filled status = Cancelled / Filled / Working / Partially Filled / Pending / Failed / All ''' headers = self.build_req_headers(include_trade_token=True, include_time=True) response = requests.post(self._urls.orders(self._account_id, count) + str(status), headers=headers, timeout=self.timeout, json={ "pageIndex": 1, "pageSize": 50, "conditions": [{ "key": "date", "values": ["CY"] }, { "key": "category", "values": ["all"] } ]

    })
    return response.json()`

My code: print("OPTIONS DATA: ") print(wb.get_history_orders())

Output: []

mustafamasody avatar Jun 06 '24 08:06 mustafamasody