AAPL STOCK PREDICTION MODEL
DUSTIN JASMIN
GOAL
• Develop a Machine Learning model that uses:
• Relative Strength Index (RSI)
• Moving Average Convergence Divergence (MACD)
• To predict future % returns on AAPL shares
• Build trading bot that uses model to make buy and sell orders based on live
market data
PROCESS
• Imported many libraries
• Notables:
• Technical Analysis (TA)
• NumPy, Pandas
• Alpaca API
• CometML
• Pytorch, Keras, Tensorflow
PROCESS, CONTINUED
• Used Alpaca to import AAPL stock data (2016-2018):
• Each data point was in 4-hour intervals
• Used RSI, MACD and Closing Share Price for each data point
• Converted each dataset to NumPy arrays
• Developed Multi-Layered Perceptron
• Feed forward neural network
• Consists of three types of layers—the input layer, output layer and hidden layer
• The input layer receives the input signal to be processed.
• Output layer performs prediction and classification
• An arbitrary number of hidden layers that are placed in between the input and output layer are the true computational engine
of the MLP.
CODE, PRE-PROCESSING
• Added data to DataFrames
• Close series = 2 years of AAPL closing
price
• Added close series to RSI() and
MACD() object
• Converted to NumPy array
CODE, NORMALIZE
• Set data to between 0 and 1 for easier
computation
• Used unsqueeze() to format data for training
CODE, MODEL & PREDICTION
PERFORMANCE
• Model Learning Loss has
sharp decline in beginning
• Steady decline afterwards
• Epoch duration (time to
cycle through dataset)
decreases over time
SUMMARY
• Did not get to develop trading bot
• Personal Assessment:
• Based off loss data, model seemed to performed decently
• Project made me research/learn more about ML
• Data processing is toughest part in ML

StockPredictionML Presentation

  • 1.
    AAPL STOCK PREDICTIONMODEL DUSTIN JASMIN
  • 2.
    GOAL • Develop aMachine Learning model that uses: • Relative Strength Index (RSI) • Moving Average Convergence Divergence (MACD) • To predict future % returns on AAPL shares • Build trading bot that uses model to make buy and sell orders based on live market data
  • 3.
    PROCESS • Imported manylibraries • Notables: • Technical Analysis (TA) • NumPy, Pandas • Alpaca API • CometML • Pytorch, Keras, Tensorflow
  • 4.
    PROCESS, CONTINUED • UsedAlpaca to import AAPL stock data (2016-2018): • Each data point was in 4-hour intervals • Used RSI, MACD and Closing Share Price for each data point • Converted each dataset to NumPy arrays • Developed Multi-Layered Perceptron • Feed forward neural network • Consists of three types of layers—the input layer, output layer and hidden layer • The input layer receives the input signal to be processed. • Output layer performs prediction and classification • An arbitrary number of hidden layers that are placed in between the input and output layer are the true computational engine of the MLP.
  • 5.
    CODE, PRE-PROCESSING • Addeddata to DataFrames • Close series = 2 years of AAPL closing price • Added close series to RSI() and MACD() object • Converted to NumPy array
  • 6.
    CODE, NORMALIZE • Setdata to between 0 and 1 for easier computation • Used unsqueeze() to format data for training
  • 7.
    CODE, MODEL &PREDICTION
  • 8.
    PERFORMANCE • Model LearningLoss has sharp decline in beginning • Steady decline afterwards • Epoch duration (time to cycle through dataset) decreases over time
  • 9.
    SUMMARY • Did notget to develop trading bot • Personal Assessment: • Based off loss data, model seemed to performed decently • Project made me research/learn more about ML • Data processing is toughest part in ML