r/learnpython • • Feb 07 '21

My first proper project on Github, Yay!!

After about 2-3 years of being on and off into coding, I managed to actually finish a project end to end. It isn't very fancy but it gives me immense pleasure to finally achieve this milestone in this line of my life. I really appreciate everyone here for being so helpful and also many thanks for all the support.

The project utilizes the cool Python module Streamlit to create a visual interface to build/analyze a Portfolio management strategy using the RandomForest Regressor to predict the prices for n days ahead. It uses the random grid search for inside cross-validation to optimize the hyper parameters(different for every equity) for a chosen number of equities(stocks) by fetching the data from the nsepy module with the ability to select the timeline along with a backtester to test the strategy created.

Anyone could, infact, add a function to this script in the main long-short-equity class appropriately to use different models for prediction I believe, it's of course not investment advice but a simple representative strategy+backtester for budding systematic trading enthusiasts.

PS: Please give me suggestions on how I could make this code better and/or the pros and cons of my code.

Github: Long Short Equities

Preview

Edit: Thanks for the awards strangers :)

401 Upvotes

25 comments sorted by

View all comments

7

u/bickhaus Feb 07 '21 edited Feb 07 '21

Two suggestions: (1) add a license and (2) in bold caps, explicitly state that this does not constitute investment advice, it is provided as is, is only for testing and research, not to be relied upon for investing, etc...I’ll leave it to you to come up with the exact language to use as I do not consider this comment to be adequate legal advice or to constitute the creation of an attorney-client relationship.

Edit: note that adding a license like GPL or MIT will disclaim all warranties already , but I would still also specifically disclaim the code’s ability to be a tool for reliable investing to CYA...and this is still not meant to constitute the adequate legal advice or form an attorney-client relationship!

3

u/YaswanthBangaru Feb 07 '21

Hey, thanks for the inputs, I will check out other investment(for fun) related git repos and add it accordingly ;)