Coder Social home page Coder Social logo

lauraperge / blackbox-trading-cnn Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 4.0 318.57 MB

Time Series Classification with Convolutional Neural Network: Automated Trading by Pattern Recognition (Master's Thesis)

License: GNU General Public License v3.0

Python 0.61% Jupyter Notebook 99.39%

blackbox-trading-cnn's Introduction

blackbox-trading-CNN

Time Series Classification with Convolutional Neural Network: Automated Trading by Pattern Recognition (Master's Thesis)

Prequisites

All parts are written in Python 3 (except report which is in LaTex) the requirements can be installed using:

pip install -r requirements.txt

For the CNN and Data preparation I used Jupyter notebooks.

Content

data

All downloaded datasets, trial code for data retrivals via API. /data_raw/* has all raw datasets used to create the inputs

/cnn_input/* has all folders that will hold all inputs for the CNN given the data-check-and-prep-alldata-2Y.ipynb notebook is ran.

/competing-strategies-signals/* contains the signals for the test assets based on the RSI and BB algorithmic trading trading_strategies

/logs/* gets all logs from data-check-and-prep-alldata-2Y.ipynb

notebooks

Jupyter notebooks of CNN versions and Data Preparation

  • data-check-and-prep-alldata-2Y uses prewritten modules (See utils) to preliminarily check/modify the data, label and transform it to be ready for the CNN. It visualizes the input/output data and labelling. Its input is any raw dataset (data/data_raw), its output goes into data/cnn_input/ and serves as input for the CNN notebooks.

  • Google Colab codes/* holds all asset-specific and universal model codes which are trained and tested in 3 different training periods (dates for period 2 to be checked in notebooks that are not ran on period two in case of general use.) CNN, Keras

  • financial-evaluation takes all results from the Results folder and competing-strategies-signals folder and returns financial performance measurements and figures

  • competing-strategies creates trading signals for the same datasets given RSI and BB algorithmic trading strategy

  • classification&time-evaluation takes all results from the Results folder and returns classification performance metrics

  • /Output/ contains logs from the CNN, later will contain other evaluation outputs as well

results tables

Contains all result outputs from financial-evaluation.ipynb* and classification&time-evaluation.ipynb, contains general results table

report

LaTeX report

utils

All custom modules for obtaining, examining, preparing, cleaning, labelling, and transforming data into images, as well as a code to prepare input for the tensorflow CNN

  • data cleaning: read in raw data, turn into pandas time series, resampling if needed, missing value checks, reporting feature

  • get_data: functions to retrieve historical cryptocurrency data, stock prices and fx prices via API connections (sources: bitfinex, yahoo, fred)

  • labelled_image_preparation: takes vector as input, returns the transformed version as images of given size according to given transformation strategy/strategies with relevant trading labels that serves as an input for the tensorflow CNN

labels

labelling strategy for the time series

  • trading_strategies: local min-max implementation

transform

visualize

  • ts_with_markers: show trading strategy Buy/Sell points on time series

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.