Coder Social home page Coder Social logo

machine-learning-in-finance's Introduction

Machine Learning in Finance

Trading Strategy Development

Date: 19 Nov 2018

Description

Recently, Artificial Neural Networks (ANNs) have been widely applied to financial type problems such as trend direction and price prediction. The project utilizes a few machine learning algorithms to run the model. Some of them are feed-forward Artificial Neural Network (ANN), Long Short-Term Memory (LSTM), Support Vector Machine (SVM) and Naive Bayes. The best model that gives the highest score on a few performance metrics will be used to run the trading process. For instance, the Naïve Bayes model will predict stock prices by fitting featured engineering techniques or other technical indicators into the model. Some of the input features includes Simple Moving Average (SMA), Moving Average Convergence Divergence (MACD), Exponential Moving Average (EMA), Relative Strength Index (RSI), Momentum (MOM), Rate of change (ROC) and other time series factors. The output of the model is used as signals and then imported to the ‘Backtrader’ python backtesting system. The results of the backtesting process are analyzed using ‘Pyfolio’, a Python library for performance and risk analysis of financial portfolios.

Prerequisites: Python

While Jupyter runs code in many programming languages, Python is a requirement (Python 3.3 or greater) for installing the Jupyter Notebook.

It is recommended to use the Anaconda distribution to install Python and Jupyter.

Install the latest version of the Anaconda 3 distribution which must include an IDE like Spyder. This is the link to download the appropriate version for different operating systems: https://www.anaconda.com/download/

Installation

After Anaconda is installed, Jupyter Notebook will be available to use.

To run Jupyter Notebook from Terminal, run: jupyter notebook (Normally jupyter.exe can be found in .../anaconda3/scripts/ directory)

From Jupyter Notebook: Open the file Groupwork Assignment Submission 3.ipynb and run it.

Packages Used

Packages can be installed by running the following command in the terminal (project working directory): "pip install -r pip_requirements.txt"

  • fix-yahoo-finance==0.0.22
  • pandas==0.22.0
  • numpy==1.14.2
  • backtrader==1.9.67.122
  • pyfolio==0.9.0
  • matplotlib==2.2.3
  • seaborn==0.9.0
  • pandas-datareader==0.7.0
  • keras==2.2.4
  • scikit-learn==0.20.0

Notes

  • This program was built by using Windows 10.
  • Python 3.6.6 was used.
  • Tested successfully on Windows 10.

machine-learning-in-finance's People

Contributors

cltai9145 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.