BLD: improved stats display to better support multiple assets per algo

This commit is contained in:
fredfortier
2017-12-07 20:26:37 -05:00
parent 87428b299f
commit 54dcc58ee8
4 changed files with 109 additions and 40 deletions
+3 -3
View File
@@ -614,12 +614,12 @@ class ExchangeTradingAlgorithmLive(ExchangeTradingAlgorithmBase):
self.add_exposure_stats(frame_stats)
print_df = pd.DataFrame(list(self.frame_stats))
# print_df = pd.DataFrame(list(self.frame_stats))
log.info(
'statistics for the last {stats_minutes} minutes:\n{stats}'.format(
stats_minutes=self.stats_minutes,
stats=get_pretty_stats(
df=print_df,
stats=self.frame_stats,
recorded_cols=recorded_cols,
num_rows=self.stats_minutes
)
@@ -644,7 +644,7 @@ class ExchangeTradingAlgorithmLive(ExchangeTradingAlgorithmBase):
if 's3://' in self.stats_output:
stats_to_s3(
uri=self.stats_output,
df=print_df,
stats=self.frame_stats,
algo_namespace=self.algo_namespace,
recorded_cols=recorded_cols,
)