Skip to content

mega5800/algo-trading-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Autonomous Stock Trading System

Required Data for the System

In order to use the system, we require two types of data:

  1. CSV file containing news headlines regarding desired stock
    In our research, we used this Kaggle dataset containing news headlines regarding the TSLA stock.
    Each line in this file also contains a source link for the original website where given headline was published.

    This file must contain the next columns:
    1.1 News headline date.
    1.2 News headline content.

  2. CSV file containing the desired stock data
    In our research, we used Yahoo Finance to obtain different TSLA stock price data for over a decade.

    This file must contain the next columns:
    2.1 Trading day date.
    2.2 Open stock price.
    2.3 High stock price.
    2.4 Low stock price.
    2.5 Close stock price.
    2.6 Adjusted close stock price.
    2.7 Stock Volume.


System Usage

After gathering the required pieces of data, we can start using the system.
Here are the steps for using the system by running the different jupyter notebooks:

  1. Extract financial sentiment from news headlines CSV file
    Run Financial_Sentiment_Extraction_System.ipynb notebook for extracting the financial sentiment for each trading day. The final output from this notebook should be a new column called Sentiment, added to the stock data CSV file. This new column contains the sentiment score, where sentiment score ∈ {-1, 0, 1}. This output should be saved under the name processed_TSLA.csv.

  2. Predicate TSLA Close Prices
    Run predicting_close_LSTM.ipynb notebook for predicating TSLA close prices.
    In this notebook, we train a LSTM model that learns the hidden patterns between TSLA close prices.
    Using this model, we are able to predict the closing price and save this value in a new column called Predicted_Close, which is added to the processed_TSLA.csv file.
    This output should be saved under the name Processed_predicted_TSLA.csv.

  3. Training Deep Reinforcement Learning Agent
    At this stage, we should have a stock data CSV file with additional columns Sentiment and Predicted_Close.
    Here, we have a wide selection of notebooks stored at the Gym Anytrading Notebooks folder.
    In each notebook, we train a deep reinforcement learning agent with a different set of available data in its environment. By doing so, we can assess what are the effective pieces of information for training an optimal agent for autonomous stock trading.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •