Skip to content

traderlabs/stockbot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stockbot

Alpaca algo stock trading bot

Get recommended buy and strong buy stocks daily from Nasdaq.com and get prices from Yahoo and determine which stocks moved the most the previous day, sort those by largest movers (based on open/close $) and buy those stocks if they are going up. When the stock price goes up enough, or at the end of the market day, sell any purchased stocks.

Options

Trade algo can be set to:

"rating" - uses various Nasdaq.com metrics for stock picks

"lowtomarket" - uses low price to market price

"moved" - uses which stock moved the most in past week

Buy time can bet set to:

"buyatopen" - buy the stocks when market opens and sell when price increases enough or at end of day, whatever comes first

"buyatclose" - buy the stocks before market closes, and hold until next day, if stock price goes up enough sell, or sell at end of next market day

Slack workspace

Join the conversation, get support, etc on stocksight Slack.

Requirements

Uses Alpaca https://alpaca.markets/ for trading. You will need an account with Alpaca to use stockbot.

Set env vars for Alpaca authentication api keys:

export APCA_API_KEY_ID=<key_id>
export APCA_API_SECRET_KEY=<secrect_key>
export APCA_API_BASE_URL=url

url set to:

https://api.alpaca.markets (for live)

https://paper-api.alpaca.markets (for paper)

Install requirements Alpaca python library:

pip3 install -r requirements.txt

Download

$ git clone https://github.com/shirosaidev/stockbot.git
$ cd stockbot

Download latest version

How to use

Copy sample config:

cp config.py.sample config.py

Edit config.py and adjust settings as needed.

Run stockbot:

python3 stockbot.py -t <tradealgo> -b <buytime>

Stockbot runs in an infinite loop and does daily trading. To stop it, press ctrl+c. Stocks will manually have to be sold on Alpaca web site since stockbot does not keep track of stocks when you exit it.

Disclaimer

This software is for educational purposes only. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS. Do not risk money which you are afraid to lose. There might be bugs in the code - this software DOES NOT come with ANY warranty.

Packages

No packages published

Languages

  • Python 100.0%