Lean
Lean copied to clipboard
Futures contract Tick objects in Research Environment
Expected Behavior
We get the same ticks whether we call qb.history or qb.history[Tick]
Actual Behavior
qb.history[Tick] only provides open interest data
Potential Solution
N/A
Reproducing the Problem
qb = QuantBook()
future = qb.add_future(Futures.Indices.SP_500_E_MINI)
qb.set_start_date(2024, 1, 1)
chain = qb.future_chain(future.symbol, flatten=True).data_frame
contract_symbol = chain[chain.expiry > qb.time + timedelta(7)].sort_values('openinterest').index[-1]
qb.add_future_contract(contract_symbol, fill_forward=False)
qb.history(contract_symbol, timedelta(3), Resolution.TICK)
history = qb.history[Tick](contract_symbol, timedelta(3), Resolution.TICK)
for i, tick in enumerate(history):
print(i, tick)
System Information
QC Cloud
Checklist
- [x] I have completely filled out this template
- [x] I have confirmed that this issue exists on the current
masterbranch - [x] I have confirmed that this is not a duplicate issue by searching issues
- [x] I have provided detailed steps to reproduce the issue