yura505 / robinbot

Robinhood API based swing trading bot
134 stars 35 forks source link

TypeError: Cannot read property 'unallocated_margin_cash' of null #17

Closed cfarthingale closed 6 years ago

cfarthingale commented 6 years ago

./robinbot.js *** ROBINBOT (paper mode) today: 2018-09-08 11:44:11 Downloading instruments: [ AMD HP KR STI VGT PLNT FFTY UGA XLF IBB ] Downloading nonzero positions... Downloading account information... /home/zero/stock-software/robinbot/account.js:11 _cash = n(body.results[0].margin_balances.unallocated_margin_cash).value() ^

TypeError: Cannot read property 'unallocated_margin_cash' of null at Request._callback (/home/zero/stock-software/robinbot/account.js:11:59) at Request.self.callback (/home/zero/stock-software/robinbot/node_modules/request/request.js:186:22) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request. (/home/zero/stock-software/robinbot/node_modules/request/request.js:1163:10) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at IncomingMessage. (/home/zero/stock-software/robinbot/node_modules/request/request.js:1085:12) at Object.onceWrapper (events.js:313:30) at emitNone (events.js:111:20)

Receive this error when running robinbot on fresh install of Debian stretch

cfarthingale commented 6 years ago

Further research indicates this API value is null while using a cash account suggesting one way around this error is to change to an Instant account.