This short script identifies and filters stocks based on their financial scores and various metrics.
It fetches financial scores (Piotroski F-Score, Altman Z-Score, and Beneish M-Score) for a list of stocks from the Gurufocus website.
It retrieves overview, financial, and valuation data for stocks using the FinvizFinance library.
The retrieved data is filtered based on following criteria:
- price-to-free-cash-flow ratio is under 40
- institutional ownership is under 80%
- EPS growth is over 10%
- market capitalization is +Mid (over $2bln)
The dataframe is ranked based on metrics such as profit margin, EPS growth, and price-to-free-cash-flow ratio. The total rank is calculated by summing the ranks from different metrics.
The selected stock tickers are written to a text file named 'sorted_filtered_tickers.txt'.
In summary, this code helps filter and rank stocks based on their financial scores and metrics, allowing users to identify potentially promising investment opportunities.
The code and this file have been generated by AI.