PYTHON4FINANCE Telegram 1124
سرمایه‌گذاری مبتنی بر عوامل (Factor Investing) - بخش دوم
در مثال این پست اطلاعات چند نماد از Yahoo Finance دریافت می شود و سهم هایی که شاخص P/E زیر 25 دارند نمایش داده می شود. عدد ۲۵ به ما اجازه می‌دهد شرکت‌هایی با رشد بالا که هنوز ارزش‌گذاری منطقی دارند را وارد پورتفوی کنیم—مثل برخی شرکت‌های تکنولوژی که سودآورند ولی رشدشان هم چشمگیر است.
#code by @python4finance
import yfinance as yf
import pandas as pd
tickers = ['AAPL', 'MSFT', 'GOOGL', 'TSLA', 'AMZN']
data = []
for ticker in tickers:
stock = yf.Ticker(ticker)
info = stock.info
try:
pe_ratio = info['trailingPE']
price = info['currentPrice']
eps = info['trailingEps']
data.append({
'Ticker': ticker,
'Price': price,
'EPS': eps,
'P/E': pe_ratio
})
except KeyError:
print(f"Error on reading data!")
df = pd.DataFrame(data)
value_stocks = df[df['P/E'] < 25]
print("Stocks based on Value:")
print(value_stocks)


#Factor_Investing
پایتون برای مالی

🆔 www.tgoop.com/python4finance
🆔 ble.ir/python4finance
19



tgoop.com/python4finance/1124
Create:
Last Update:

سرمایه‌گذاری مبتنی بر عوامل (Factor Investing) - بخش دوم
در مثال این پست اطلاعات چند نماد از Yahoo Finance دریافت می شود و سهم هایی که شاخص P/E زیر 25 دارند نمایش داده می شود. عدد ۲۵ به ما اجازه می‌دهد شرکت‌هایی با رشد بالا که هنوز ارزش‌گذاری منطقی دارند را وارد پورتفوی کنیم—مثل برخی شرکت‌های تکنولوژی که سودآورند ولی رشدشان هم چشمگیر است.

#code by @python4finance
import yfinance as yf
import pandas as pd
tickers = ['AAPL', 'MSFT', 'GOOGL', 'TSLA', 'AMZN']
data = []
for ticker in tickers:
stock = yf.Ticker(ticker)
info = stock.info
try:
pe_ratio = info['trailingPE']
price = info['currentPrice']
eps = info['trailingEps']
data.append({
'Ticker': ticker,
'Price': price,
'EPS': eps,
'P/E': pe_ratio
})
except KeyError:
print(f"Error on reading data!")
df = pd.DataFrame(data)
value_stocks = df[df['P/E'] < 25]
print("Stocks based on Value:")
print(value_stocks)


#Factor_Investing
پایتون برای مالی

🆔 www.tgoop.com/python4finance
🆔 ble.ir/python4finance

BY Python4Finance


Share with your friend now:
tgoop.com/python4finance/1124

View MORE
Open in Telegram


Telegram News

Date: |

To view your bio, click the Menu icon and select “View channel info.” So far, more than a dozen different members have contributed to the group, posting voice notes of themselves screaming, yelling, groaning, and wailing in various pitches and rhythms. You can invite up to 200 people from your contacts to join your channel as the next step. Select the users you want to add and click “Invite.” You can skip this step altogether. 5Telegram Channel avatar size/dimensions Telegram channels enable users to broadcast messages to multiple users simultaneously. Like on social media, users need to subscribe to your channel to get access to your content published by one or more administrators.
from us


Telegram Python4Finance
FROM American