GithubHelp home page GithubHelp logo

mason-lee19 / stock_paper_trader Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 232 KB

This will utilize neural network and machine learning models to paper trade on the stock market.

Jupyter Notebook 45.26% Python 54.74%
model-visualization neat-python neural-network paper-trading python stock-market trading-algorithms

stock_paper_trader's Introduction

Paper Trading Algorithm

This paper trading algorithm is designed to trade stocks and crypto in the market daily based on predictions made by neural network models. The algorithm pulls market data using the Alpaca API, processes it through trained neural network models stored in pickle files, and determines whether to buy or sell assets for that day. If a trade decision is made, the algorithm sends API requests through the Alpaca API to execute the trades.

Features:

  • Pulls market data from the Alpaca API.
  • Utilizes trained neural network models stored in pickle files to make trade decisions.
  • Determines whether to buy or sell assets based on the model predictions.
  • Executes trades by sending API requests through the Alpaca API.
  • Saves trade data to Google Cloud Storage for analysis and record-keeping.
  • Utilizes the Google Cloud Scheduler to run the script daily.

Google Cloud system architecture

Google Cloud System Design

Trade Algo system architecture

Trade Algo System Design

Requirements:

  • Python 3.10
  • Alpaca API account
  • Google Cloud account

Installation:

  1. Clone the repository:

    git clone https://github.com/yourusername/paper-trading-algorithm.git

  2. Install the required Python packages:

    pip install -r requirements.txt

  3. Set up your Alpaca API credentials and Google Cloud Storage credentials by following the respective documentation.

  4. Place your trained neural network models (stored as pickle files) in the Models directory.

  5. Update the API.env file with your Alpaca API credentials, Google Cloud Storage settings, and other parameters as needed.

model_visualizer.py Usage:

This repo also contains a model visualizer. This script is meant to show the buy and sell signals of backend data to visualize and ensure that the model is working.

Model Trade Visualized

Main.py Usage:

  1. Run the main script to execute the paper trading algorithm:

    python main.py

  2. The script will pull market data, process it through the neural network models, make trade decisions, and execute trades as necessary.

  3. Monitor the output and logs to track the algorithm's performance and executed trades.

Configuration:

Update the configuration file (config.ini) with your settings:

  • Alpaca API credentials (API key, secret key)
  • Google Cloud Storage settings (bucket name, credentials file path)
  • Neural network model paths
  • Trade parameters (e.g., maximum allocation, risk management rules)

Acknowledgments:

  • Alpaca API documentation
  • Google Cloud Storage documentation
  • Google Cloud Scheduler documentation
  • NEAT Python neural network training resources

stock_paper_trader's People

Contributors

mason-lee19 avatar

Watchers

 avatar  avatar

Forkers

webclinic017

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.