Coder Social home page Coder Social logo

algo-trading's Introduction

Summary

An algorithm that combine the output of a neural network and a text analytics analysis to trade stocks. This work is part of our course "Algorithmic trading with Python" at Hult University with Professor Micheal Rolleigh.

Our team had around 4 days to dedicate to this project, during this time we had to:

  1. Get to know each other
  2. Come up with a trading strategy
  3. Find a way to implement it in Python
  4. Backtest it and compare results with a benchmark strategy

Findings

We decided to implement an LSTM model and combine its recommendation with the sentiment analysis on the tweets. In particular we decided to follow the recommendation provided by the LTSM only when the sentiment analysis was recommending the same (either buy or sell). If the 2 models did not agree with each other we would just close all the current positions and take any other position until they agreed with each other again.

At the end, our model had an outstanding performance on the traning data (due to overfitting) and a poor performance in the testing data (compared to benchmark strategy of buying and holding the assets). However, combining the LSTM model with the sentiment analysis allowed us to achieve a better performance than either of the models taken alone.

Team

Felipe Domingues
Manuel Echazarra
Nicola Bini
Tri Dung Dinh

Stocks traded

Screenshot 2021-06-17 at 3 53 46 PM

LSTM model

Screenshot 2021-06-17 at 3 54 34 PM

Performance of the LSTM model on training data

Screen Shot 2021-09-19 at 9 29 27 PM )

Performance of the LSTM model on testing data

Screenshot 2021-06-17 at 3 58 18 PM

Performance of all the tested models on testing data

Screenshot 2021-06-21 at 12 59 35 PM

Presentation pictures

35e8e755-f1d6-4658-963f-cfd78b286cf1 210ba7ac-1c24-4402-baea-463737e1d4dd da9632a0-3693-47b9-b3bb-78b522afb3fb 5c7709e1-dafe-41d0-ae42-b250d1a2a03e

algo-trading's People

Contributors

nicola-bini avatar

Stargazers

Jack Daoud 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.