Package: robinhood-portfolio-manager
Robinhood Portfolio ManagerDescriptionA python CLI  that allows a Robinhood user to easily allocate and divide his capital on different stocks.DisclaimerThis tool is intended to simplify and enhance user experience. It does not in any means convey financial advice, and the author is not responsible for any loss that might incur due to it's usage. USE AT YOUR OWN RISK.InstallationUse the package managerpipto install robinhood-portfolio-manager.$pipinstallrobinhood-portfolio-managerGetting StartedTo be able to login to Robinhood, you will need to enable multi-factor authentication and use the MFA code while logging in. Refer tothissection of robin-stocks.For convenience, you can add your username, password, and MFA code as environment variables using the following names:ROBINHOOD_USERNAME
ROBINHOOD_PASSWORD
ROBINHOOD_TOTPIf you prefer to provide the credentials at runtime, you can do so using the-cor--credentialsflag:$ropoma--credentials<username><password><totp>Do not confuse the MFA code with the 6 digit authentication code.They are different.First runBefore you can use the script, you will need to create a watchlist in Robinhood calledPortfolio(case sensitive), that will hold all the stocks you would to have as part of your portfolio.The first time you run the script, you will need to use the-g [option]or--generate_file [option]flag. This will generate an excel file (recommended for better styling and viewing) or a CSV file. To generate an excel file, run:$ropoma--generate_fileexcelor:$ropoma--generate_filecsvto generate a CSV file.Note:If both excel and CSV file exist, precedency will be given to the excel file.After generating the excel/CSV file, you will have to configure the allocation for each stock. The generated file can be found in theDocumentsdirectory on Windows and in the user'shomefolder on Linux/Mac.ExampleLet's say I would like my portfolio to consist of 4 different stocks:AAPL
AMZN
MSFT
TSLAI would start by creating a watchlist on Robinhood calledPortfoliothat would hold those 4 stocks.I would then run:$ropoma--generate_fileexcelto generate an excel file, or:$ropoma--generate_filecsvto generate a CSV file.The generated file can be found in theDocumentsdirectory on Windows and in the user'shomefolder on Linux/Mac.I would like to allocate10%toAAPL,20%toAMZN,30%toMSFT, and finally,40%toTSLA. Therefore, I would configure my excel/CSV file as follows:Finally, I would like rebalance my portfolio to match my allocations. To do so, I would run:$ropoma--rebalance--simulationIt's good practice to run the tool using the-sor--simulationflag. This allows me to check the log file and make sure that the buy/sell orders are correct. The log file will be created in the same directory as excel/CSV file, and will be namedRobinhood.log.If the log file looks good, I would then re-run the script without the--simulationflag to execute the buy/sell orders.$ropoma--rebalanceFor other supported functions, check theusagesection.UsageTo view all available functions:$ropoma-h
$ropoma--helpTo generate excel file:$ropoma-gexcel
$ropoma--generate_fileexcelTo generate csv file:$ropoma-gcsv
$ropoma--generate_fileexcelTo get planned investments (per the excel/CSV file):$ropoma-n
$ropoma--get_new_investmentsTo get current investments (stocks currently held):$ropoma-o
$ropoma-get_current_investmentsTo sell all stocks currently held:$ropoma-p
$ropoma--sell_all_stocksTo cancel all open orders:$ropoma-aall
$ropoma--cancel_open_ordersallTo cancel all opensellorders:$ropoma-asell
$ropoma--cancel_open_orderssellTo cancel all openbuyorders:$ropoma-abuy
$ropoma--cancel_open_ordersbuyFor developers:To execute thetest()function:$ropoma-d
$ropoma--debugThetestfunction can be overwritten to test sub-functions of the module.ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.DonationsLicense