GitXplorerGitXplorer
g

market-monitor

public
5 stars
1 forks
0 issues

Commits

List of commits on branch main.
Verified
283083501196ba6b927828683d33c913c71ad43a

Update README.md

ggabotechs committed 3 years ago
Verified
85b82a077d1006ea17ffb468e5de4908560f7674

Update README.md

ggabotechs committed 3 years ago
Unverified
6ab6e7c0d84ad7d66dde42bf75ad6e5b760b8816

doc: title

committed 3 years ago
Unverified
0cefa0058a9275985b802524e89a469bce0c9b4c

fix: passthrough reddit env vars

committed 3 years ago
Unverified
77ccbfb3fd437eb2aca9c40e3578092d68d0d4fa

feat: display reddit posts

committed 3 years ago
Unverified
86cddc0c72452f5b4a16748358b94425900fb296

feat: reddit posts

committed 3 years ago

README

The README file for this repository.

Market Monitor

Real time dashboard for monitoring stocks and crypto, with Twitter and Reddit sentiment analysis and useful market insights.

Install

Currently, only installation through docker is supported, so this steps assume that you have docker installed in your machine. If you don't have it installed, check this link https://docs.docker.com/get-docker/

  • Clone the project and navigate to it
git clone https://github.com/GabrielMusat/market-monitor.git && cd market-monitor
  • Create your .env file. You can copy-paste .env.example and change the values. It should contain this info:
# INFLUXDB_TOKEN can be anything, but if you are going to expose the dashboard
# over a network, you may want to make this a secure string.
INFLUXDB_TOKEN="some-token"
# INFLUXDB_ADMIN_PASSWORD is the password that will be used to access the dashboard
# as the "admin" user. It must be at least 8 characters.
INFLUXDB_ADMIN_PASSWORD="more-than-8-chars"
# SYMBOLS is a comma sepparated list with the symbols you want to monitor
SYMBOLS="AAPL,TSLA,MSFT,GOOG,NVDA,AMD,NET"
# (optional) TWITTER_TOKEN is the bearer token of your twitter application
TWITTER_TOKEN="your-apps-bearer-token"
# (optional) reddit API configuration for gathering posts from reddit
REDDIT_CLIENT_ID="your-reddit-client-id"
REDDIT_CLIENT_SECRET="your-reddit-client-secret"
REDDIT_PASSWORD="your-reddit-password"
REDDIT_USERNAME="your-reddit-username"

Note: Currently, the maximum number of symbols is 10

  • Bring up the dependencies and leave them running in the background
docker compose up -d
  • On your browser, go to http://localhost:8086 and login with username "admin" and the password from your .env file under the INFLUXDB_ADMIN_PASSWORD key
  • Once logged in, in the navigation bar at the left, go to "Boards", click on "Create Dashboard" and on "Import Dashboards" in the dropdown. The file you want to import lives in the root directory of this project, and its name is dashboard.json
  • Once imported, a new dashboard named "Market" should be available

Config changes

Edit your .env file with the new config. After that, just execute docker compose up -d

Update

  • Inside the cloned project directory, pull the latest changes git pull
  • Rebuild and launch the docker images docker compose up --build -d

Twitter sentiment analysis

If you configure the TWITTER_TOKEN in your .env file, you will get most recent tweets from some well known accounts and perform sentiment analysis using AI on them. In order to get one TWITTER_TOKEN you must create a developer account and an application on twitter.

In this link https://developer.twitter.com/apps you will find how to create one. Once you have your application created:

  • In the developer portal, select your application
  • Go to the "Keys and tokens" tab
  • Copy the "Bearer Token" under "Authentication tokens"
  • Paste it in the TWITTER_TOKEN field in your .env file

Reddit posts sentiment analysis

If you configure the Reddit API env variables, you will get most recent reddit posts about the market and perform sentiment analysis on them. You will need a Reddit account and a script application created under that account.

  • REDDIT_CLIENT_ID: your application's client id
  • REDDIT_CLIENT_SECRET: your application's client secret
  • REDDIT_PASSWORD: your account's password
  • REDDIT_USERNAME: your account's username

The application can be created here https://www.reddit.com/prefs/apps/. For more detailed instructions on how to create a reddit app follow this link https://praw.readthedocs.io/en/stable/getting_started/authentication.html#password-flow

Customize

This project follows a plugin architecture, where it's easy to develop new plugins and extend the data collection features with just a few lines of code. You can see here the current plugins that collect data from Yahoo finance api and Twitter.

Plugins are hooked up with the metrics collector here. The data collected by the plugins will be available to be displayed in the InfluxDB dashboard, which uses the flux query language to gather and display data.

You can read more about InfluxDB and flux here https://docs.influxdata.com/influxdb/v2.2/

Disclaimer

This project is for educational purposes only, use it at your own risk. The contributors of this project assume no responsibility for your trading decisions or results. We advise you to not risk any money that you are afraid to lose.