Skip to content

Commit 7e0100e

Browse files
author
方佳
committed
Merge branch 'main_merge_251212_2' into 'main'
feat: Add support for futures and cryptocurrency trading on Webull US See merge request webull/webull-openapi-python-sdk!7
2 parents 4579ecb + bfbf6ed commit 7e0100e

45 files changed

Lines changed: 1565 additions & 33 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎samples/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.0.4"
1+
__version__ = "1.0.5"

‎samples/data/data_client.py‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# coding=utf-8
1616

1717
from webull.data.common.category import Category
18+
from webull.data.common.contract_type import ContractType
1819
from webull.data.common.timespan import Timespan
1920
from webull.core.client import ApiClient
2021
from webull.data.data_client import DataClient
@@ -54,4 +55,30 @@
5455
if res.status_code == 200:
5556
print('get_quotes:', res.json())
5657

58+
res = data_client.futures_market_data.get_futures_depth("SILZ5", Category.US_FUTURES.name, depth=1)
59+
if res.status_code == 200:
60+
print('get_futures_depth:', res.json())
61+
62+
res = data_client.futures_market_data.get_futures_history_bars('SILZ5,6BM6', Category.US_FUTURES.name, Timespan.M1.name)
63+
if res.status_code == 200:
64+
print('get_futures_history_bars:', res.json())
65+
66+
res = data_client.futures_market_data.get_futures_tick("SILZ5", Category.US_FUTURES.name, count=10)
67+
if res.status_code == 200:
68+
print('get_futures_tick:', res.json())
69+
70+
res = data_client.futures_market_data.get_futures_snapshot("SILZ5,6BM6", Category.US_FUTURES.name)
71+
if res.status_code == 200:
72+
print('get_futures_snapshot:', res.json())
73+
74+
res = data_client.instrument.get_futures_products(Category.US_FUTURES.name)
75+
if res.status_code == 200:
76+
print('get_futures_products:', res.json())
5777

78+
res = data_client.instrument.get_futures_instrument("ESZ5", Category.US_FUTURES.name)
79+
if res.status_code == 200:
80+
print('get_futures_instrument:', res.json())
81+
82+
res = data_client.instrument.get_futures_instrument_by_code("ES", Category.US_FUTURES.name, ContractType.MONTHLY.name)
83+
if res.status_code == 200:
84+
print('get_futures_instrument_by_code:', res.json())

0 commit comments

Comments
 (0)