BLD: Live chart refactoring

This commit is contained in:
Frederic Fortier
2017-12-29 15:54:44 -05:00
parent ac2f0bbbf8
commit 8e232ac5ef
5 changed files with 151 additions and 173 deletions
+4 -2
View File
@@ -330,6 +330,7 @@ class ExchangeTradingAlgorithmLive(ExchangeTradingAlgorithmBase):
self.algo_namespace = kwargs.pop('algo_namespace', None)
self.live_graph = kwargs.pop('live_graph', None)
self.stats_output = kwargs.pop('stats_output', None)
self._analyze_live = kwargs.pop('analyze_live', None)
self._clock = None
self.frame_stats = list()
@@ -421,10 +422,11 @@ class ExchangeTradingAlgorithmLive(ExchangeTradingAlgorithmBase):
# TODO: should we apply time skew? not sure to understand the utility.
log.debug('creating clock')
if self.live_graph:
if self.live_graph or self._analyze_live is not None:
self._clock = LiveGraphClock(
self.sim_params.sessions,
context=self
context=self,
callback=self._analyze_live,
)
else:
self._clock = SimpleClock(