Code Monkey home page Code Monkey logo

ai-strategies-stockmarket's Introduction

Artificial Intelligence Trading

App to test strategies based on artificial intelligence for investing in the stock market.

The program has two simple investment strategies to compare results. One of these strategies is simply to buy and hold. The other is a classic strategy based on the crossing of Moving Averages and the use of the Relative Strength Index or RSI.

At this moment the app has the following strategies based on artificial intelligence:

  • Deep Neural Network: strategy that tries to predict the market trend with the use of neural networks that take different technical indicators as inputs.
  • Strategy that combines in a weighted way buy-sell signals coming from moving average crosses. The weights are obtained through the PSO (Particle swarm optimization) algorithm.

Getting Started 🚀

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. The local installation has been successfully tested in Ubuntu 18.04.

Prerequisites 📋

Have installed Python3, you can check with the following command in your terminal:

python3 -V

In case you did not have Python3 installed, you can use the following commands:

sudo apt-get update
sudo apt-get install python3

To use the program with interface is necessary to intall tkinter with the following command:

sudo apt-get install python3-tk

Installing 🔧

First clone the repository:

git clone https://github.com/Solano96/AI-Strategies-StockMarket.git

Now we need to install some dependencies. To do this, execute the following command:

sh scripts/install_local.sh

Usage 📦

First we need to activate the virtual environment with:

. venv/bin/activate

You can use the command line program, that can be execute as follow:

python3 main.py --strategy <strategy-name> --quote <quote-name> --from-date <from> --to-date <to>

You can also use the short options:

python3 main.py -s <strategy-name> -q <quote-name> -f <from> -t <to>

Example:

python3 main.py --strategy neural-network --quote AAPL --from-date 2011-12-22 --to-date 2013-12-22

PD: You can use as data name any market abbreviation recognized by yahoo finance.

After the execution you can find the results in 'reports' where you can find a PDF report with a summary of the execution.

Author ✒️

  • Francisco Solano López Rodríguez

ai-strategies-stockmarket's People

Contributors

dependabot[bot] avatar solano96 avatar

Watchers

 avatar

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.