Git Product home page Git Product logo

qt-stock-watch's Introduction

QT Stock Watch

IMPORTANT: This app is offline due to an error with the Questrade API. See issue #3. Apparently the Questrade API is working again. One can only hope!

QT Stock Watch allows you to view your Questrade account without logging in. It helps when you want to check your stock positions quickly. The web application cannot make trades. It only visualizes your primary Questrade account. However, please be aware that this application will display your live Questrade positions to the Internet. If you have any reservations about this, please do not use this app.

The Questrade OAuth API refreshes its tokens often. The app connects to a Mongo database in order to store the refresh token and some other small pieces of information about its primary user (me).

Developer installation

  1. Clone this repo
  2. cd qt-stock-watch
  3. npm install && cd client && npm install && cd .. && cp .env.example .env.development
  4. Setup your MongoDB with your provider (like mLab) and paste your connection string/URL into the appropriate spot in .env.development
  5. Visit the Questrade "My Apps" API webpage.
  6. Click "Register a Personal App".
  7. Under "Security settings" --> "OAuth scopes" make sure to select "Retrieve balances, positions, orders and executions" and "Retrieve delayed and real-time market data". Do not select "Place, modify and cancel orders"
  8. After giving the app a name, click "Save"
  9. Add https://your-applications-url.com/catch-qt-authorization as your callback URL for the QT app
  10. Copy your app ID (aka Questrade Consumer Key) into the appropriate spot in .env.development
  11. Add your email to .env.development in the appropriate spot
  12. Add the domain where your QT Stock Watch will be hosted at under the APP_HOST section of .env.development
  13. Copy .env.development to .env.production and edit the values for the production version of the app
  14. npm run dev will get you up and developing.

Setup Questrade OAuth (TODO)

  1. Complete the instructions above and then send a GET request to: https://login.questrade.com/oauth2/authorize?client_id=${process.env.QT_CONSUMER_KEY}&response_type=token&redirect_uri=https://${req.hostname}/catch-qt-authorization
  2. React will then send a POST request to /catch-qt-authorization with the new access_token, refresh_token, and expires_in values.
  3. Node will accept the values and check if they already exist. If they do, return an error via JSON. Otherwise Node will set them for the first time.

Uses:

Is This the Right Portfolio Manager/Monitor for Me?

Maybe, but, probably not. I made some assumptions when making this dashboard:

  • The user wants to visulazie their main Questrade account. In the future I may add the ability to switch between accounts. Currently, I only have one account - so I'd have to sign up for another one to test that particular functionality.
  • The user owns stocks & the user owns < ~30 stocks. The visual display of > 30 stocks may just look "weird" using QT Stock Watch.

TODOs

  1. Heroku(?) or Questrade(?) expire the tokens when you wouldn't expect them to expire. Need to find the cause of this as it's a big crux to a well working app. See Issue #1: #1
  2. Proper OAuth sign up process (see authController.getInitialQtOauth)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.