Skip to content

Commit

Permalink
Fix live trading for GDAX (and others) add a message to improve low v…
Browse files Browse the repository at this point in the history
…olume pre-roll (DeviaVir#470)

* Show a message now while waiting for first live trade

* Fixing pre-roll trade_cursor for exchanges that don't paginate on timestamps
  • Loading branch information
cmroche authored and DeviaVir committed Aug 14, 2017
1 parent e72d280 commit 8e77f33
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions commands/trade.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,10 @@ module.exports = function container (get, set, clear) {
limit: 1000
}
if (db_cursor) {
trade_cursor = db_cursor
opts.query.time = {$gt: db_cursor}
}
else {
trade_cursor = query_start
trade_cursor = s.exchange.getCursor(query_start)
opts.query.time = {$gte: query_start}
}
get('db.trades').select(opts, function (err, trades) {
Expand Down Expand Up @@ -262,6 +261,10 @@ module.exports = function container (get, set, clear) {
}
if (s.period) {
engine.writeReport(true)
} else {
readline.clearLine(process.stdout)
readline.cursorTo(process.stdout, 0)
process.stdout.write('Waiting on first live trade to display reports, could be a few minutes ...')
}
})
})
Expand Down

0 comments on commit 8e77f33

Please sign in to comment.