Giter Site home page Giter Site logo

alpacatrade's Introduction

AlpacaTrade

Donate with Bitcoin Donate with Ethereum Donate with Litecoin

Simple automated trading example for alpaca.markets written in C#.

Strategy

Entry

Buys at the low of day at 10:00 AM EST if the first hourly candle closes red. Day orders are used so they cancel at the market close. The strategy essentially resets everyday if there is no fill.

Exit

Sells when the position is up half the hourly 20 period Average True Range (ATR).

Stop

Holds the bag until profitable.

Requirements

You should have a live alpaca.markets brokerage account for real time data from Polygon. If you do not, you will need to modify the code to retrieve data from their free API that utilizes IEX. Using the free data means there will be missing bars on certain stocks and possibly wrong OHLC values. This will affect entries for the strategy.

Configuration

Upon first start a settings.json file will be created. This file allows you to set your Alpaca API keys and the symbols you want it to trade.

Disclaimer

Do not use this to trade with a live account without rigorous testing and do expect to lose all your money if you use the implemented strategy. I take no responsibility for how you use this code.

Risks of Automated Trading Systems

License

MIT

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.