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

Introduce a non-interactive mode #467

Merged
merged 2 commits into from
Aug 14, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Introduce a non-interactive mode
  • Loading branch information
cmroche committed Aug 13, 2017
commit 4ca75a1a125a0ce00e86f9a8dd231caef4389a36
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