Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pytrade/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def update(self, candle: Candlestick):
instrument_candles.update(candle)
self._update_event.set()

async def next(self):
async def next(self) -> bool:
await self._update_event.wait()
self._update_event.clear()
return True
4 changes: 4 additions & 0 deletions pytrade/interfaces/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,7 @@ def universe(self) -> list[IInstrumentData]:
@abstractmethod
def get(self, instrument: Instrument, granularity: Granularity) -> IInstrumentData:
raise NotImplementedError()

@abstractmethod
async def next(self) -> bool:
raise NotImplementedError()