This is now depreciated, please do not use it for anything besides inspiration, IT WILL NOT WORK. I'm keeping it up so people can still view the inner workiings. A new version is currently in the works, please be patient.
KStock is a Robinhood Day-Trading Bot written in Python >3.5. It uses the unofficial Robinhood API, as well as historical data to continuously monitor stocks and the user's portfolio, determining when the most opportune time would be to sell/buy an individual security.
For those of you wondering, no. This does not have any cryptocurrency or options integration. Robinhood hasn't released crypto and options trading completely to everyone yet, so until that happens this is strictly just for securities.
KStock features two Tabs: Live, Backend.
The "command power-house of the app". It features all the necessary information for monitoring KStock. The Current Holdings table contains all the ticker object that the user currently owns. This is continuously updated every three seconds. The top market bar shows the status of Dow, the S&P 500, and the NASDAQ. On the bottom is a graph showing the trend of the user's equity throughout the time KStock has been on. On the right houses the settings and value of the user's account.
On the left is the Transactions Table. This shows all transactions that have currently been performed. If a security is bought, it's Ticker Symbol, Quantity Purchased, and Purchase Price are added to the table. Once sold, it's Sell Price is then added to it's row, updating it's color dependent on profitability (red = loss, green = profit)
On the right is the Queue Table. This shows all securities being analyzed, waiting to purchased. The user can add more securities by clicking Add Tick and searching for the securities ticker symbol. The user can also delete or manually purchase securities by right-clicking on the security.
The Holdings and Queue table are built such that they actually house the
Tick objects themselves. So when a transaction is performed, the actual
Tick object is moved from one table to another. This makes it easy to change the trading logic of securities.
Tick.py. Right now it uses a Price Swinging strategy, where it looks for a peak/valley and performs the transaction if it meets the criteria.
Right now, and possibly indefinitely, KStock only preforms Limit Orders. Market Orders with Robinhood are total garbage, so to implement a Limit Order KStock first sends the order. It then checks the response, and if it was filled, it executes normally (by doing all the math and putting it into the Holdings table). If however, the order wasn't filled immediately, it places the tick in a middle-man list and continuously monitors it waiting for it to be filled.
KStock also features live paper-trading to test strategies. Testing is capable using the global variable
TESTING, it allows the user to play with the live data and the logic without making a real-world trade. If
TESTING=False it will execute the commands and send the execution order to Robinhood to purchase/sell, make sure
TESTING is set to how you want it to.
KStock requires a few dependencies to get it up and running.
All of the requirements are covered in
$ pip3 install -r requirements.txt
$ python KStock.py
On first initialization, a couple error windows will pop up. That's expected, seeing as how you haven't inputted your Robinhood data yet. You'll need to input your Robinhood info by going to Settings -> API. Assuming everything is correct, you'll then need to verify your Robinhood account. Make sure you're at least an Instant account, Gold also works. Cash accounts are not yet supported so if you are cash, upgrade your account. You'll also need to disable Pattern Day Trading Protection by going into Robinhood -> Account -> Day Trade Settings.
Being developed in PyQt, KStock is cross-platform.
GNU GPL v3.0