Skip to content
This repository was archived by the owner on Feb 15, 2022. It is now read-only.

Commit 8d620b5

Browse files
tiagosieblerDeviaVir
authored andcommitted
Instead of hardcoding which values are included in the export, include all values in the export. Allows for further enhancement of the graphcs. (#854)
1 parent 2f54cfe commit 8d620b5

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

commands/sim.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,12 @@ module.exports = function container (get, set, clear) {
146146
return colors.stripColors(line)
147147
}).join('\n')
148148
var data = s.lookback.slice(0, s.lookback.length - so.min_periods).map(function (period) {
149-
return {
150-
time: period.time,
151-
open: period.open,
152-
high: period.high,
153-
low: period.low,
154-
close: period.close,
155-
volume: period.volume
149+
var data = {};
150+
var keys = Object.keys(period);
151+
for(i = 0;i < keys.length;i++){
152+
data[keys[i]] = period[keys[i]];
156153
}
154+
return data;
157155
})
158156
var code = 'var data = ' + JSON.stringify(data) + ';\n'
159157
code += 'var trades = ' + JSON.stringify(s.my_trades) + ';\n'

commands/trade.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,12 @@ module.exports = function container (get, set, clear) {
183183
return colors.stripColors(line)
184184
}).join('\n')
185185
var data = s.lookback.slice(0, s.lookback.length - so.min_periods).map(function (period) {
186-
return {
187-
time: period.time,
188-
open: period.open,
189-
high: period.high,
190-
low: period.low,
191-
close: period.close,
192-
volume: period.volume
186+
var data = {};
187+
var keys = Object.keys(period);
188+
for(i = 0;i < keys.length;i++){
189+
data[keys[i]] = period[keys[i]];
193190
}
191+
return data;
194192
})
195193
var code = 'var data = ' + JSON.stringify(data) + ';\n'
196194
code += 'var trades = ' + JSON.stringify(s.my_trades) + ';\n'

0 commit comments

Comments
 (0)