#.. (Keep your existing functions: get_fear and greed and get current_index price)..
# --- MAIN EXECUTION BLOCK --
# Use the FRED tickers directly in the main list
tickers = [
'KRW=X', '^GSPC', "OFG', '^IXIC, 'CL=F'
"^KS11', '^KQ11',
# NEW: Use the FRED Tickers here
'DEEDTARU', # US Federal Funds Rate
'KORBASE'
# Bank of Korea Base Rate
'MSET'
"'AAPL', "TSIA', 'TQ20'
tweet
_lines =[]
for ticker in tickers:
if ticker == '@EG':
# Handle the special Fear & Greed data
Ig_score, fg_status = get_fear_and_greed ()
fg_line = f"A Fear/Greed Index: (fg_scoreł (|fg_status))"
tweet_lines.append (fg_line)
elif ticker in ['DFEDTARU', 'KORBASE']:
# Handle the special Central Bank Rate data
line = get
_central_bank_rate (ticker)
_lines. append (rate_line)
#
# Handle all financial tickers (via yfinance)
index string = get
_current_index_price (ticker)
tweet_lines. append (indestring)
... (The rest of the script for assembling tweet
_text remains the same...
'파이썬 언어' 카테고리의 다른 글
| Python으로 매달 100달러 투자 계산 (0) | 2023.07.05 |
|---|---|
| 파이썬에서 한글 사용 (0) | 2021.10.25 |
| Python, print (1) | 2021.10.06 |
| 파이썬으로 폴더내의 텍스트 파일 목록만들기 (0) | 2021.10.01 |
| 파이썬 소숫점 자리수 지정하기 (0) | 2021.10.01 |
댓글