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
|
@@ -19,6 +19,9 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class GetGainersLosersRequest(ApiRequest):
|
|
21
21
|
"""
|
|
22
|
+
.. deprecated::
|
|
23
|
+
Use :class:`GetGainersLosersRequestV2` instead.
|
|
24
|
+
|
|
22
25
|
Request class for Stock Top Gainers/Losers Rank API.
|
|
23
26
|
|
|
24
27
|
This API returns stocks ranked by price change percentage over different time periods.
|
|
@@ -26,7 +29,8 @@ class GetGainersLosersRequest(ApiRequest):
|
|
|
26
29
|
"""
|
|
27
30
|
|
|
28
31
|
def __init__(self):
|
|
29
|
-
ApiRequest.__init__(self, "/openapi/market-data/screener/gainers-losers", version="v2", method="GET",
|
|
32
|
+
ApiRequest.__init__(self, "/openapi/market-data/screener/gainers-losers", version="v2", method="GET",
|
|
33
|
+
query_params={})
|
|
30
34
|
|
|
31
35
|
def set_rank_type(self, rank_type):
|
|
32
36
|
"""
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
|
|
17
|
+
from webull.core.request import ApiRequest
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class GetGainersLosersRequestV2(ApiRequest):
|
|
21
|
+
"""
|
|
22
|
+
Request class for Stock Top Gainers/Losers Rank API.
|
|
23
|
+
|
|
24
|
+
This API returns stocks ranked by price change percentage over different time periods.
|
|
25
|
+
Use direction=DESC for gainers (top performers) and direction=ASC for losers (worst performers).
|
|
26
|
+
|
|
27
|
+
The ranking is not paginated and returns the top 200 results.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
def __init__(self):
|
|
31
|
+
ApiRequest.__init__(self, "/market-data/screeners/gainers-losers/list", version="v3", method="GET",
|
|
32
|
+
query_params={})
|
|
33
|
+
|
|
34
|
+
def set_rank_type(self, rank_type):
|
|
35
|
+
"""
|
|
36
|
+
Set the ranking time dimension.
|
|
37
|
+
|
|
38
|
+
:param rank_type: Time period for ranking. Optional (defaults to DAY_1).
|
|
39
|
+
Enum values:
|
|
40
|
+
- PRE_MARKET: Pre-market session
|
|
41
|
+
- AFTER_MARKET: After-market session
|
|
42
|
+
- MIN_3: 3 minutes
|
|
43
|
+
- MIN_5: 5 minutes
|
|
44
|
+
- DAY_1: 1 day
|
|
45
|
+
- DAY_5: 5 days
|
|
46
|
+
- MONTH_1: 1 month
|
|
47
|
+
- MONTH_3: 3 months
|
|
48
|
+
- WEEK_52: 52 weeks
|
|
49
|
+
"""
|
|
50
|
+
if rank_type is not None:
|
|
51
|
+
self.add_query_param("rank_type", rank_type)
|
|
52
|
+
|
|
53
|
+
def set_category(self, category):
|
|
54
|
+
"""
|
|
55
|
+
Set the security market category.
|
|
56
|
+
|
|
57
|
+
:param category: Security market category. Required.
|
|
58
|
+
Enum values: US_STOCK
|
|
59
|
+
"""
|
|
60
|
+
if category is not None:
|
|
61
|
+
self.add_query_param("category", category)
|
|
62
|
+
|
|
63
|
+
def set_sort_by(self, sort_by):
|
|
64
|
+
"""
|
|
65
|
+
Set the secondary sort field for further ordering within the ranking.
|
|
66
|
+
|
|
67
|
+
:param sort_by: Sort field. Optional (defaults to CHANGE_RATIO).
|
|
68
|
+
Enum values:
|
|
69
|
+
- CHANGE_RATIO: Price change percentage
|
|
70
|
+
- RELATIVE_VOLUME_10D: 10-day relative volume
|
|
71
|
+
- MARKET_VALUE: Market capitalization
|
|
72
|
+
- CLOSE: Closing price
|
|
73
|
+
- PRICE: Current price
|
|
74
|
+
- PE_TTM: Trailing twelve months P/E ratio
|
|
75
|
+
- HIGH: Intraday high
|
|
76
|
+
- LOW: Intraday low
|
|
77
|
+
- AMPLITUDE: Price amplitude
|
|
78
|
+
- TURNOVER: Turnover amount
|
|
79
|
+
- VOLUME: Trading volume
|
|
80
|
+
"""
|
|
81
|
+
if sort_by is not None:
|
|
82
|
+
self.add_query_param("sort_by", sort_by)
|
|
83
|
+
|
|
84
|
+
def set_direction(self, direction):
|
|
85
|
+
"""
|
|
86
|
+
Set the sort direction.
|
|
87
|
+
|
|
88
|
+
:param direction: Sort direction. Optional (defaults to DESC).
|
|
89
|
+
Enum values:
|
|
90
|
+
- ASC: Ascending order (for losers/worst performers)
|
|
91
|
+
- DESC: Descending order (for gainers/top performers)
|
|
92
|
+
"""
|
|
93
|
+
if direction is not None:
|
|
94
|
+
self.add_query_param("direction", direction)
|
|
@@ -18,6 +18,10 @@ from webull.core.request import ApiRequest
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
class GetHighDividendRequest(ApiRequest):
|
|
21
|
+
"""
|
|
22
|
+
.. deprecated::
|
|
23
|
+
Use :class:`GetHighDividendRequestV2` instead.
|
|
24
|
+
"""
|
|
21
25
|
def __init__(self):
|
|
22
26
|
ApiRequest.__init__(self, "/openapi/market-data/screener/high-dividend", version='v2', method="GET",
|
|
23
27
|
query_params={})
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
|
|
17
|
+
from webull.core.request import ApiRequest
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class GetHighDividendRequestV2(ApiRequest):
|
|
21
|
+
"""
|
|
22
|
+
Request class for High Dividend Rank API.
|
|
23
|
+
|
|
24
|
+
The ranking is not paginated and returns the top 200 results.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
def __init__(self):
|
|
28
|
+
ApiRequest.__init__(self, "/market-data/screeners/high-dividend-ranks/list", version='v3', method="GET",
|
|
29
|
+
query_params={})
|
|
30
|
+
|
|
31
|
+
def set_category(self, category):
|
|
32
|
+
if category:
|
|
33
|
+
self.add_query_param("category", category)
|
|
34
|
+
|
|
35
|
+
def set_sort_by(self, sort_by):
|
|
36
|
+
if sort_by:
|
|
37
|
+
self.add_query_param("sort_by", sort_by)
|
|
38
|
+
|
|
39
|
+
def set_direction(self, direction):
|
|
40
|
+
if direction:
|
|
41
|
+
self.add_query_param("direction", direction)
|
|
@@ -18,6 +18,10 @@ from webull.core.request import ApiRequest
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
class GetMarketSectorsDetailRequest(ApiRequest):
|
|
21
|
+
"""
|
|
22
|
+
.. deprecated::
|
|
23
|
+
Use :class:`GetMarketSectorsDetailRequestV2` instead.
|
|
24
|
+
"""
|
|
21
25
|
def __init__(self):
|
|
22
26
|
ApiRequest.__init__(self, "/openapi/market-data/screener/market-sectors-detail", version='v2', method="GET",
|
|
23
27
|
query_params={})
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
+
|
|
17
|
+
from webull.core.request import ApiRequest
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class GetMarketSectorsDetailRequestV2(ApiRequest):
|
|
21
|
+
def __init__(self):
|
|
22
|
+
ApiRequest.__init__(self, "/market-data/screeners/market-sectors/get", version='v3', method="GET",
|
|
23
|
+
query_params={})
|
|
24
|
+
|
|
25
|
+
def set_sector_id(self, sector_id):
|
|
26
|
+
if sector_id:
|
|
27
|
+
self.add_query_param("sector_id", sector_id)
|
|
28
|
+
|
|
29
|
+
def set_category(self, category):
|
|
30
|
+
if category:
|
|
31
|
+
self.add_query_param("category", category)
|
|
32
|
+
|
|
33
|
+
def set_period(self, period):
|
|
34
|
+
if period:
|
|
35
|
+
self.add_query_param("period", period)
|
|
36
|
+
|
|
37
|
+
def set_sort_by(self, sort_by):
|
|
38
|
+
if sort_by:
|
|
39
|
+
self.add_query_param("sort_by", sort_by)
|
|
40
|
+
|
|
41
|
+
def set_direction(self, direction):
|
|
42
|
+
if direction:
|
|
43
|
+
self.add_query_param("direction", direction)
|
|
44
|
+
|
|
45
|
+
def set_pagination_key(self, pagination_key):
|
|
46
|
+
if pagination_key:
|
|
47
|
+
self.add_query_param("pagination_key", pagination_key)
|
|
@@ -18,8 +18,12 @@ from webull.core.request import ApiRequest
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
class GetMarketSectorsRequest(ApiRequest):
|
|
21
|
+
"""
|
|
22
|
+
.. deprecated::
|
|
23
|
+
Use :class:`GetMarketSectorsRequestV2` instead.
|
|
24
|
+
"""
|
|
21
25
|
def __init__(self):
|
|
22
|
-
ApiRequest.__init__(self, "/openapi/market-data/screener/market-sectors", version='
|
|
26
|
+
ApiRequest.__init__(self, "/openapi/market-data/screener/market-sectors", version='v3', method="GET",
|
|
23
27
|
query_params={})
|
|
24
28
|
|
|
25
29
|
def set_category(self, category):
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
|
|
17
|
+
from webull.core.request import ApiRequest
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class GetMarketSectorsRequestV2(ApiRequest):
|
|
21
|
+
def __init__(self):
|
|
22
|
+
ApiRequest.__init__(self, "/market-data/screeners/market-sectors/list", version='v3', method="GET",
|
|
23
|
+
query_params={})
|
|
24
|
+
|
|
25
|
+
def set_category(self, category):
|
|
26
|
+
if category:
|
|
27
|
+
self.add_query_param("category", category)
|
|
28
|
+
|
|
29
|
+
def set_agg_type(self, agg_type):
|
|
30
|
+
if agg_type:
|
|
31
|
+
self.add_query_param("agg_type", agg_type)
|
|
32
|
+
|
|
33
|
+
def set_period(self, period):
|
|
34
|
+
if period:
|
|
35
|
+
self.add_query_param("period", period)
|
|
36
|
+
|
|
37
|
+
def set_direction(self, direction):
|
|
38
|
+
if direction:
|
|
39
|
+
self.add_query_param("direction", direction)
|
|
40
|
+
|
|
41
|
+
def set_pagination_key(self, pagination_key):
|
|
42
|
+
if pagination_key:
|
|
43
|
+
self.add_query_param("pagination_key", pagination_key)
|
|
@@ -19,6 +19,9 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class GetMostActiveRequest(ApiRequest):
|
|
21
21
|
"""
|
|
22
|
+
.. deprecated::
|
|
23
|
+
Use :class:`GetMostActiveRequestV2` instead.
|
|
24
|
+
|
|
22
25
|
Request class for Stock Top Active Rank API.
|
|
23
26
|
|
|
24
27
|
This API returns the most actively traded stocks ranked by volume, relative volume,
|
|
@@ -31,7 +34,8 @@ class GetMostActiveRequest(ApiRequest):
|
|
|
31
34
|
"""
|
|
32
35
|
|
|
33
36
|
def __init__(self):
|
|
34
|
-
ApiRequest.__init__(self, "/openapi/market-data/screener/top-active", version="v2", method="GET",
|
|
37
|
+
ApiRequest.__init__(self, "/openapi/market-data/screener/top-active", version="v2", method="GET",
|
|
38
|
+
query_params={})
|
|
35
39
|
|
|
36
40
|
def set_rank_type(self, rank_type):
|
|
37
41
|
"""
|
|
@@ -0,0 +1,92 @@
|
|
|
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
|
+
|
|
17
|
+
from webull.core.request import ApiRequest
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class GetMostActiveRequestV2(ApiRequest):
|
|
21
|
+
"""
|
|
22
|
+
Request class for Stock Top Active Rank API.
|
|
23
|
+
|
|
24
|
+
This API returns the most actively traded stocks ranked by volume, relative volume,
|
|
25
|
+
turnover, turnover rate, or amplitude.
|
|
26
|
+
|
|
27
|
+
Default sort: rank_type=VOLUME, sort_by=VOLUME, direction=DESC
|
|
28
|
+
|
|
29
|
+
The ranking is not paginated and returns the top 200 results.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
def __init__(self):
|
|
33
|
+
ApiRequest.__init__(self, "/market-data/screeners/top-actives/list", version="v3", method="GET",
|
|
34
|
+
query_params={})
|
|
35
|
+
|
|
36
|
+
def set_rank_type(self, rank_type):
|
|
37
|
+
"""
|
|
38
|
+
Set the ranking dimension that determines which activity metric is used for filtering.
|
|
39
|
+
|
|
40
|
+
:param rank_type: Activity metric for ranking. Optional (defaults to VOLUME).
|
|
41
|
+
Enum values:
|
|
42
|
+
- VOLUME: Trading volume
|
|
43
|
+
- RELATIVE_VOLUME_10D: 10-day relative volume
|
|
44
|
+
- TURNOVER: Turnover amount
|
|
45
|
+
- TURNOVER_RATE: Turnover rate
|
|
46
|
+
- AMPLITUDE: Price amplitude
|
|
47
|
+
"""
|
|
48
|
+
if rank_type is not None:
|
|
49
|
+
self.add_query_param("rank_type", rank_type)
|
|
50
|
+
|
|
51
|
+
def set_category(self, category):
|
|
52
|
+
"""
|
|
53
|
+
Set the security market category.
|
|
54
|
+
|
|
55
|
+
:param category: Security market category. Required.
|
|
56
|
+
Enum values: US_STOCK
|
|
57
|
+
"""
|
|
58
|
+
if category is not None:
|
|
59
|
+
self.add_query_param("category", category)
|
|
60
|
+
|
|
61
|
+
def set_sort_by(self, sort_by):
|
|
62
|
+
"""
|
|
63
|
+
Set the secondary sort field for further ordering within the ranking.
|
|
64
|
+
|
|
65
|
+
:param sort_by: Sort field. Optional.
|
|
66
|
+
Enum values:
|
|
67
|
+
- CHANGE_RATIO: Price change percentage
|
|
68
|
+
- RELATIVE_VOLUME_10D: 10-day relative volume
|
|
69
|
+
- MARKET_VALUE: Market capitalization
|
|
70
|
+
- CLOSE: Closing price
|
|
71
|
+
- PRICE: Current price
|
|
72
|
+
- PE_TTM: Trailing twelve months P/E ratio
|
|
73
|
+
- HIGH: Intraday high
|
|
74
|
+
- LOW: Intraday low
|
|
75
|
+
- AMPLITUDE: Price amplitude
|
|
76
|
+
- TURNOVER: Turnover amount
|
|
77
|
+
- VOLUME: Trading volume
|
|
78
|
+
"""
|
|
79
|
+
if sort_by is not None:
|
|
80
|
+
self.add_query_param("sort_by", sort_by)
|
|
81
|
+
|
|
82
|
+
def set_direction(self, direction):
|
|
83
|
+
"""
|
|
84
|
+
Set the sort direction.
|
|
85
|
+
|
|
86
|
+
:param direction: Sort direction. Optional (defaults to DESC).
|
|
87
|
+
Enum values:
|
|
88
|
+
- ASC: Ascending order
|
|
89
|
+
- DESC: Descending order
|
|
90
|
+
"""
|
|
91
|
+
if direction is not None:
|
|
92
|
+
self.add_query_param("direction", direction)
|
|
@@ -19,7 +19,7 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class SubscribeRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
ApiRequest.__init__(self, "/
|
|
22
|
+
ApiRequest.__init__(self, "/market-data/streaming/subscribe", version='v3', method="POST",
|
|
23
23
|
query_params={})
|
|
24
24
|
self.set_body_params({})
|
|
25
25
|
|
|
@@ -19,7 +19,7 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class UnsubcribeRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
ApiRequest.__init__(self, "/
|
|
22
|
+
ApiRequest.__init__(self, "/market-data/streaming/unsubscribe", version='v3', method="POST",
|
|
23
23
|
query_params={})
|
|
24
24
|
self.set_body_params({})
|
|
25
25
|
|
|
@@ -19,7 +19,8 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class AddWatchlistInstrumentsRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
ApiRequest.__init__(self, "/
|
|
22
|
+
ApiRequest.__init__(self, "/market-data/watchlists/instruments/add", version="v3", method="POST",
|
|
23
|
+
body_params={})
|
|
23
24
|
|
|
24
25
|
def set_watchlist_id(self, watchlist_id):
|
|
25
26
|
"""
|
|
@@ -19,7 +19,7 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class CreateWatchlistRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
ApiRequest.__init__(self, "/
|
|
22
|
+
ApiRequest.__init__(self, "/market-data/watchlists/create", version="v3", method="POST", body_params={})
|
|
23
23
|
|
|
24
24
|
def set_name(self, name):
|
|
25
25
|
"""
|
|
@@ -19,7 +19,7 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class DeleteWatchlistRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
ApiRequest.__init__(self, "/
|
|
22
|
+
ApiRequest.__init__(self, "/market-data/watchlists/delete", version="v3", method="POST", body_params={})
|
|
23
23
|
|
|
24
24
|
def set_watchlist_id(self, watchlist_id):
|
|
25
25
|
"""
|
|
@@ -19,7 +19,8 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class GetWatchlistInstrumentsRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
ApiRequest.__init__(self, "/
|
|
22
|
+
ApiRequest.__init__(self, "/market-data/watchlists/instruments/list", version="v3", method="GET",
|
|
23
|
+
query_params={})
|
|
23
24
|
|
|
24
25
|
def set_watchlist_id(self, watchlist_id):
|
|
25
26
|
"""
|
|
@@ -19,4 +19,4 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class GetWatchlistRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
ApiRequest.__init__(self, "/
|
|
22
|
+
ApiRequest.__init__(self, "/market-data/watchlists/list", version="v3", method="GET", query_params={})
|
|
@@ -19,7 +19,8 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class RemoveWatchlistInstrumentsRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
ApiRequest.__init__(self, "/
|
|
22
|
+
ApiRequest.__init__(self, "/market-data/watchlists/instruments/remove", version="v3", method="POST",
|
|
23
|
+
body_params={})
|
|
23
24
|
|
|
24
25
|
def set_watchlist_id(self, watchlist_id):
|
|
25
26
|
"""
|
|
@@ -19,7 +19,8 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class UpdateWatchlistInstrumentsRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
ApiRequest.__init__(self, "/
|
|
22
|
+
ApiRequest.__init__(self, "/market-data/watchlists/instruments/update", version="v3", method="POST",
|
|
23
|
+
body_params={})
|
|
23
24
|
|
|
24
25
|
def set_watchlist_id(self, watchlist_id):
|
|
25
26
|
"""
|
|
@@ -19,7 +19,7 @@ from webull.core.request import ApiRequest
|
|
|
19
19
|
|
|
20
20
|
class UpdateWatchlistRequest(ApiRequest):
|
|
21
21
|
def __init__(self):
|
|
22
|
-
ApiRequest.__init__(self, "/
|
|
22
|
+
ApiRequest.__init__(self, "/market-data/watchlists/update", version="v3", method="POST", body_params={})
|
|
23
23
|
|
|
24
24
|
def set_watchlist_id(self, watchlist_id):
|
|
25
25
|
"""
|
webull/trade/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '
|
|
1
|
+
__version__ = '3.0.0'
|
|
@@ -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, "/trade/order/cancel", version='
|
|
21
|
+
ApiRequest.__init__(self, "/trade/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, "/account/balance", version='
|
|
21
|
+
ApiRequest.__init__(self, "/account/balance", 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 AccountPositionsRequest(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/account/positions", version='
|
|
21
|
+
ApiRequest.__init__(self, "/account/positions", 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 AccountProfileRequest(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/account/profile", version='
|
|
21
|
+
ApiRequest.__init__(self, "/account/profile", 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,6 +17,10 @@ from webull.core.request import ApiRequest
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class GetActivitiesRequest(ApiRequest):
|
|
20
|
+
"""
|
|
21
|
+
.. deprecated::
|
|
22
|
+
Use :class:`GetActivitiesRequestV2` instead.
|
|
23
|
+
"""
|
|
20
24
|
def __init__(self):
|
|
21
25
|
ApiRequest.__init__(self, "/openapi/trade/activities/cash", version='v2', method="GET", query_params={})
|
|
22
26
|
|
|
@@ -0,0 +1,41 @@
|
|
|
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 GetActivitiesRequestV2(ApiRequest):
|
|
20
|
+
def __init__(self):
|
|
21
|
+
ApiRequest.__init__(self, "/trading/activities/cash-activities/list", version='v3', method="GET",
|
|
22
|
+
query_params={})
|
|
23
|
+
|
|
24
|
+
def set_account_id(self, account_id):
|
|
25
|
+
self.add_query_param("account_id", account_id)
|
|
26
|
+
|
|
27
|
+
def set_activity_types(self, activity_types):
|
|
28
|
+
if activity_types is not None:
|
|
29
|
+
self.add_query_param("activity_types", activity_types)
|
|
30
|
+
|
|
31
|
+
def set_start_time(self, start_time):
|
|
32
|
+
if start_time is not None:
|
|
33
|
+
self.add_query_param("start_time", start_time)
|
|
34
|
+
|
|
35
|
+
def set_end_time(self, end_time):
|
|
36
|
+
if end_time is not None:
|
|
37
|
+
self.add_query_param("end_time", end_time)
|
|
38
|
+
|
|
39
|
+
def set_pagination_key(self, pagination_key):
|
|
40
|
+
if pagination_key:
|
|
41
|
+
self.add_query_param("pagination_key", pagination_key)
|
|
@@ -18,7 +18,7 @@ from webull.core.request import ApiRequest
|
|
|
18
18
|
|
|
19
19
|
class GetAppSubscriptions(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/app/subscriptions/list", version='
|
|
21
|
+
ApiRequest.__init__(self, "/app/subscriptions/list", version='v3', method="GET", query_params={})
|
|
22
22
|
|
|
23
23
|
def set_subscription_id(self, subscription_id=None):
|
|
24
24
|
if subscription_id:
|
|
@@ -18,7 +18,7 @@ from webull.core.request import ApiRequest
|
|
|
18
18
|
|
|
19
19
|
class OpenOrdersListRequest(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/trade/orders/list-open", version='
|
|
21
|
+
ApiRequest.__init__(self, "/trade/orders/list-open", 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 OrderDetailRequest(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/trade/order/detail", version='
|
|
21
|
+
ApiRequest.__init__(self, "/trade/order/detail", 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 TodayOrdersListRequest(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/trade/orders/list-today", version='
|
|
21
|
+
ApiRequest.__init__(self, "/trade/orders/list-today", 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 TradeCalendarRequest(ApiRequest):
|
|
20
20
|
def __init__(self):
|
|
21
|
-
ApiRequest.__init__(self, "/trade/calendar", version='
|
|
21
|
+
ApiRequest.__init__(self, "/trade/calendar", version='v3', method="GET", query_params={})
|
|
22
22
|
|
|
23
23
|
def set_market(self, market):
|
|
24
24
|
self.add_query_param("market", market)
|