Giter Site home page Giter Site logo

sp100algo's Introduction

S&P100 replication algo for Alpaca API

This is an algorithm that manage your portfolio by simply replication S&P100 index by buying the underlying stocks.

Setup

$ pipenv install
$ pipenv shell
$ python main.py

This also works in Heroku.

Customization

Use of previous close prices

The code currently uses the last close price from IEX to calculate the target portfolio, and place market orders at the market open, but you can change it so that it uses the current prices, and/or runs at the market close time to be more accurate. Though, it should not diverge much unless some big shares move 10+% overnight, which would also be corrected next day.

Rebalance timing

This algo rebalances everyday. You can change it to more frequently, or less. Less frequency should be fine using IEX daily data, but if you are going intraday rebalancing, you should use Alpaca/Polygon intraday data.

Other indexes

If you follow the code, you can easily change this for S&P500 or DIJA or whatever you like, as far as there is a list on the web.

sp100algo'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.