torreyleonard / algotrader

Simple algorithmic stock and option trading for Node.js.
https://www.npmjs.com/package/algotrader
Apache License 2.0
635 stars 119 forks source link

Can't seem to sign in properly. #65

Open alexjavad opened 2 years ago

alexjavad commented 2 years ago

I'm attempting to sign into Robinhood using algotracker's methods. I.E. I'm doing this:

const User = robinhood.User;

const myUser = new User("username", "password", "token");

myUser.authenticate() .then(() => { // User was authenticated console.log("User authenticated...") }) .catch(error => { // Either the request failed, or Robinhood responded with an error. // (Ex: you don't have internet access or your user credentials were incorrect) });

However, I'm getting the following error:

Robinhood responded with code 401: unauthorized.

This at one point did download a number of objects from Robinhood when placing a call to: const option = await Instrument.getBySymbol(optionSignal.Ticker);

Your guess is as good as mine - better if you get it right.