BLD: improvements to stats output

This commit is contained in:
fredfortier
2017-12-08 15:22:53 -05:00
parent 89f9a1179e
commit 313db1def9
2 changed files with 15 additions and 0 deletions
+1
View File
@@ -671,6 +671,7 @@ class ExchangeTradingAlgorithmLive(ExchangeTradingAlgorithmBase):
except Exception as e:
log.warn('unable to calculate performance: {}'.format(e))
# Writing the stats output
csv_bytes = None
try:
csv_bytes = stats_to_algo_folder(
+14
View File
@@ -336,6 +336,20 @@ def stats_to_s3(uri, stats, algo_namespace, recorded_cols=None,
def stats_to_algo_folder(stats, algo_namespace, recorded_cols=None):
"""
Saves the performance stats to the algo local folder.
Parameters
----------
stats: list[Object]
algo_namespace: str
recorded_cols: list[str]
Returns
-------
str
"""
bytes_to_write = get_csv_stats(stats, recorded_cols=recorded_cols)
timestr = time.strftime('%Y%m%d')