File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 11from typing import List , Tuple
22
33from pytrade .data import CandleData
4- from pytrade .instruments import Candlestick , Granularity , Instrument
4+ from pytrade .instruments import Granularity , Instrument
55from pytrade .interfaces .broker import IBroker
66from pytrade .interfaces .client import IClient
7- from pytrade .interfaces .position import IPosition
87from pytrade .interfaces .data import IInstrumentData
8+ from pytrade .interfaces .position import IPosition
99from pytrade .models import Order
1010
1111
@@ -51,11 +51,10 @@ def subscribe(
5151 key = (instrument , granularity )
5252
5353 instrument_data = self ._data_context .get (instrument , granularity )
54-
54+
5555 # If we are already tracking this pair/granularity no need to resubscribe
5656 if key not in self ._subscriptions :
5757 self .client .subscribe (instrument , granularity , instrument_data .update )
5858 self ._subscriptions .append (key )
5959
6060 return instrument_data
61-
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ def _handle_update(self, data: IInstrumentData) -> None:
8383 # Filter out update from pending
8484 if not self ._pending_updates :
8585 self ._updates_complete .set ()
86- self ._next_timestamp + timedelta (min = self ._update_minutes )
86+ self ._next_timestamp + timedelta (minutes = self ._update_minutes )
8787
8888 def next (self ) -> None :
8989 if self ._updates_complete .is_set ():
You can’t perform that action at this time.
0 commit comments