Skip to content

Stock-Stalker/predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

The predictive model behind StockStalker

StockStalker - Predictor API

Table of Contents

Make Commands

stop: Stop the running server

rm: Remove all unused containers

rm-all: Stop and remove all containers

rmi: Remove stockstalker images without removing base images. Useful for speeding up build time when switching from one start script to another such as make start to make test

rmi-all: Remove all images

purge: Use with caution Completely purge Docker containers, networks, images, volumes, and cache

lint: Run flake8

build: Build development server without running the server

start: Start development server at port 8080

reload: Stop development server and restart the server at port 8080

hard-reload: Stop container, remove container, rebuild container, and start development server

debug: Start development server in debug mode

test: Start test server

test-security: Test security vulnerabilities (must have snyk installed globally)

test-image-security: Test security vulnerabilities for base images (must have snyk installed globally)

reload-test: Reload test server

hard-reload-test: Remove container, rebuild container, and start test server

Required Software

How to Run

Clone the repo

git clone git@github.com:Stock-Stalker/predictor.git

cd into the directory

cd predictor

Rename .env.sample to .env

mv .env.sample .env

Edit the .env file to contain your environment variables

vim .env

Run the application!

make start

To stop the app press CNTRL + C. Then run:

make stop

API Documentation

Base URL:

https://stockstalker.tk/predictor/

Request

GET https://stockstalker.tk/predictor/:symbol

In order to make a request to predictor, you must specify which company's stock you'd like to predict.

You can pass through the stock's ticker symbol (i.e: AAPL for Apple, or AMZN for Amazon).

Response

The predictor will scrape headlines for the day, and make predictions based on the headlines. It will then return a list of integers denoting its predictions

The predictor will, behind the scenes, scrape and cache top daily headlines for the company that you specify. It will return a list of predictions:

{
    "predictions": [0, 1, 1, 1]
}

Types:

  • predictions: Array/list of integers

    • integer options:
      • 0 -> stock is predicted to decrease (negative)
      • 1 -> stock is predicted to increase (positive)
      • 2 -> stock is predicted to hold (neutral)

In the event that there is no news on a given day for the company you provide (for example, if today no one has published any articles containing keywords about "Apple" or "AAPL"), the predictor will always return 2. This corresponds to a neutral prediction. The reasoning for this is that if we do not have data on a given day, we are unable to make a confident prediction as to the behavior of the stock.

Usage and Examples

GET https://stockstalker.tk/predictor/AAPL

Running Tests

To run tests simple run:

make test

If any of the tests fail or if the tests do not have at least 90% coverage the command will exit with a status code of 1.

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •