Git Product home page Git Product logo

day_constrained_algo_trading's Introduction

A Day Trading Constrained Low Frequency Trading Algorithm

Day Trading constraints prevents retail investors from opening and closing positions within the same day. As a result, retail investors have to carry their positions overnight. This shouldn't, however, discourage the retail investors to exploit statistical models. Here, I utilize a couple of statistical models and measure their performances under the day trading constraints.

The algorithm uses the price and volume data to predict next day return. Given the prediction, it opens positions at market close. The positions are closed next day if they hit a stop loss or target level intraday. If a position survives until the market close, it either is rolled over to next day or closed in favor of another asset based on the updated predictions.

api.py

Implements TD Ameritrade API.

options_saver.py

As the TD Ameritrade API, along with most other inexpensive data resources, does not provide historical option price data, this tool saves the current day option prices which can be used to create a database of historical option prices.

backtest.py

Implements a backtesting environment for the algorithm and an implementation of the algorithm.

Sample Files

05-31.csv is a sample output for options_saver.py which documents the option chains of selected tickers on 31 May 2020. data.csv contains the pricing and volume data in 5 minutes frequency for selected tickers that is used in the backtesting.

day_constrained_algo_trading's People

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.