Skip to content

Commit

Permalink
Update to DH version 0.21.0 (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
chipkent authored Feb 15, 2023
1 parent 871e9ff commit 1cfbd0e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

env:
IB_VERSION: 1016.01
DH_VERSION: 0.17.0
DH_VERSION: 0.21.0

jobs:
build-ib-whl:
Expand Down
27 changes: 14 additions & 13 deletions examples/example_all_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def get_contracts() -> Dict[str, Contract]:
# CFD

contract = Contract()
contract.symbol = "IBDE30"
contract.symbol = "IBDE40"
contract.secType = "CFD"
contract.currency = "EUR"
contract.exchange = "SMART"
Expand All @@ -88,38 +88,38 @@ def get_contracts() -> Dict[str, Contract]:
contract = Contract()
contract.symbol = "ES"
contract.secType = "FUT"
contract.exchange = "GLOBEX"
contract.exchange = "CME"
contract.currency = "USD"
contract.lastTradeDateOrContractMonth = "202212"
contract.lastTradeDateOrContractMonth = "06"
rst["future_1"] = contract

# find more contracts at https://www.cmegroup.com/markets/equities/sp/e-mini-sandp500.quotes.html
contract = Contract()
contract.secType = "FUT"
contract.exchange = "GLOBEX"
contract.exchange = "CME"
contract.currency = "USD"
contract.localSymbol = "ESZ2"
contract.localSymbol = "ESM3"
rst["future_2"] = contract

contract = Contract()
contract.symbol = "DAX"
contract.secType = "FUT"
contract.exchange = "EUREX"
contract.currency = "EUR"
contract.lastTradeDateOrContractMonth = "202212"
contract.lastTradeDateOrContractMonth = "06"
contract.multiplier = "1"
rst["future_3"] = contract

contract = Contract()
contract.symbol = "ES"
contract.secType = "CONTFUT"
contract.exchange = "GLOBEX"
contract.exchange = "CME"
rst["future_4"] = contract

contract = Contract()
contract.symbol = "ES"
contract.secType = "FUT+CONTFUT"
contract.exchange = "GLOBEX"
contract.exchange = "CME"
rst["future_5"] = contract

# Options
Expand All @@ -129,7 +129,7 @@ def get_contracts() -> Dict[str, Contract]:
contract.secType = "OPT"
contract.exchange = "BOX"
contract.currency = "USD"
contract.lastTradeDateOrContractMonth = "20230120"
contract.lastTradeDateOrContractMonth = "20240119"
contract.strike = 110
contract.right = "C"
contract.multiplier = "100"
Expand Down Expand Up @@ -157,12 +157,13 @@ def get_contracts() -> Dict[str, Contract]:

# Futures Options

# find more contracts at https://www.cmegroup.com/tools-information/quikstrike/options-calendar-equity-index.html
contract = Contract()
contract.symbol = "ES"
contract.secType = "FOP"
contract.exchange = "GLOBEX"
contract.exchange = "CME"
contract.currency = "USD"
contract.lastTradeDateOrContractMonth = "202209"
contract.lastTradeDateOrContractMonth = "202303"
contract.strike = 4700
contract.right = "C"
contract.multiplier = "50"
Expand Down Expand Up @@ -344,8 +345,8 @@ def get_contracts() -> Dict[str, Contract]:

rc = client.get_registered_contract(contract)
client.request_bars_historical(rc, duration=dhib.Duration.days(253),
bar_size=dhib.BarSize.DAY_1,
bar_type=dhib.BarDataType.AGGTRADES,
bar_size=dhib.BarSize.DAY_1,
bar_type=dhib.BarDataType.AGGTRADES,
keep_up_to_date = False
)
client.request_bars_realtime(rc, bar_type=dhib.BarDataType.TRADES)
Expand Down
23 changes: 12 additions & 11 deletions examples/example_read_only_functionality.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def get_contracts() -> Dict[str, Contract]:
# CFD

contract = Contract()
contract.symbol = "IBDE30"
contract.symbol = "IBDE40"
contract.secType = "CFD"
contract.currency = "EUR"
contract.exchange = "SMART"
Expand All @@ -84,38 +84,38 @@ def get_contracts() -> Dict[str, Contract]:
contract = Contract()
contract.symbol = "ES"
contract.secType = "FUT"
contract.exchange = "GLOBEX"
contract.exchange = "CME"
contract.currency = "USD"
contract.lastTradeDateOrContractMonth = "202212"
contract.lastTradeDateOrContractMonth = "06"
rst["future_1"] = contract

# find more contracts at https://www.cmegroup.com/markets/equities/sp/e-mini-sandp500.quotes.html
contract = Contract()
contract.secType = "FUT"
contract.exchange = "GLOBEX"
contract.exchange = "CME"
contract.currency = "USD"
contract.localSymbol = "ESZ2"
contract.localSymbol = "ESM3"
rst["future_2"] = contract

contract = Contract()
contract.symbol = "DAX"
contract.secType = "FUT"
contract.exchange = "EUREX"
contract.currency = "EUR"
contract.lastTradeDateOrContractMonth = "202212"
contract.lastTradeDateOrContractMonth = "06"
contract.multiplier = "1"
rst["future_3"] = contract

contract = Contract()
contract.symbol = "ES"
contract.secType = "CONTFUT"
contract.exchange = "GLOBEX"
contract.exchange = "CME"
rst["future_4"] = contract

contract = Contract()
contract.symbol = "ES"
contract.secType = "FUT+CONTFUT"
contract.exchange = "GLOBEX"
contract.exchange = "CME"
rst["future_5"] = contract

# Options
Expand All @@ -125,7 +125,7 @@ def get_contracts() -> Dict[str, Contract]:
contract.secType = "OPT"
contract.exchange = "BOX"
contract.currency = "USD"
contract.lastTradeDateOrContractMonth = "20230120"
contract.lastTradeDateOrContractMonth = "20240119"
contract.strike = 110
contract.right = "C"
contract.multiplier = "100"
Expand Down Expand Up @@ -153,12 +153,13 @@ def get_contracts() -> Dict[str, Contract]:

# Futures Options

# find more contracts at https://www.cmegroup.com/tools-information/quikstrike/options-calendar-equity-index.html
contract = Contract()
contract.symbol = "ES"
contract.secType = "FOP"
contract.exchange = "GLOBEX"
contract.exchange = "CME"
contract.currency = "USD"
contract.lastTradeDateOrContractMonth = "202209"
contract.lastTradeDateOrContractMonth = "202303"
contract.strike = 4700
contract.right = "C"
contract.multiplier = "50"
Expand Down

0 comments on commit 1cfbd0e

Please sign in to comment.