- Provide a strategy / screen that quickly determines whether a company is undervalued / overvalued.
- Calculate following ratios for each stock:
- Price to Book Value
- Price to Sales
- EBITDA to EV
- Price to Cashflow
- Price to Earnings
- Shareholder Yield
- Give each stock a percentile rank 1 - 100 for each of the ratios. Example: if AAPL has the best price to sales out of all the stocks you are looking at, it would get a 1 for Price to Sales bc it is in the top 1% for P / S. If a ratio can't be calculate (like negative P / E) give it a neutral score of 50
- Add up all the ratio scores for each stock
- Give the stocks a percentile rank based on the combined scores
- Each stock will have a number 1 - 100. 1 is the most undervalued out of your universe of stocks, while 100 is the most overvalued
get_datasets.py
-> calc_ratios.py
-> rank.py
-> output.py
- Will take in an excel sheet of stock tickers
- Will output excel sheet with VC2 score for every stock in the input csv
get_datasets.py
creates a.csv
file calledcompany_metrics.csv
- To request data of different stocks, edit the beginning of the file and add / change the list of stocks (make sure you are using the stock ticker)
- To run
get_datasets.py
, navigate into thevc2_screen
project folder (which has all the proj files, you can check withls
). Run the file withpython get_datasets.py
- It will take about 30 sec to run, and after you should see a file in the
vc2_screen
folder calledcompany_metrics.csv
. The csv contains all the data needed for each company for each of the next parts of the project
- Make sure you have pandas installed
- After running
get_datasets.py
, you can easily access the dataset (company_metrics.csv) in your file by using pandas - Run
df = df.read_csv("company_metrics.csv")
to load the csv as a pandas dataframe in your folder - You can now print what the data frame looks like with
print(df.head())
df.loc["aapl"].tolist()
will give you all the stats for aapl in a normal python list, you can replace aapl with any ticker