webull-openapi-python-sdk 2.0.18__py3-none-any.whl → 3.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- samples/screener/screener_client.py +55 -2
- webull/__init__.py +1 -1
- webull/core/__init__.py +1 -1
- webull/core/http/initializer/config/bean/query_config_request.py +1 -1
- webull/core/http/initializer/token/bean/check_token_request.py +1 -1
- webull/core/http/initializer/token/bean/create_token_request.py +1 -1
- webull/core/http/initializer/token/bean/refresh_token_request.py +1 -1
- webull/data/__init__.py +1 -1
- webull/data/data_streaming_client.py +3 -1
- webull/data/internal/quotes_client.py +2 -2
- webull/data/quotes/fundamentals.py +19 -0
- webull/data/quotes/instrument.py +148 -1
- webull/data/quotes/screener.py +179 -0
- webull/data/quotes/subscribe/notice_decoder.py +34 -0
- webull/data/quotes/subscribe/payload_type.py +2 -1
- webull/data/request/get_analyst_rating_request.py +2 -1
- webull/data/request/get_analyst_target_price_request.py +2 -1
- webull/data/request/get_batch_historical_bars_request.py +1 -1
- webull/data/request/get_capital_flow_request.py +1 -1
- webull/data/request/get_company_profile_request.py +2 -1
- webull/data/request/get_corp_action_request.py +1 -1
- webull/data/request/get_crypto_historical_bars_request.py +1 -1
- webull/data/request/get_crypto_instruments_request.py +5 -1
- webull/data/request/get_crypto_instruments_request_v2.py +41 -0
- webull/data/request/get_crypto_snapshot_request.py +1 -1
- webull/data/request/get_dividend_calendar_request.py +1 -1
- webull/data/request/get_earnings_calendar_request.py +1 -1
- webull/data/request/get_eod_bars_request.py +1 -1
- webull/data/request/get_event_bars_request.py +1 -1
- webull/data/request/get_event_depth_request.py +2 -1
- webull/data/request/get_event_events_request.py +2 -1
- webull/data/request/get_event_instrument_request.py +5 -1
- webull/data/request/get_event_instrument_request_v2.py +45 -0
- webull/data/request/get_event_series_categories.py +2 -1
- webull/data/request/get_event_series_request.py +5 -1
- webull/data/request/get_event_series_request_v2.py +37 -0
- webull/data/request/get_event_snapshot_request.py +2 -1
- webull/data/request/get_event_tick_request.py +2 -1
- webull/data/request/get_financials_alert_request.py +1 -1
- webull/data/request/get_financials_balance_sheet_request.py +1 -1
- webull/data/request/get_financials_cashflow_request.py +1 -1
- webull/data/request/get_financials_income_request.py +1 -1
- webull/data/request/get_financials_indicators_request.py +1 -1
- webull/data/request/get_footprint_request.py +1 -1
- webull/data/request/get_forecast_eps_request.py +1 -1
- webull/data/request/get_fund_allocation_request.py +1 -1
- webull/data/request/get_fund_brief_request.py +1 -1
- webull/data/request/get_fund_dividends_request.py +5 -1
- webull/data/request/get_fund_dividends_request_v2.py +35 -0
- webull/data/request/get_fund_files_request.py +1 -1
- webull/data/request/get_fund_holdings_request.py +1 -1
- webull/data/request/get_fund_net_value_request.py +1 -1
- webull/data/request/get_fund_performance_request.py +1 -1
- webull/data/request/get_fund_rating_request.py +1 -1
- webull/data/request/get_fund_splits_request.py +1 -1
- webull/data/request/get_futures_depth_request.py +1 -1
- webull/data/request/get_futures_footprint_request.py +1 -1
- webull/data/request/get_futures_historical_bars_request.py +1 -1
- webull/data/request/get_futures_instruments_by_code_request.py +1 -1
- webull/data/request/get_futures_instruments_request.py +2 -1
- webull/data/request/get_futures_product_class.py +2 -1
- webull/data/request/get_futures_products_request.py +2 -1
- webull/data/request/get_futures_snapshot_request.py +1 -1
- webull/data/request/get_futures_tick_request.py +1 -1
- webull/data/request/get_historical_bars_request.py +1 -1
- webull/data/request/get_industry_comparison_request.py +1 -1
- webull/data/request/get_instruments_request.py +5 -1
- webull/data/request/get_instruments_request_v2.py +44 -0
- webull/data/request/get_noii_bars_request.py +1 -1
- webull/data/request/get_noii_snapshot_request.py +2 -1
- webull/data/request/get_option_bars_request.py +1 -1
- webull/data/request/get_option_contracts_request.py +5 -1
- webull/data/request/get_option_contracts_request_v2.py +78 -0
- webull/data/request/get_option_snapshot_request.py +1 -1
- webull/data/request/get_option_tick_request.py +1 -1
- webull/data/request/get_quotes_request.py +1 -1
- webull/data/request/get_sec_filings_request.py +1 -1
- webull/data/request/get_snapshot_request.py +1 -1
- webull/data/request/get_tick_request.py +1 -1
- webull/data/request/screener/get_52whl_request.py +4 -0
- webull/data/request/screener/get_52whl_request_v2.py +45 -0
- webull/data/request/screener/get_gainers_losers_request.py +5 -1
- webull/data/request/screener/get_gainers_losers_request_v2.py +94 -0
- webull/data/request/screener/get_high_dividend_request.py +4 -0
- webull/data/request/screener/get_high_dividend_request_v2.py +41 -0
- webull/data/request/screener/get_market_sectors_detail_request.py +4 -0
- webull/data/request/screener/get_market_sectors_detail_request_v2.py +47 -0
- webull/data/request/screener/get_market_sectors_request.py +5 -1
- webull/data/request/screener/get_market_sectors_request_v2.py +43 -0
- webull/data/request/screener/get_most_active_request.py +5 -1
- webull/data/request/screener/get_most_active_request_v2.py +92 -0
- webull/data/request/subscribe_request.py +1 -1
- webull/data/request/unsubscribe_request.py +1 -1
- webull/data/request/watchlist/add_watchlist_instruments_request.py +2 -1
- webull/data/request/watchlist/create_watchlist_request.py +1 -1
- webull/data/request/watchlist/delete_watchlist_request.py +1 -1
- webull/data/request/watchlist/get_watchlist_instruments_request.py +2 -1
- webull/data/request/watchlist/get_watchlist_request.py +1 -1
- webull/data/request/watchlist/remove_watchlist_instruments_request.py +2 -1
- webull/data/request/watchlist/update_watchlist_instruments_request.py +2 -1
- webull/data/request/watchlist/update_watchlist_request.py +1 -1
- webull/trade/__init__.py +1 -1
- webull/trade/request/cancel_order_request.py +1 -1
- webull/trade/request/get_account_balance_request.py +1 -1
- webull/trade/request/get_account_positions_request.py +1 -1
- webull/trade/request/get_account_profile_request.py +1 -1
- webull/trade/request/get_activities_request.py +4 -0
- webull/trade/request/get_activities_request_v2.py +41 -0
- webull/trade/request/get_app_subscriptions.py +1 -1
- webull/trade/request/get_open_orders_request.py +1 -1
- webull/trade/request/get_order_detail_request.py +1 -1
- webull/trade/request/get_today_orders_request.py +1 -1
- webull/trade/request/get_trade_calendar_request.py +1 -1
- webull/trade/request/get_trade_instrument_detail_request.py +1 -1
- webull/trade/request/get_trade_security_detail_request.py +1 -1
- webull/trade/request/get_tradeable_instruments_request.py +1 -1
- webull/trade/request/palce_order_request.py +1 -1
- webull/trade/request/place_order_request.py +1 -1
- webull/trade/request/place_order_request_v2.py +1 -1
- webull/trade/request/replace_order_request.py +1 -1
- webull/trade/request/replace_order_request_v2.py +1 -1
- webull/trade/request/v2/cancel_option_request.py +1 -1
- webull/trade/request/v2/cancel_order_request.py +1 -1
- webull/trade/request/v2/get_account_balance_request.py +1 -1
- webull/trade/request/v2/get_account_list.py +1 -3
- webull/trade/request/v2/get_account_list_request.py +1 -3
- webull/trade/request/v2/get_account_position_details_request.py +4 -0
- webull/trade/request/v2/get_account_position_details_request_v2.py +31 -0
- webull/trade/request/v2/get_account_positions_request.py +1 -1
- webull/trade/request/v2/get_order_detail_request.py +1 -1
- webull/trade/request/v2/get_order_executions_request.py +5 -0
- webull/trade/request/v2/get_order_executions_request_v2.py +35 -0
- webull/trade/request/v2/get_order_history_request.py +1 -1
- webull/trade/request/v2/get_order_open_request.py +1 -1
- webull/trade/request/v2/palce_order_request.py +1 -1
- webull/trade/request/v2/place_option_request.py +1 -1
- webull/trade/request/v2/place_order_request.py +1 -1
- webull/trade/request/v2/preview_option_request.py +1 -1
- webull/trade/request/v2/preview_order_request.py +1 -1
- webull/trade/request/v2/replace_option_request.py +1 -1
- webull/trade/request/v2/replace_order_request.py +1 -1
- webull/trade/request/v3/batch_place_order_request.py +1 -1
- webull/trade/request/v3/cancel_order_request.py +1 -1
- webull/trade/request/v3/get_order_detail_request.py +1 -1
- webull/trade/request/v3/get_order_history_request.py +5 -1
- webull/trade/request/v3/get_order_history_request_v2.py +35 -0
- webull/trade/request/v3/get_order_open_request.py +5 -1
- webull/trade/request/v3/get_order_open_request_v2.py +27 -0
- webull/trade/request/v3/place_order_request.py +1 -1
- webull/trade/request/v3/preview_order_request.py +1 -1
- webull/trade/request/v3/replace_order_request.py +1 -1
- webull/trade/trade/activity.py +33 -0
- webull/trade/trade/v2/account_info_v2.py +24 -0
- webull/trade/trade/v3/{order_opration_v3.py → order_operation_v3.py} +94 -1
- webull/trade/trade_client.py +1 -1
- {webull_openapi_python_sdk-2.0.18.dist-info → webull_openapi_python_sdk-3.0.0.dist-info}/METADATA +1 -1
- {webull_openapi_python_sdk-2.0.18.dist-info → webull_openapi_python_sdk-3.0.0.dist-info}/RECORD +161 -143
- {webull_openapi_python_sdk-2.0.18.dist-info → webull_openapi_python_sdk-3.0.0.dist-info}/WHEEL +0 -0
- {webull_openapi_python_sdk-2.0.18.dist-info → webull_openapi_python_sdk-3.0.0.dist-info}/licenses/LICENSE +0 -0
- {webull_openapi_python_sdk-2.0.18.dist-info → webull_openapi_python_sdk-3.0.0.dist-info}/licenses/NOTICE +0 -0
- {webull_openapi_python_sdk-2.0.18.dist-info → webull_openapi_python_sdk-3.0.0.dist-info}/top_level.txt +0 -0
|
@@ -18,7 +18,7 @@ from webull.core.request import ApiRequest
|
|
|
18
18
|
|
|
19
19
|
class TradeInstrumentDetailRequest(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/trade/instrument", version='
|
|
21
|
+
ApiRequest.__init__(self, "/trade/instrument", version='v3', method="GET", query_params={})
|
|
22
22
|
|
|
23
23
|
def set_instrument_id(self, instrument_id):
|
|
24
24
|
self.add_query_param("instrument_id", instrument_id)
|
|
@@ -18,7 +18,7 @@ from webull.core.request import ApiRequest
|
|
|
18
18
|
|
|
19
19
|
class TradeSecurityDetailRequest(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/trade/security", version='
|
|
21
|
+
ApiRequest.__init__(self, "/trade/security", version='v3', method="GET", query_params={})
|
|
22
22
|
|
|
23
23
|
def set_account_id(self, account_id):
|
|
24
24
|
self.add_query_param("account_id", account_id)
|
|
@@ -18,7 +18,7 @@ from webull.core.request import ApiRequest
|
|
|
18
18
|
|
|
19
19
|
class TradeableInstrumentRequest(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/trade/instrument/tradable/list", version='
|
|
21
|
+
ApiRequest.__init__(self, "/trade/instrument/tradable/list", version='v3', method="GET", query_params={})
|
|
22
22
|
|
|
23
23
|
def set_last_instrument_id(self, last_security_id):
|
|
24
24
|
self.add_query_param("last_security_id", last_security_id)
|
|
@@ -22,7 +22,7 @@ class PlaceOrderRequest(ApiRequest):
|
|
|
22
22
|
Deprecated. Use :class:`PlaceOrderRequestV2` instead.
|
|
23
23
|
"""
|
|
24
24
|
def __init__(self):
|
|
25
|
-
ApiRequest.__init__(self, "/trade/order/place", version='
|
|
25
|
+
ApiRequest.__init__(self, "/trade/order/place", version='v3', method="POST", body_params={})
|
|
26
26
|
self._stock_order = {}
|
|
27
27
|
self.add_body_params("stock_order", self._stock_order)
|
|
28
28
|
|
|
@@ -24,7 +24,7 @@ class PlaceOrderRequest(ApiRequest):
|
|
|
24
24
|
Deprecated. Use :class:`PlaceOrderRequestV2` instead.
|
|
25
25
|
"""
|
|
26
26
|
def __init__(self):
|
|
27
|
-
ApiRequest.__init__(self, "/trade/order/place", version='
|
|
27
|
+
ApiRequest.__init__(self, "/trade/order/place", version='v3', method="POST", body_params={})
|
|
28
28
|
self._stock_order = {}
|
|
29
29
|
self.add_body_params("stock_order", self._stock_order)
|
|
30
30
|
|
|
@@ -19,7 +19,7 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class PlaceOrderRequestV2(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
ApiRequest.__init__(self, "/trade/order/place", version='
|
|
22
|
+
ApiRequest.__init__(self, "/trade/order/place", version='v3', method="POST", body_params={})
|
|
23
23
|
self._stock_order = {}
|
|
24
24
|
self.add_body_params("stock_order", self._stock_order)
|
|
25
25
|
|
|
@@ -21,7 +21,7 @@ class ReplaceOrderRequest(ApiRequest):
|
|
|
21
21
|
Deprecated. Use :class:`ReplaceOrderRequestV2` instead.
|
|
22
22
|
"""
|
|
23
23
|
def __init__(self):
|
|
24
|
-
ApiRequest.__init__(self, "/trade/order/replace", version='
|
|
24
|
+
ApiRequest.__init__(self, "/trade/order/replace", version='v3', method="POST", body_params={})
|
|
25
25
|
self._stock_order = {}
|
|
26
26
|
self.add_body_params("stock_order", self._stock_order)
|
|
27
27
|
|
|
@@ -18,7 +18,7 @@ from webull.core.request import ApiRequest
|
|
|
18
18
|
|
|
19
19
|
class ReplaceOrderRequestV2(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/trade/order/replace", version='
|
|
21
|
+
ApiRequest.__init__(self, "/trade/order/replace", version='v3', method="POST", body_params={})
|
|
22
22
|
self._stock_order = {}
|
|
23
23
|
self.add_body_params("stock_order", self._stock_order)
|
|
24
24
|
|
|
@@ -19,7 +19,7 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class CancelOptionRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
super().__init__("/openapi/trade/option/order/cancel", version='
|
|
22
|
+
super().__init__("/openapi/trade/option/order/cancel", version='v3', method="POST", body_params={})
|
|
23
23
|
|
|
24
24
|
def set_client_order_id(self, client_order_id):
|
|
25
25
|
self.add_body_params("client_order_id", client_order_id)
|
|
@@ -18,7 +18,7 @@ from webull.core.request import ApiRequest
|
|
|
18
18
|
|
|
19
19
|
class CancelOrderRequest(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/openapi/trade/stock/order/cancel", version='
|
|
21
|
+
ApiRequest.__init__(self, "/openapi/trade/stock/order/cancel", version='v3', method="POST", body_params={})
|
|
22
22
|
|
|
23
23
|
def set_account_id(self, account_id):
|
|
24
24
|
self.add_body_params("account_id", account_id)
|
|
@@ -18,7 +18,7 @@ from webull.core.request import ApiRequest
|
|
|
18
18
|
|
|
19
19
|
class AccountBalanceRequest(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/
|
|
21
|
+
ApiRequest.__init__(self, "/trading/assets/balances/get", version='v3', method="GET", query_params={})
|
|
22
22
|
|
|
23
23
|
def set_account_id(self, account_id):
|
|
24
24
|
self.add_query_param("account_id", account_id)
|
|
@@ -21,6 +21,4 @@ class GetAccountList(ApiRequest):
|
|
|
21
21
|
Deprecated. Use :func:`get_account_list_request` instead.
|
|
22
22
|
"""
|
|
23
23
|
def __init__(self):
|
|
24
|
-
ApiRequest.__init__(self, "/openapi/account/list", version='
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
ApiRequest.__init__(self, "/openapi/account/list", version='v3', method="GET", query_params={})
|
|
@@ -18,6 +18,4 @@ from webull.core.request import ApiRequest
|
|
|
18
18
|
|
|
19
19
|
class GetAccountListRequest(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
ApiRequest.__init__(self, "/trading/accounts/list", version='v3', method="GET", query_params={})
|
|
@@ -17,6 +17,10 @@ from webull.core.request import ApiRequest
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class AccountPositionDetailsRequest(ApiRequest):
|
|
20
|
+
"""
|
|
21
|
+
.. deprecated::
|
|
22
|
+
Use :class:`AccountPositionDetailsRequestV2` instead.
|
|
23
|
+
"""
|
|
20
24
|
def __init__(self):
|
|
21
25
|
ApiRequest.__init__(self, "/openapi/assets/position/details", version='v2', method="GET", query_params={})
|
|
22
26
|
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Copyright 2022 Webull
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
# coding=utf-8
|
|
16
|
+
from webull.core.request import ApiRequest
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class AccountPositionDetailsRequestV2(ApiRequest):
|
|
20
|
+
def __init__(self):
|
|
21
|
+
ApiRequest.__init__(self, "/trading/assets/positions/get", version='v3', method="GET", query_params={})
|
|
22
|
+
|
|
23
|
+
def set_account_id(self, account_id):
|
|
24
|
+
self.add_query_param("account_id", account_id)
|
|
25
|
+
|
|
26
|
+
def set_instrument_id(self, instrument_id):
|
|
27
|
+
self.add_query_param("instrument_id", instrument_id)
|
|
28
|
+
|
|
29
|
+
def set_pagination_key(self, pagination_key):
|
|
30
|
+
if pagination_key:
|
|
31
|
+
self.add_query_param("pagination_key", pagination_key)
|
|
@@ -18,7 +18,7 @@ from webull.core.request import ApiRequest
|
|
|
18
18
|
|
|
19
19
|
class AccountPositionsRequest(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/
|
|
21
|
+
ApiRequest.__init__(self, "/trading/assets/positions/list", version='v3', method="GET", query_params={})
|
|
22
22
|
|
|
23
23
|
def set_account_id(self, account_id):
|
|
24
24
|
self.add_query_param("account_id", account_id)
|
|
@@ -17,7 +17,7 @@ from webull.core.request import ApiRequest
|
|
|
17
17
|
|
|
18
18
|
class OrderDetailRequest(ApiRequest):
|
|
19
19
|
def __init__(self):
|
|
20
|
-
ApiRequest.__init__(self, "/openapi/trade/order/detail", version='
|
|
20
|
+
ApiRequest.__init__(self, "/openapi/trade/order/detail", version='v3', method="GET", query_params={})
|
|
21
21
|
|
|
22
22
|
def set_account_id(self, account_id):
|
|
23
23
|
self.add_query_param("account_id", account_id)
|
|
@@ -16,6 +16,11 @@ from webull.core.request import ApiRequest
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class GetOrderExecutionsRequest(ApiRequest):
|
|
19
|
+
"""
|
|
20
|
+
.. deprecated::
|
|
21
|
+
Use :class:`GetOrderExecutionsRequestV2` instead.
|
|
22
|
+
"""
|
|
23
|
+
|
|
19
24
|
def __init__(self):
|
|
20
25
|
ApiRequest.__init__(self, "/trading/orders/executions/list", version='v2', method="GET", query_params={})
|
|
21
26
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Copyright 2022 Webull
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from webull.core.request import ApiRequest
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class GetOrderExecutionsRequestV2(ApiRequest):
|
|
19
|
+
def __init__(self):
|
|
20
|
+
ApiRequest.__init__(self, "/trading/orders/executions/list", version='v3', method="GET", query_params={})
|
|
21
|
+
|
|
22
|
+
def set_account_id(self, account_id):
|
|
23
|
+
self.add_query_param("account_id", account_id)
|
|
24
|
+
|
|
25
|
+
def set_client_order_id(self, client_order_id):
|
|
26
|
+
self.add_query_param("client_order_id", client_order_id)
|
|
27
|
+
|
|
28
|
+
def set_start_date(self, start_date):
|
|
29
|
+
self.add_query_param("start_date", start_date)
|
|
30
|
+
|
|
31
|
+
def set_end_date(self, end_date):
|
|
32
|
+
self.add_query_param("end_date", end_date)
|
|
33
|
+
|
|
34
|
+
def set_pagination_key(self, pagination_key):
|
|
35
|
+
self.add_query_param("pagination_key", pagination_key)
|
|
@@ -17,7 +17,7 @@ from webull.core.request import ApiRequest
|
|
|
17
17
|
|
|
18
18
|
class OrderHistoryRequest(ApiRequest):
|
|
19
19
|
def __init__(self):
|
|
20
|
-
ApiRequest.__init__(self, "/openapi/trade/order/history", version='
|
|
20
|
+
ApiRequest.__init__(self, "/openapi/trade/order/history", version='v3', method="GET", query_params={})
|
|
21
21
|
|
|
22
22
|
def set_account_id(self, account_id):
|
|
23
23
|
self.add_query_param("account_id", account_id)
|
|
@@ -17,7 +17,7 @@ from webull.core.request import ApiRequest
|
|
|
17
17
|
|
|
18
18
|
class OrderOpenRequest(ApiRequest):
|
|
19
19
|
def __init__(self):
|
|
20
|
-
ApiRequest.__init__(self, "/openapi/trade/order/open", version='
|
|
20
|
+
ApiRequest.__init__(self, "/openapi/trade/order/open", version='v3', method="GET", query_params={})
|
|
21
21
|
|
|
22
22
|
def set_account_id(self, account_id):
|
|
23
23
|
self.add_query_param("account_id", account_id)
|
|
@@ -21,7 +21,7 @@ class PlaceOrderRequest(ApiRequest):
|
|
|
21
21
|
Deprecated. Use :func:`place_order_request` instead.
|
|
22
22
|
"""
|
|
23
23
|
def __init__(self):
|
|
24
|
-
super().__init__("/openapi/trade/stock/order/place", version='
|
|
24
|
+
super().__init__("/openapi/trade/stock/order/place", version='v3', method="POST", body_params={})
|
|
25
25
|
|
|
26
26
|
def set_new_orders(self, new_orders):
|
|
27
27
|
self.add_body_params("new_orders", new_orders)
|
|
@@ -19,7 +19,7 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class PlaceOptionRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
super().__init__("/openapi/trade/option/order/place", version='
|
|
22
|
+
super().__init__("/openapi/trade/option/order/place", version='v3', method="POST", body_params={})
|
|
23
23
|
|
|
24
24
|
def set_new_orders(self, new_orders):
|
|
25
25
|
self.add_body_params("new_orders", new_orders)
|
|
@@ -18,7 +18,7 @@ from webull.core.request import ApiRequest
|
|
|
18
18
|
|
|
19
19
|
class PlaceOrderRequest(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
super().__init__("/openapi/trade/stock/order/place", version='
|
|
21
|
+
super().__init__("/openapi/trade/stock/order/place", version='v3', method="POST", body_params={})
|
|
22
22
|
|
|
23
23
|
def set_new_orders(self, new_orders):
|
|
24
24
|
self.add_body_params("new_orders", new_orders)
|
|
@@ -19,7 +19,7 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class PreviewOptionRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
super().__init__("/openapi/trade/option/order/preview", version='
|
|
22
|
+
super().__init__("/openapi/trade/option/order/preview", version='v3', method="POST", body_params={})
|
|
23
23
|
|
|
24
24
|
def set_new_orders(self, new_orders):
|
|
25
25
|
self.add_body_params("new_orders", new_orders)
|
|
@@ -16,7 +16,7 @@ from webull.core.request import ApiRequest
|
|
|
16
16
|
|
|
17
17
|
class PreviewOrderRequest(ApiRequest):
|
|
18
18
|
def __init__(self):
|
|
19
|
-
super().__init__("/openapi/trade/stock/order/preview", version='
|
|
19
|
+
super().__init__("/openapi/trade/stock/order/preview", version='v3', method="POST", body_params={})
|
|
20
20
|
|
|
21
21
|
def set_new_orders(self, new_orders):
|
|
22
22
|
self.add_body_params("new_orders", new_orders)
|
|
@@ -19,7 +19,7 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class ReplaceOptionRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
super().__init__("/openapi/trade/option/order/replace", version='
|
|
22
|
+
super().__init__("/openapi/trade/option/order/replace", version='v3', method="POST", body_params={})
|
|
23
23
|
|
|
24
24
|
def set_modify_orders(self, modify_orders):
|
|
25
25
|
self.add_body_params("modify_orders", modify_orders)
|
|
@@ -16,7 +16,7 @@ from webull.core.request import ApiRequest
|
|
|
16
16
|
|
|
17
17
|
class ReplaceOrderRequest(ApiRequest):
|
|
18
18
|
def __init__(self):
|
|
19
|
-
ApiRequest.__init__(self, "/openapi/trade/stock/order/replace", version='
|
|
19
|
+
ApiRequest.__init__(self, "/openapi/trade/stock/order/replace", version='v3', method="POST", body_params={})
|
|
20
20
|
|
|
21
21
|
def set_modify_orders(self, modify_orders):
|
|
22
22
|
self.add_body_params("modify_orders", modify_orders)
|
|
@@ -19,7 +19,7 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class BatchPlaceOrderRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
super().__init__("/
|
|
22
|
+
super().__init__("/trading/orders/batch-place", version='v3', method="POST", body_params={})
|
|
23
23
|
|
|
24
24
|
def set_account_id(self, account_id):
|
|
25
25
|
self.add_body_params("account_id", account_id)
|
|
@@ -18,7 +18,7 @@ from webull.core.request import ApiRequest
|
|
|
18
18
|
|
|
19
19
|
class CancelOrderRequest(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/
|
|
21
|
+
ApiRequest.__init__(self, "/trading/orders/cancel", version='v3', method="POST", body_params={})
|
|
22
22
|
|
|
23
23
|
def set_account_id(self, account_id):
|
|
24
24
|
self.add_body_params("account_id", account_id)
|
|
@@ -17,7 +17,7 @@ from webull.core.request import ApiRequest
|
|
|
17
17
|
|
|
18
18
|
class OrderDetailRequest(ApiRequest):
|
|
19
19
|
def __init__(self):
|
|
20
|
-
ApiRequest.__init__(self, "/
|
|
20
|
+
ApiRequest.__init__(self, "/trading/orders/get", version='v3', method="GET", query_params={})
|
|
21
21
|
|
|
22
22
|
def set_account_id(self, account_id):
|
|
23
23
|
self.add_query_param("account_id", account_id)
|
|
@@ -16,8 +16,12 @@ from webull.core.request import ApiRequest
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class OrderHistoryRequest(ApiRequest):
|
|
19
|
+
"""
|
|
20
|
+
.. deprecated::
|
|
21
|
+
Use :class:`OrderHistoryRequestV2` instead.
|
|
22
|
+
"""
|
|
19
23
|
def __init__(self):
|
|
20
|
-
ApiRequest.__init__(self, "/
|
|
24
|
+
ApiRequest.__init__(self, "/trading/orders/historical-orders/list", version='v2', method="GET", query_params={})
|
|
21
25
|
|
|
22
26
|
def set_account_id(self, account_id):
|
|
23
27
|
self.add_query_param("account_id", account_id)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Copyright 2022 Webull
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from webull.core.request import ApiRequest
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class OrderHistoryRequestV2(ApiRequest):
|
|
19
|
+
def __init__(self):
|
|
20
|
+
ApiRequest.__init__(self, "/trading/orders/historical-orders/list", version='v3', method="GET", query_params={})
|
|
21
|
+
|
|
22
|
+
def set_account_id(self, account_id):
|
|
23
|
+
self.add_query_param("account_id", account_id)
|
|
24
|
+
|
|
25
|
+
def set_start_time(self, start_time):
|
|
26
|
+
if start_time is not None:
|
|
27
|
+
self.add_query_param("start_time", start_time)
|
|
28
|
+
|
|
29
|
+
def set_end_time(self, end_time):
|
|
30
|
+
if end_time is not None:
|
|
31
|
+
self.add_query_param("end_time", end_time)
|
|
32
|
+
|
|
33
|
+
def set_pagination_key(self, pagination_key):
|
|
34
|
+
if pagination_key:
|
|
35
|
+
self.add_query_param("pagination_key", pagination_key)
|
|
@@ -16,8 +16,12 @@ from webull.core.request import ApiRequest
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class OrderOpenRequest(ApiRequest):
|
|
19
|
+
"""
|
|
20
|
+
.. deprecated::
|
|
21
|
+
Use :class:`OrderOpenRequestV2` instead.
|
|
22
|
+
"""
|
|
19
23
|
def __init__(self):
|
|
20
|
-
ApiRequest.__init__(self, "/
|
|
24
|
+
ApiRequest.__init__(self, "/trading/orders/open-orders/list", version='v2', method="GET", query_params={})
|
|
21
25
|
|
|
22
26
|
def set_account_id(self, account_id):
|
|
23
27
|
self.add_query_param("account_id", account_id)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Copyright 2022 Webull
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
from webull.core.request import ApiRequest
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class OrderOpenRequestV2(ApiRequest):
|
|
19
|
+
def __init__(self):
|
|
20
|
+
ApiRequest.__init__(self, "/trading/orders/open-orders/list", version='v3', method="GET", query_params={})
|
|
21
|
+
|
|
22
|
+
def set_account_id(self, account_id):
|
|
23
|
+
self.add_query_param("account_id", account_id)
|
|
24
|
+
|
|
25
|
+
def set_pagination_key(self, pagination_key):
|
|
26
|
+
if pagination_key:
|
|
27
|
+
self.add_query_param("pagination_key", pagination_key)
|
|
@@ -19,7 +19,7 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class PlaceOrderRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
super().__init__("/
|
|
22
|
+
super().__init__("/trading/orders/place", version='v3', method="POST", body_params={})
|
|
23
23
|
|
|
24
24
|
def set_new_orders(self, new_orders):
|
|
25
25
|
self.add_body_params("new_orders", new_orders)
|
|
@@ -19,7 +19,7 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class PreviewOrderRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
super().__init__("/
|
|
22
|
+
super().__init__("/trading/orders/preview", version='v3', method="POST", body_params={})
|
|
23
23
|
|
|
24
24
|
def set_new_orders(self, new_orders):
|
|
25
25
|
self.add_body_params("new_orders", new_orders)
|
|
@@ -18,7 +18,7 @@ from webull.core.request import ApiRequest
|
|
|
18
18
|
|
|
19
19
|
class ReplaceOrderRequest(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/
|
|
21
|
+
ApiRequest.__init__(self, "/trading/orders/replace", version='v3', method="POST", body_params={})
|
|
22
22
|
|
|
23
23
|
def set_modify_orders(self, modify_orders):
|
|
24
24
|
self.add_body_params("modify_orders", modify_orders)
|
webull/trade/trade/activity.py
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
# coding=utf-8
|
|
16
16
|
|
|
17
17
|
from webull.trade.request.get_activities_request import GetActivitiesRequest
|
|
18
|
+
from webull.trade.request.get_activities_request_v2 import GetActivitiesRequestV2
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
class Activity:
|
|
@@ -24,6 +25,11 @@ class Activity:
|
|
|
24
25
|
def get_activities(self, account_id, activity_types=None, start_time=None, end_time=None,
|
|
25
26
|
last_activity_id=None, page_size=10):
|
|
26
27
|
"""
|
|
28
|
+
.. deprecated::
|
|
29
|
+
Use :meth:`list_activities` instead.
|
|
30
|
+
|
|
31
|
+
The x-version header distinguishes the legacy and new pagination protocols for this path.
|
|
32
|
+
|
|
27
33
|
Query cash activities by type with pagination support.
|
|
28
34
|
This interface is currently supported only for Webull US.
|
|
29
35
|
|
|
@@ -47,3 +53,30 @@ class Activity:
|
|
|
47
53
|
get_activities_request.set_page_size(page_size)
|
|
48
54
|
response = self.client.get_response(get_activities_request)
|
|
49
55
|
return response
|
|
56
|
+
|
|
57
|
+
def list_activities(self, account_id, activity_types=None, start_time=None, end_time=None,
|
|
58
|
+
pagination_key=None):
|
|
59
|
+
"""
|
|
60
|
+
The x-version header distinguishes the legacy and new pagination protocols for this path.
|
|
61
|
+
|
|
62
|
+
Query cash activities by type with pagination support.
|
|
63
|
+
This interface is currently supported only for Webull US.
|
|
64
|
+
|
|
65
|
+
:param account_id: Account ID
|
|
66
|
+
:param activity_types: Activity types filter, comma-separated string (optional)
|
|
67
|
+
:param start_time: Start time filter (optional)
|
|
68
|
+
:param end_time: End time filter (optional)
|
|
69
|
+
:param pagination_key: Pagination key from the previous page response; not returned on the last page.
|
|
70
|
+
"""
|
|
71
|
+
get_activities_request = GetActivitiesRequestV2()
|
|
72
|
+
get_activities_request.set_account_id(account_id)
|
|
73
|
+
if activity_types is not None:
|
|
74
|
+
get_activities_request.set_activity_types(activity_types)
|
|
75
|
+
if start_time is not None:
|
|
76
|
+
get_activities_request.set_start_time(start_time)
|
|
77
|
+
if end_time is not None:
|
|
78
|
+
get_activities_request.set_end_time(end_time)
|
|
79
|
+
if pagination_key is not None:
|
|
80
|
+
get_activities_request.set_pagination_key(pagination_key)
|
|
81
|
+
response = self.client.get_response(get_activities_request)
|
|
82
|
+
return response
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
from webull.trade.request.v2.get_account_balance_request import AccountBalanceRequest
|
|
17
17
|
from webull.trade.request.v2.get_account_list_request import GetAccountListRequest
|
|
18
18
|
from webull.trade.request.v2.get_account_position_details_request import AccountPositionDetailsRequest
|
|
19
|
+
from webull.trade.request.v2.get_account_position_details_request_v2 import AccountPositionDetailsRequestV2
|
|
19
20
|
from webull.trade.request.v2.get_account_positions_request import AccountPositionsRequest
|
|
20
21
|
|
|
21
22
|
|
|
@@ -54,6 +55,11 @@ class AccountV2:
|
|
|
54
55
|
|
|
55
56
|
def get_account_position_details(self, account_id, instrument_id, page_size=None, last_id=None):
|
|
56
57
|
"""
|
|
58
|
+
.. deprecated::
|
|
59
|
+
Use :meth:`list_position_details` instead.
|
|
60
|
+
|
|
61
|
+
The x-version header distinguishes the legacy and new pagination protocols for this path.
|
|
62
|
+
|
|
57
63
|
This interface is currently supported only for Webull JP.
|
|
58
64
|
Support for other regions will be available in future updates.
|
|
59
65
|
"""
|
|
@@ -64,3 +70,21 @@ class AccountV2:
|
|
|
64
70
|
account_position_details_request.set_last_id(last_id)
|
|
65
71
|
response = self.client.get_response(account_position_details_request)
|
|
66
72
|
return response
|
|
73
|
+
|
|
74
|
+
def list_position_details(self, account_id, instrument_id, pagination_key=None):
|
|
75
|
+
"""
|
|
76
|
+
The x-version header distinguishes the legacy and new pagination protocols for this path.
|
|
77
|
+
|
|
78
|
+
This interface is currently supported only for Webull JP.
|
|
79
|
+
Support for other regions will be available in future updates.
|
|
80
|
+
|
|
81
|
+
:param account_id: Account ID
|
|
82
|
+
:param instrument_id: Instrument ID
|
|
83
|
+
:param pagination_key: Pagination key from the previous page response; not returned on the last page.
|
|
84
|
+
"""
|
|
85
|
+
account_position_details_request = AccountPositionDetailsRequestV2()
|
|
86
|
+
account_position_details_request.set_account_id(account_id)
|
|
87
|
+
account_position_details_request.set_instrument_id(instrument_id)
|
|
88
|
+
account_position_details_request.set_pagination_key(pagination_key)
|
|
89
|
+
response = self.client.get_response(account_position_details_request)
|
|
90
|
+
return response
|