yura505 / robinbot

Robinhood API based swing trading bot
132 stars 34 forks source link

Backtest.js "ReferenceError: list is not defined" #13

Closed whoizerwin closed 5 years ago

whoizerwin commented 6 years ago

Hey! This looks very promising! Thank you so much for all your work, I'm very excited to start trying this out! I am however running into a issue running the backtest.js:

*** BACKTEST today: 2018-07-07 6:11:32 PM
Downloading historical quotes...
Downloading delayed today quotes...
Downloading NASDAQ Composite index...
Downloading recent earnings...
/Users/mac/robinbot/earnings.js:77
                list.forEach(function(earning) {
                ^

ReferenceError: list is not defined
    at Request._callback (/Users/mac/robinbot/earnings.js:77:17)
    at Request.self.callback (/Users/mac/robinbot/node_modules/request/request.js:186:22)
    at Request.emit (events.js:180:13)
    at Request.<anonymous> (/Users/mac/robinbot/node_modules/request/request.js:1163:10)
    at Request.emit (events.js:180:13)
    at IncomingMessage.<anonymous> (/Users/mac/robinbot/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:272:13)
    at IncomingMessage.emit (events.js:185:15)
    at endReadableNT (_stream_readable.js:1106:12)
    at process._tickCallback (internal/process/next_tick.js:178:19)

Any chance you can help me figure out how to fix this issue? Thanks!

whoizerwin commented 6 years ago

Reinstalled the script and now I'm receiving the following:

    *** BACKTEST today: 2018-07-07 7:39:34 PM
Downloading historical quotes...
Downloading delayed today quotes...
Downloading NASDAQ Composite index...
Downloading recent earnings...
/Users/mac/bot/robinbot/earnings.js:77
                lst.forEach(function(earning) {
                    ^

TypeError: Cannot read property 'forEach' of undefined
    at Request._callback (/Users/mac/bot/robinbot/earnings.js:77:21)
    at Request.self.callback (/Users/mac/bot/robinbot/node_modules/request/request.js:186:22)
    at Request.emit (events.js:180:13)
    at Request.<anonymous> (/Users/mac/bot/robinbot/node_modules/request/request.js:1163:10)
    at Request.emit (events.js:180:13)
    at IncomingMessage.<anonymous> (/Users/mac/bot/robinbot/node_modules/request/request.js:1085:12)
    at Object.onceWrapper (events.js:272:13)
    at IncomingMessage.emit (events.js:185:15)
    at endReadableNT (_stream_readable.js:1106:12)
    at process._tickCallback (internal/process/next_tick.js:178:19)

I'm running MacOS High Sierra 10.13.5 and I've updated NPM to the latest version:

mac$ node -v
v9.11.1
yura505 commented 5 years ago

Fixed