Skip to content

Commit

Permalink
Don't cancel market data (fixed typo too)
Browse files Browse the repository at this point in the history
  • Loading branch information
brndnmtthws committed Jan 8, 2025
1 parent 5c1e5ae commit 4e04aa9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions thetagang/ibkr.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,8 @@ async def __market_data_streaming_handler__(
"""
await self.ib.qualifyContractsAsync(contract)
ticker = self.ib.reqMktData(contract, genericTickList=generic_tick_list)
try:
await handler(ticker)
return ticker
finally:
self.ib.cancelMktData(contract)
await handler(ticker)
return ticker

async def __ticker_wait_for_condition__(
self, ticker: Ticker, condition: Callable[[Ticker], bool], timeout: float
Expand Down

0 comments on commit 4e04aa9

Please sign in to comment.