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

Commit

Permalink
Introduce a non-interactive mode (#467)
Browse files Browse the repository at this point in the history
* Introduce a non-interactive mode

* Fix typo
  • Loading branch information
cmroche authored and DeviaVir committed Aug 14, 2017
1 parent af971ef commit 991f083
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion commands/trade.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module.exports = function container (get, set, clear) {
.option('--order_type <type>', 'order type to use (maker/taker)', /^(maker|taker)$/i, c.order_type)
.option('--paper', 'use paper trading mode (no real trades will take place)', Boolean, false)
.option('--manual', 'watch price and account balance, but do not perform trades automatically', Boolean, false)
.option('--non_interactive', 'disable keyboard inputs to the bot', Boolean, false)
.option('--currency_capital <amount>', 'for paper trading, amount of start capital in currency', Number, c.currency_capital)
.option('--asset_capital <amount>', 'for paper trading, amount of start capital in asset', Number, c.asset_capital)
.option('--avg_slippage_pct <pct>', 'avg. amount of slippage to apply to paper trades', Number, c.avg_slippage_pct)
Expand Down Expand Up @@ -157,7 +158,7 @@ module.exports = function container (get, set, clear) {
forwardScan()
setInterval(forwardScan, c.poll_trades)
readline.emitKeypressEvents(process.stdin)
if (process.stdin.setRawMode) {
if (!so.non_interactive && process.stdin.setRawMode) {
process.stdin.setRawMode(true)
process.stdin.on('keypress', function (key, info) {
if (key === 'b' && !info.ctrl ) {
Expand Down

0 comments on commit 991f083

Please sign in to comment.