All Projects β†’ 4pz β†’ TradeAlgo

4pz / TradeAlgo

Licence: GPL-3.0 license
Stock trading algorithm written in Python for TD Ameritrade.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to TradeAlgo

stockbot
Alpaca algo stock trading bot
Stars: ✭ 105 (-28.57%)
Mutual labels:  stock-market, stocks, stock-trading
robinhood.tools
πŸ“ˆπŸ€‘πŸ’° Advanced trading tools and resources for Robinhood Web.
Stars: ✭ 27 (-81.63%)
Mutual labels:  stock-market, stocks, stock-trading
cira
Cira algorithmic trading made easy. A Façade library for simpler interaction with alpaca-trade-API from Alpaca Markets.
Stars: ✭ 21 (-85.71%)
Mutual labels:  trading-bot, stock-market, stocks
market-monitor
Interactive app to monitor market using Python
Stars: ✭ 20 (-86.39%)
Mutual labels:  stock-market, stocks
TradeByte
πŸ’Έ TradeByte - Stocks Trading Simulation WebApp
Stars: ✭ 30 (-79.59%)
Mutual labels:  stock-market, stocks
short-fork
Stock market helper: financial data, multipliers (PE, PS, PEG etc), insider selling, debt and short volume charts from various sources. All in one place!
Stars: ✭ 41 (-72.11%)
Mutual labels:  stock-market, stocks
pair-trading-view
Pair Trading View - .NET application for visual analysis of synthetic financial instruments based on statistical models.
Stars: ✭ 45 (-69.39%)
Mutual labels:  stock-market, stocks
StockScreener
A handy tool for screening stocks based on certain criteria from several markets around the world. The list can then be delivered to your email address (one-off or regularly via crontab).
Stars: ✭ 51 (-65.31%)
Mutual labels:  stock-market, stock-trading
Mida
The open-source and cross-platform trading framework
Stars: ✭ 263 (+78.91%)
Mutual labels:  trading-bot, stocks
TerminalStocks
Pure terminal stock ticker for Windows.
Stars: ✭ 88 (-40.14%)
Mutual labels:  stock-market, stocks
NSEDownload
Python Library to get historical, adjusted data and generate trailing returns of stocks and indices on the NSE
Stars: ✭ 65 (-55.78%)
Mutual labels:  stock-market, stocks
Automated-Fundamental-Analysis
Python program that rates stocks out of 100 based on valuation, profitability, growth, and price performance metrics, relative to the company's sector.
Stars: ✭ 82 (-44.22%)
Mutual labels:  stock-market, stocks
Blankly
πŸš€ πŸ’Έ Easily build, backtest and deploy your algo in just a few lines of code. Trade stocks, cryptos, and forex across exchanges w/ one package.
Stars: ✭ 1,456 (+890.48%)
Mutual labels:  trading-bot, stocks
tdameritradejs
TD Ameritrade Library for Node.js
Stars: ✭ 37 (-74.83%)
Mutual labels:  stocks, tdameritrade
MarketCycles.jl
Digital Signal Processing Indicators For Market Data.
Stars: ✭ 26 (-82.31%)
Mutual labels:  stock-market, stock-trading
fundamentos
Download Bovespa Stock Market fundamentals with Python.
Stars: ✭ 80 (-45.58%)
Mutual labels:  stock-market, stocks
alpha-vantage-cli
Command line tool and API for retrieving stock market data from Alpha Vantage
Stars: ✭ 33 (-77.55%)
Mutual labels:  stock-market, stock-trading
FAIG
Fully Automated IG Trading
Stars: ✭ 134 (-8.84%)
Mutual labels:  trading-bot, stock-market
NSE-Stock-Scanner
National Stock Exchange (NSE), India based Stock screener program. Supports Live Data, Swing / Momentum Trading, Intraday Trading, Connect to online brokers as Zerodha Kite, Risk Management, Emotion Control, Screening, Strategies, Backtesting, Automatic Stock Downloading after closing, live free day trading data and much more
Stars: ✭ 78 (-46.94%)
Mutual labels:  stock-market, stocks
pyEX
Python interface to IEX and IEX cloud APIs
Stars: ✭ 407 (+176.87%)
Mutual labels:  stock-market, stocks

TradeAlgo

TradeAlgo is a stock trading algorithm which places orders on stocks which will rise from market open to market close. I developed this to assist with my passion for stock trading which founded in January of 2021 and my desire to become a Quant.

How does it work?

TradeAlgo uses web scraping to pull a list of stocks which are predicted to rise already. After the list is scraped, each symbol is then checked to validate if they match the parameters set in the code. (These parameters are created by me after extensive research on how to predict a rising stock)

After this, the total balance of your TD Ameritrade account is pulled using the TD Ameritrade API and your total balance is split among the stocks which matched the set parameters. You can change how much money from your account is allocated to be used with the algorithm by changing balance at line 63 in operations/buyShares.py to the desired amount.

Finally, the buy function is called to execute all orders with a trailing stop loss to ensure minimal losses.

How do I set it up?

In secret/config.py, you will need to set your information in each variable. You will notice there is a variable called key. This variable is your API key for TD Ameritrade's Developer application. In order to make one of these, you will need to register an account at https://developer.tdameritrade.com/. Then, create a new app and wait for it to be approved. (If you are confused about the callback url, just set it to http://localhost) Once it is approved, you can add that API key to your key variable. After that, you will need to set your security questions and their answers in getData/getToken.py line 50, 54, 58, 62, 48, 52, 56, and 60 because the login process to your account is automated with chromedriver in order to get your access_token to execute TD Ameritrade functions on your account.

You will also need to change your chrome driver paths in the code to match your systems path.

Usage

To run the program, make sure everything is set up properly (including all libraries installed) and you are in the operations directory. You may adjust your STARTTIME and TOKENTIME values as you please. This will control the time you get your token and when you execute your buying program. It's important to set TOKENTIME a couple minutes earlier than STARTTIME because it takes a few minutes to get the token which is NEEDED to run the buying program.

Then, run:

python buyShares.py

or

python3 buyShares.py

If you would like to sell everything before market close, you may run:

python sellShares.py

or

python3 sellShares.py

If everything is done properly, you should see something like this:

Correct Representation

If you only want to see a list of stocks that are recommended by the algorithm:

python list.py

or

python3 list.py

This will return a list of stocks that would have been purchased if you were to run buyShares.py

Reddit Posts

r/wallstreetbets Post
r/algotrading Post

Wrap-Up

Thanks for using my code!

If you would like to contribute, please make pull requests or email me at [email protected].

Β©Vinay Venkatesh 2021

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].