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

Commit

Permalink
Notification update for clearer messages. (#745)
Browse files Browse the repository at this point in the history
  • Loading branch information
nedievas authored and DeviaVir committed Nov 24, 2017
1 parent 263d9ea commit c4fdade
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ module.exports = function container (get, set, clear) {
s.start_price = n(quote.ask).value()
s.start_capital = n(s.balance.currency).add(n(s.balance.asset).multiply(quote.ask)).value()

notify.pushMessage('Balance', 'sync balance ' + s.start_capital + ' ' + s.currency + '\n')
notify.pushMessage('Balance ' + s.exchange.name.toUpperCase(), 'sync balance ' + s.start_capital + ' ' + s.currency + '\n')

cb()
})
Expand Down Expand Up @@ -446,7 +446,7 @@ module.exports = function container (get, set, clear) {
}
else {
if (so.mode === 'live' || so.mode === 'paper') {
notify.pushMessage('Buy', 'placing buy order at ' + fc(price) + ', ' + fc(quote.bid - Number(price)) + ' under best bid\n')
notify.pushMessage('Buying ' + s.exchange.name.toUpperCase(), 'placing buy order at ' + fc(price) + ', ' + fc(quote.bid - Number(price)) + ' under best bid\n')
}
doOrder()
}
Expand Down Expand Up @@ -489,7 +489,7 @@ module.exports = function container (get, set, clear) {
}
else {
if (so.mode === 'live' || so.mode === 'paper') {
notify.pushMessage('Sell', 'placing sell order at ' + fc(price) + ', ' + fc(Number(price) - quote.bid) + ' over best ask\n')
notify.pushMessage('Selling ' + s.exchange.name.toUpperCase(), 'placing sell order at ' + fc(price) + ', ' + fc(Number(price) - quote.bid) + ' over best ask\n')
}
doOrder()
}
Expand Down Expand Up @@ -581,8 +581,8 @@ module.exports = function container (get, set, clear) {
order_complete = '\nbuy order completed at ' + moment(trade.time).format('YYYY-MM-DD HH:mm:ss') + ':\n\n' + fa(my_trade.size) + ' at ' + fc(my_trade.price) + '\ntotal ' + fc(my_trade.size * my_trade.price) + '\n' + n(my_trade.slippage).format('0.0000%') + ' slippage (orig. price ' + fc(s.buy_order.orig_price) + ')\nexecution: ' + moment.duration(my_trade.execution_time).humanize() + '\n'
console.log((order_complete).cyan)
if (so.mode === 'live' || so.mode === 'paper') {
notify.pushMessage('Buy', order_complete)
}
notify.pushMessage('Buy ' + s.exchange.name.toUpperCase(), order_complete)
}
}
s.last_buy_price = my_trade.price
delete s.buy_order
Expand Down Expand Up @@ -633,7 +633,7 @@ module.exports = function container (get, set, clear) {
order_complete = '\nsell order completed at ' + moment(trade.time).format('YYYY-MM-DD HH:mm:ss') + ':\n\n' + fa(my_trade.size) + ' at ' + fc(my_trade.price) + '\ntotal ' + fc(my_trade.size * my_trade.price) + '\n' + n(my_trade.slippage).format('0.0000%') + ' slippage (orig. price ' + fc(s.sell_order.orig_price) + ')\nexecution: ' + moment.duration(my_trade.execution_time).humanize() + '\n'
console.log((order_complete).cyan)
if (so.mode === 'live' || so.mode === 'paper') {
notify.pushMessage('Sell', order_complete)
notify.pushMessage('Sell ' + s.exchange.name.toUpperCase(), order_complete)
}
}
s.last_sell_price = my_trade.price
Expand Down

0 comments on commit c4fdade

Please sign in to comment.