10 Sep 2023

Member-only story
Informula
Follow

Share
Previously on the How to Calculate PE ratio for ETFs via Python in Colab — QQQ, we discussed how to calculate PE ratio for Invesco QQQ. In this article, we are discussing how to calculate the PE for SPDR XLK.
XLK seeks to provide precise exposure to companies from technology hardware, storage, and peripherals; software; communications equipment; semiconductors and semiconductor equipment; IT services; and electronic equipment, instruments and components.
Step 0
The price-to-earnings (P/E) ratio relates a company’s share price to its earnings per share. A high P/E ratio could mean that a company’s stock is overvalued, or that investors are expecting high growth rates in the future.
Step 1: Get the shares held by holdings. We need to take a look at where the target information is located in the retrieve Excel File.
Step 3: Define a function to add the EPS (Earning per share) for every single holding. See this article for more details! Unlike previous ETF, this one does not provide market value for each holding, so we have to pull close price by ourselves and it will return a list with two values (EPS and PRICE).


Share tutorial and tool that every reader can easily absorb, grab and use! https://linktr.ee/informula
Informula
in
Python in Plain English

Informula
in
Python in Plain English

Informula
in
Dev Genius

Informula
in
JavaScript in Plain English

Informula
in
Dev Genius

Michiel van der Groen

Mahesh Choudhary

5
Aritra

Dinesh Malappagari

Roberto Gomes, PhD

Help
Status
Writers
Blog
Careers
Privacy
Terms
About
Text to speech
Teams

source

Leave a Reply

Your email address will not be published. Required fields are marked *