Skip to content

🪙 Machine learning algorithms for stock market trading

Notifications You must be signed in to change notification settings

Khaymon/smarttrade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💰 Smart Trade

Hello there👋 It's a minimalistic repository with machine learning and deep learning algorithms for stock market trading. For examples and code snippets, please, see the examples directory.

Table of contents

  1. Installation
  2. Downloading the data
    1. Stock market data
    2. News data
  3. Entities
    1. Containers
    2. Features
    3. Target functions
    4. Model preprocessors
    5. Models
  4. Results
  5. Todo

Installation

  • Clone the repo and cd into it:
git clone https://github.com/Khaymon/trading-algorithms.git
cd trading-algorithms
  • Install required packages:
pip install -r requirements.txt

Downloading the data

Stock market data

Data is loaded by yahoo-finance module. You can use the yf_download_data.py file to get the TOP-100 US liquidity stocks market data.

python yf_download_data.py

News data

Scrapping is our everything. Data is collected by selenium package. You need to install ChromeDriver in order to scrape investingview.com website. In the file investing_view_scrape.py you can change URL in order to receive either political or finance news. In order to get news data, just call

python yf_download_data.py

Entities

Containers

Containers are classes, which collect some data in it. Main class for stocks market data is StocksData. StocksTarget class is used to save a target for a concrete task.

Features

Features are some functions from market data. Important thing to understand before constructing your own Feature is that function shouldn't look forward in time. FeaturesList is used to aggregate many of Features in one place.

Target functions

TargetFunction is a class, which defines a function creating a target data. It can be either regression or classification target.

Model preprocessors

Model preprocessors takes stocks data and target to prepare it for being placed in a model.

Models

Of course, there are models, which take the input produced by specific model preprocessor and make predictions.

Results

Please, check results in results.md file.

Todo

  • Write backtesting class
  • Experiment with only news headers embeddings

About

🪙 Machine learning algorithms for stock market trading

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages