Skip to content

Repository files navigation

FML

FML - Arizona Zervas (10/10 would recommend)

Running Instructions

Two terminals are required to run this program. To run the frontend, first, in frontend/src/environments, create a duplicate of the file environment.prod.ts in the same directory, but rename the duplicate to environment.ts. Next, cd into the "frontend" directory and run ng serve. To run the backend, cd into the backend and run the run.py python script with the argument "run" as such: python run.py run. Prior to running the script, ensure that all necessary dependencies have been installed by running pip install -r requirements.txt through pip. Please note that this project was made to be compatible with Python 3.

Once both the frontend and backend are running, navigate to localhost:4200 on your browser (preferably Chrome) to access the app.

ML

LSTM

Overview

Using Long-Short Term Memory, we are training a model to see a large set of data of both massaged prices and other indicies.

Creating Data for LSTM

from gen_lstm_data import gen_data
eq = 'VSLR' ## Ticker of the stock you want to look at, be sure you have added this to the data/equities folder
train_split = 0.8 ## Percent of data to use for training data, rest to test data
days = 500 ## How many days you want to be using of the data. As of now, there is no check on size, so if you put too large of a number, you may get index OB
look_back = 19 ## How many days you want to use to predict the next one. This will be the second dimension of your X data
label_range = 5 ## How many days you want to look at price change over. This will determine how the labels are calculated
verbose = False ## Prints out some shapes and other relevant things if you are curious.
X_train, y_train, X_test, y_test = gen_data(eq, train_split, days, look_back, label_range, verbose)
## X_train.shape = (days * train_split - (look_back + 1), look_back, 25)
## y_test.shape = (days * train_split - (look_back + 1), 10)
## X_test.shape = (days * (1 - train_split) - (look_back + 1), look_back, 25)
## y_test.shape = (days * (1 - train_split) - (look_back + 1), 10)

Features

VectorDescription
Vector 0Volumes
Vector 1Prices
Vector 2SMA
Vector 3EMA
Vector 4Wilder MA
Vector 5Upper Bolinger Band
Vector 6Lower Bolinger Band
Vector 7Accumulative Swing Index
Vector 8Average True Range
Vector 9Balance of Power
Vector 10Gopalakrishnan Range Index
Vector 11Price - Pivot Point
Vector 12Pring's Know Sure Thing - SMA(Pring's Know Sure Thing)
Vector 13MACD - SMA(MACD)
Vector 14d KST * d TRIX
Vector 15TRIX - MA(TRIX)
Vector 16RSI
Vector 17MA(OHLC/4, 1)
Vector 18MA(OHLC/4, 3)
Vector 19MA(OHLC/4, 5)
Vector 20MA(OHLC/4, 7)
Vector 21MA(OHLC/4, 9)
Vector 22West Texas
Vector 23Wilshire US Real Estate
Vector 24SNP

Labels

Label
-10% <= (p_1 - p_0)/p_0 < - 7%
- 7% <= (p_1 - p_0)/p_0 < - 5%
- 5% <= (p_1 - p_0)/p_0 < - 3%
- 3% <= (p_1 - p_0)/p_0 < - 1%
- 1% <= (p_1 - p_0)/p_0 < 1%
1% <= (p_1 - p_0)/p_0 < 3%
3% <= (p_1 - p_0)/p_0 < 5%
5% <= (p_1 - p_0)/p_0 < 7%
7% <= (p_1 - p_0)/p_0 < 9%
9% <= (p_1 - p_0)/p_0 < 100%

Where p_1 is the price at the predicted day and p_0 is the price at predicted day - label_range

Signal Distributions

Overview

This algorithm takes in a series of buy/sell signals from a variety of market indicators, determines how to combine these signals into an overall buy/sell signal and then compares the strength of these signals across equities.

About

FML

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages