Skip to content

ryanclouser/AlpacaTrade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Releases

No releases published

Packages

No packages published

Languages