GithubHelp home page GithubHelp logo

pair_trader's Introduction

Pair Trader

This is a webapp that allows the user to choose between 2 indices [SP 500, NASDAQ 100] and then run multiple pair trading strategies based on different scores:

  • MDM: Select pairs where the sum of squared distances between cumulative returns of two stocks is the minimum
  • MFR: Select pairs with minimum market factor ratio, an indicator that is the ratio of market betas of the two stocks
  • G: Select pairs with minimum sum of p-value of 2 Granger-Causality tests. The test determines whether price of one stock is useful in predicting the price of another

Pairs are chosen in the training duration, and then the strategy is tested in the test period. The user has control over the entry and exit thresholds used for the strategies

Start up

The initial start takes a long time since it needs to generate all the pairs and their respective metrics.

Run the Webapp

  1. Make sure the DB is up and running and has been updated with the price data. (The data_feeds repo)
  2. Edit the db_conn_details.json file with the DB connection and credential details

Via Docker

Run the command

docker-compose up

This will spin up a server on port 8091

Manually

  1. Make sure all requirements are installed in a fresh env
  2. From the root, run the command

gunicorn -b 0.0.0.0:8091 webapp.start_app:server -k gevent --timeout 600 --workers 4

pair_trader's People

Contributors

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