From bcf8d4a458abb247e38238c7afa54871269d69f2 Mon Sep 17 00:00:00 2001 From: firepol <1702718+firepol@users.noreply.github.com> Date: Mon, 15 Jan 2018 14:22:29 +0100 Subject: [PATCH] Fix output location for the HTML dump (#1132) Trade results were saved in the simulations/ folder. To avoid confusion, paper results are prefixed with "paper" (& still saved in simulations/). --- .gitignore | 1 + commands/trade.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index a18b7430d3..3bdb77862f 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ conf_* !conf-sample.js sim_result* trade_result* +paper_result* *_test backtesting_* generation_data_* diff --git a/commands/trade.js b/commands/trade.js index 818e5a7d96..305d9c2d87 100644 --- a/commands/trade.js +++ b/commands/trade.js @@ -219,16 +219,16 @@ module.exports = function container (get, set, clear) { .replace(/\{\{symbol\}\}/g, so.selector.normalized + ' - zenbot ' + require('../package.json').version) if (so.filename !== 'none') { var out_target - + var out_target_prefix = so.paper ? 'simulations/paper_result_' : 'stats/trade_result_' if(dump){ var dt = new Date().toISOString(); //ymd var today = dt.slice(2, 4) + dt.slice(5, 7) + dt.slice(8, 10); - out_target = so.filename || 'simulations/trade_result_' + so.selector.normalized +'_' + today + '_UTC.html' + out_target = so.filename || out_target_prefix + so.selector.normalized +'_' + today + '_UTC.html' fs.writeFileSync(out_target, out) }else - out_target = so.filename || 'simulations/trade_result_' + so.selector.normalized +'_' + new Date().toISOString().replace(/T/, '_').replace(/\..+/, '').replace(/-/g, '').replace(/:/g, '').replace(/20/, '') + '_UTC.html' + out_target = so.filename || out_target_prefix + so.selector.normalized +'_' + new Date().toISOString().replace(/T/, '_').replace(/\..+/, '').replace(/-/g, '').replace(/:/g, '').replace(/20/, '') + '_UTC.html' fs.writeFileSync(out_target, out) console.log('\nwrote'.grey, out_target)