-
미국 증시 상장된 식음료 ETF 종목 PBJ, FTXG 데이터 파이썬 분석Data Analysis/Investment 2021. 6. 6. 12:14
Invesco Dynamic Food & Beverage ETF, First Trust Nasdaq Food & Beverage ETF
최근 들어 식음료 종목에 굉장히 관심이 많아서 이번 포스팅에서는 미국 증시에 상장된 식음료 종목으로 구성된 ETF에 대해 한번 다루어보고자 한다. 이번에도 역시나 파이썬으로 분석하고자 하고, 데이터는 내가 좋아하는 증시 데이터 사이트 https://financialmodelingprep.com/ API를 통해서 가져오도록 하겠다.
2016년 ~ 2021년 PBJ, FTXG Historical 가격 그래프
import pandas as pd import requests api='~~' pbj_price=f'https://financialmodelingprep.com/api/v3/historical-price-full/PBJ?apikey={api}' res4=requests.get(pbj_price) pbj_hist=pd.DataFrame(res4.json()['historical']) pbj_hist=pbj_hist[:1170] pbj_hist=pbj_hist[['date','close']] ftxg_price=f'https://financialmodelingprep.com/api/v3/historical-price-full/FTXG?apikey={api}' res5=requests.get(ftxg_price) ftxg_hist=pd.DataFrame(res5.json()['historical']) ftxg_hist=ftxg_hist[['date','close']] pbj_hist.columns=['date','pbj'] ftxg_hist.columns=['date','ftxg'] stock_price=pd.merge(left=pbj_hist, right=ftxg_hist, how='inner',left_on=pbj_hist.date,right_on=ftxg_hist.date) stock_price=stock_price.drop(['key_0','date_y'],axis=1) stock_price=stock_price.sort_values(by='date_x',ascending=True) import plotly.express as px fig = px.line(stock_price, x="date_x", y=['pbj','ftxg'],title='2016~2021 PBJ, FTXG Historical Prices') fig.show()
두 종목 모두 식음료 기업 중심의 ETF이기 때문에 굉장히 유사한 주가 추이를 보이고 있다.
PBJ, FTXG 보유 종목 분석
다음으로 PBJ, FTXG ETF별 종목 비중을 비교 분석을 확인해보도록 하겠다.
pbj=f'https://financialmodelingprep.com/api/v3/etf-holder/PBJ?apikey={api}' res2=requests.get(pbj) pbj_holding=pd.DataFrame(res2.json()) ftxg=f'https://financialmodelingprep.com/api/v3/etf-holder/FTXG?apikey={api}' res3=requests.get(ftxg) ftxg_holding=pd.DataFrame(res3.json()) ftxg_holding=ftxg_holding.sort_values(by='weightPercentage',ascending=False) import plotly.express as px fig = px.bar(pbj_holding, x='asset', y='weightPercentage',title='PBJ Holdings') fig.show() fig = px.bar(ftxg_holding, x='asset', y='weightPercentage',title='FTXG Holdings') fig.show()
PBJ의 경우 닥터페퍼의 KDP, 케첩으로 유명한 크래프트 하인즈, 제과업체로 유명한 Mondelez, 몬스터 드링크의 MNST, 코로나로 유명한 Constellation Brand가 ETF의 주요 종목으로 볼 수 있다.
FTXG ETF는 펫푸드, 커피, 제과 등 종합 식품 업체 SJM, 농업 회사 Bunge와 GRWG, 제빵으로 유명한 General Mills, 시리얼로 유명한 켈로그 등이 있다.
PBJ, FTXG 모두 Food와 Beverages라는 이름을 달고는 있지만 상세 종목 측면에서는 확실히 두 ETF 간 차이가 있다는 점을 확인할 수 있다.
'Data Analysis > Investment' 카테고리의 다른 글
네이버(NAVER, 035420) 지난 16년 간 개인투자자 보유 현황 분석 (0) 2021.06.30 2020년 코스피 보통주 시가배당률 Top 10 기업을 알아보자 (0) 2021.06.27 20년 12월 기준 삼성카드(029780) 주주 분포 현황 분석 With Python (0) 2021.06.05 국내 신용카드사 이용 실적 기준 시장 점유율 분석(신한카드, 삼성카드, KB국민카드, 현대카드, 롯데카드, 우리카드) (0) 2021.06.04 지난 5년간 국내 주요 시중은행 오프라인 지점 수 현황 분석 with Python, Plotly (0) 2021.06.02