Giter Club home page Giter Club logo

htb-vi's Introduction

Hack The Burgh - VI

During a sleep depriving but rewarding weekend at Hack the Burgh, we set out to build an automated trading bot. This challenge was set up by Optiver, and the goal was to find a trading strategy that would allow the bot to "out-trade" the competition.

Both me and my team had little to no knowledge of the FinTech world, and it was interesting to gain some insight into how latency (or rather, lack thereof) allows one trader to gain an edge over the others!

I'm very proud of what my team accomplished: apart from learning how to program an automated trading strategy, we ended up winning the Optiver challenge! ๐Ÿฅณ ๐Ÿ“ˆ

Project - Trading Bot for the Optiver Challenge

The Challenge is to create a trading algorithm to make money by buy and selling stocks on two indeces : S&P500 (SP) and Eurostoxx (ESX).

Our project is composed of three parts:

  1. The trading algorithm itself
  2. An SMS alert functionality to communicate profits and losses
  3. A Web page for data visualization

1 - Algorithm

We use the Ichimoku Cloud Indicator, a fairly safe and simple strategy especially for Microtrading. The indicator is based on four components:

  1. Conversion Line -> midpoint of the last 9 average prices
  2. Base Line -> midpoint of the last 26 average prices
  3. Leading Span A -> midpoint of Conversion Line and Base Line
  4. Leading Span B -> midpoint of the last 52 average prices

Trading Strategy: The Leading Spans consitute the boundaries of the "cloud". When Leading Span A is moving above Leading Span B it indicates an uptrend is gaining momentum. Conversly, Leading Span B above means a downward trend is taking place. A thin cloud shows indecision and a potentially weakening trend, whereas a wide one means it is a good time to start trading.

If the trend is Up and the Conversion Line falls below the Base Line, then it is time to buy stocks. Similarly, when the crossover of Conversion Line and Base Line happens in the opposite direction, it is time to sell. To contain risk, we are allowing the bot to buy only two stocks on each market (four in total) for every "trading period". image

2 - SMS alert

The SMS alert system will send a notification to the user when a trade is closed, communicating losses and profit.

Some screenshots of the SMS functionality:

3 - front-end

  1. cd front_end/
  2. python -m SimpleHTTPServer
  3. go to 0.0.0.0:8000

The following shows an impression of what our front-end looks like. The graphs show the mid-market prices for the SP and ESX instruments, respectively. We plan to broadcast the trades our bot makes over SocketIO, which we can also show in the graphs as a scatterplot. NB: currently, the front-end only shows static data. When we get the SocketIO integration set up, we hope that we can update the chart in real time. image

Authors

Mihail Yonchev
Nout Kleef
Vincenzo Incutti

htb-vi's People

Contributors

nout-kleef avatar insertmike avatar enzo-inc 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.