Coder Social home page Coder Social logo

newellp88 / v20pypro Goto Github PK

View Code? Open in Web Editor NEW
30.0 4.0 13.0 13.76 MB

Machine learning, database, and quant tools for forex trading.

Python 100.00%
machine-learning financial-markets prediction quant linear-regression-models technical-indicators ensemble arima

v20pypro's Introduction

Introduction

This project provides several examples of common machine learning models applied to financial market predictions using TensorFlow, Keras, and Sci-kit Learn. All these models use the past 500 days of data for a given forex pairs, with a number of technical indicators added to the DataFrame. All of these models are standard, i.e. there hasn't been a major effort to optimize them and they could all be improved up in one way or another.

Ideally, this project would help make these tools more accessible for those learning to apply machine learning to financial markets.

TODO: showcase quant functions and extend database usage examples.

Ensemble Research

Using a basic list of six standard Sci-kit Learn ensemble methods, we can explore the effectiveness of these off-the-shelf models. Out of the box, these models can achieve 65-75% accuracy but could be improved by manipulating learning rates, increasing the number of estimators, or for some models, including a base estimator; i.e. another predictive model that improves the Booster's reliability.

AdaBoostRegressor

AdaBoost png

BaggingRegressor

BaggingRegressor png

LSTM with Multiple Inputs

A basic LSTM model built with Keras and using 20 input factors: open, high, low, volume, and technical indicators such as moving averages, a Stochastic Oscillator, Bollinger Bands, and others. The results are noisy and mixed, as it is unclear if more data helps or hurts the model from building meaningful connections between the data.

LSTMulti png

This model could be improved in a number of ways. Increasing the number of layers, normalizing the data, reducing the amount of input data, and increasing the amount of learning data are the most obvious choices.

Linear Models

Linear regression models are natural candidates for time series analysis. Using the standard Sci-kit learn Ridge and Linear Regression models, we can achieve roughly 80% accuracy on a single currency pair before manipulating any of the parameters.

Ridge

Ridge png

LinearRegression

LinearRegression png

The Autoregressive Integrated Moving Average (ARIMA) is not exactly a machine learning algorithm, but a linear model used in econometric analysis that can be applied to financial markets to make predictions. A quick build of this model can also produce 78% accurate predictions on the test data.

ARIMA

ARIMA png

Tensorflow NN

This is a a FOREX adaptation of Sebastian Heinz's neural network for stocks from his Medium.com article "A simple deep learning model for stock prediction using TensoFlow".

TF NN Gif

Running on the daily AUD/JPY chart, the model reaches 95% accuracy in less than 10 epochs.

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.