2025년 금 ETF 투자 전략

Author

Portfolio Analysis Team

Published

May 5, 2025

1. 데이터 수집 및 전처리

1.1 데이터 수집

  • 금가격 데이터 수집
  • 달러 인덱스 데이터 수집
  • 미국소비자 물가지수데이터 수집
  • 미국10년만기 국채 수익율 데이터 수집
  • 미국 S&P 500 데이터 수집

1.2 데이터 전처리

Code
# NA 값 처리 및 월별 데이터 변환
treasury_xts <- na.approx(DGS10)
treasury_monthly <- apply.monthly(treasury_xts, mean)

# xts 객체 변환
gold_xts <- Cl(GLD)
dxy_xts <- Cl(`DX-Y.NYB`)
cpi_xts <- CPIAUCNS
sp500_xts <- Cl(`GSPC`)


# 월별 데이터 변환
gold_monthly <- apply.monthly(gold_xts, last)
dxy_monthly <- apply.monthly(dxy_xts, last)
cpi_monthly <- apply.monthly(cpi_xts, last)
sp500_monthly <- apply.monthly(sp500_xts, last)

# 실질금리 계산
inflation_rate <- diff(log(cpi_monthly)) * 1200
real_rates <- merge(treasury_monthly, inflation_rate)
real_rates$real_rate <- real_rates$DGS10 - lag(real_rates$CPIAUCNS, 1)

# 데이터프레임 변환
rates_df <- data.frame(
  date = index(real_rates),
  real_rate = as.numeric(real_rates$real_rate),
  stringsAsFactors = FALSE
) %>% na.omit()

gold_df <- data.frame(
  date = index(gold_monthly),
  gold = as.numeric(coredata(gold_monthly)),
  stringsAsFactors = FALSE
)

dxy_df <- data.frame(
  date = index(dxy_monthly),
  dxy = as.numeric(coredata(dxy_monthly)),
  stringsAsFactors = FALSE
)

sp500_df <- data.frame(
  date = index(sp500_monthly),
  sp500 = as.numeric(coredata(sp500_monthly)),
  stringsAsFactors = FALSE
)

# 최종 데이터셋 생성
data <- gold_df %>%
  inner_join(dxy_df, by = "date") %>%
  inner_join(rates_df, by = "date") %>%
  inner_join(sp500_df, by = "date") %>%
  na.omit()

print("각 데이터 전처리 완료!")
[1] "각 데이터 전처리 완료!"

2. 데이터 분석

2.1 10년간(2004~2024) 금, 달러, 미국 실질금리 기술 통계량

Code
summary_stats <- data %>%
  select(-date) %>%
  summary() %>%
  as.data.frame()

data |> ggplot(aes(x=date))+
  geom_line(aes(y=gold/43.8*100, col="금"))+
  geom_line(aes(y=dxy/80.85*100, col="달러인덱스"))+
  geom_line(aes(y=real_rate/8.63761493*100, col="미국실질금리"))+
  geom_line(aes(y=sp500/1211.92*100, col="S&P500"))+
  theme_bw()+
  labs(y="상대적 변동율(%)",
       title = "2004년~2024년 각 지수별 상대변동율"
       )+
  geom_hline(yintercept = 100)+
  guides(color=guide_legend("index"))+
   theme(
    text = element_text(size = 25),  # 전체 텍스트 크기 설정
    plot.title = element_text(size = 24, face = "bold"),
    axis.title = element_text(size = 20),
    axis.text = element_text(size = 18),
    legend.title = element_text(size = 20),
    legend.text = element_text(size = 18),
    legend.position = "right",
    plot.margin = margin(t = 20, r = 20, b = 20, l = 20),
    panel.grid.major = element_line(colour = "grey90"),
    panel.grid.minor = element_line(colour = "grey95")
  ) +
  labs(
    y = "상대적 변동율(%)",
    title = "2004년~2024년 각 지수별 상대변동율"
  ) +
  geom_hline(yintercept = 100, linetype = "dashed", color = "grey50", linewidth=0.8) +
  scale_color_manual(values = c("금" = "red", 
                               "달러인덱스" = "blue", 
                               "미국실질금리" = "green", 
                               "S&P500" = "purple")) +
  guides(color = guide_legend("지수", override.aes = list(linewidth=2)))

2.2 상관관계 분석

Code
cor_matrix <- cor(data %>% select(-date))
corrplot(cor_matrix,
         method = "color",
         type = "upper",
         addCoef.col = "black",
         tl.col = "black",
         tl.srt = 45,
         tl.cex = 1.5,        # 변수명 텍스트 크기
         cl.cex = 1.3,        # 컬러바 레이블 크기
         number.cex = 1.2,    # 상관계수 텍스트 크기
         title = "",
         mar = c(0,0,2,0))    # 마진 설정

2.3 금, S&P500 시계열 분석

Code
# 금 가격 시계열 분해
gold_ts <- ts(data$gold, frequency = 12)
decomp1 <- decompose(gold_ts)

par(mfrow=c(4,2), 
    mar=c(2,4,1,1),    
    oma=c(1,1,1,1),
    cex.main = 1.5,    # 메인 제목 크기
    cex.axis = 1.3,    # 축 텍스트 크기
    cex.lab = 1.4)     # 축 레이블 크기 
plot(decomp1$x, main="원본 데이터", ylab="금 가격", cex.main=1.5)
plot(decomp1$trend, main="추세", ylab="추세", cex.main=1.5)
plot(decomp1$seasonal, main="계절성", ylab="계절성", cex.main=1.5)
plot(decomp1$random, main="무작위성", ylab="무작위성", cex.main=1.5)


# S&P500 시계열 분해
sp500_ts <- ts(data$sp500, frequency = 12)
decomp <- decompose(sp500_ts)

 
plot(decomp$x, main="원본 데이터", ylab="S&P500 지수", cex.main=1.5)
plot(decomp$trend, main="추세", ylab="추세", cex.main=1.5)
plot(decomp$seasonal, main="계절성", ylab="계절성", cex.main=1.5)
plot(decomp$random, main="무작위성", ylab="무작위성", cex.main=1.5)

3. 투자 전략 분석

3.1 금 가격과 실질금리 관계

Code
ggplot(data, aes(x = real_rate, y = gold, col=date)) +
  geom_point(alpha = 0.5) +
  geom_smooth(method = "lm", color = "blue") +
  labs(title = "금 가격과 실질금리의 관계",
       x = "실질금리 (%)",
       y = "금 가격 (USD)") +
  theme_minimal()+
     theme(
    text = element_text(size = 25),  # 전체 텍스트 크기 설정
    plot.title = element_text(size = 24, face = "bold"),
    axis.title = element_text(size = 20),
    axis.text = element_text(size = 18),
    legend.title = element_text(size = 20),
    legend.text = element_text(size = 18),
    legend.position = "right",
    plot.margin = margin(t = 20, r = 20, b = 20, l = 20),
    panel.grid.major = element_line(colour = "grey90"),
    panel.grid.minor = element_line(colour = "grey95")
  )

3.2 금 가격과 S&P500 관계

Code
ggplot(data, aes(x = sp500, y = gold, col=date)) +
  geom_point(alpha = 0.5) +
  geom_smooth(method = "lm", color = "blue") +
  labs(title = "금 가격과 S&P500의 관계",
       x = "S&P500",
       y = "금 가격 (USD)") +
  theme_minimal()+
     theme(
    text = element_text(size = 25),  # 전체 텍스트 크기 설정
    plot.title = element_text(size = 24, face = "bold"),
    axis.title = element_text(size = 20),
    axis.text = element_text(size = 18),
    legend.title = element_text(size = 20),
    legend.text = element_text(size = 18),
    legend.position = "right",
    plot.margin = margin(t = 20, r = 20, b = 20, l = 20),
    panel.grid.major = element_line(colour = "grey90"),
    panel.grid.minor = element_line(colour = "grey95")
  )

3.3 금 가격과 미국 달러지수 관계

Code
ggplot(data, aes(x = dxy, y = gold, col=date)) +
  geom_point(alpha = 0.5) +
  geom_smooth(method = "lm", color = "blue") +
  labs(title = "금 가격과 미국 달러지수 관계",
       x = "달러 인덱스",
       y = "금 가격 (USD)") +
  theme_minimal()+
     theme(
    text = element_text(size = 25),  # 전체 텍스트 크기 설정
    plot.title = element_text(size = 24, face = "bold"),
    axis.title = element_text(size = 20),
    axis.text = element_text(size = 18),
    legend.title = element_text(size = 20),
    legend.text = element_text(size = 18),
    legend.position = "right",
    plot.margin = margin(t = 20, r = 20, b = 20, l = 20),
    panel.grid.major = element_line(colour = "grey90"),
    panel.grid.minor = element_line(colour = "grey95")
  )

4. 투자 전략 수정

4.1 시장 전망 분석

Code
# 2025년 예측 시각화
gold_ts <- ts(data$gold, frequency = 12)
sp500_ts <- ts(data$sp500, frequency = 12)

# ARIMA 모델 적합 및 예측
gold_forecast <- forecast(auto.arima(gold_ts), h = 12)
sp500_forecast <- forecast(auto.arima(sp500_ts), h = 12)

par(mfrow=c(2,1), 

    cex.main = 1.5,    # 메인 제목 크기
    cex.axis = 1.3,    # 축 텍스트 크기
    cex.lab = 1.4)     # 축 레이블 크기

# 금 가격 예측 그래프
plot(gold_forecast, main = "2025년 금 가격 예측",
     xlab = "시간", ylab = "금 가격")

# S&P500 예측 그래프
plot(sp500_forecast, main = "2025년 S&P500 예측",
     xlab = "시간", ylab = "S&P500")

4.2 리스크 요인 분석

Code
risk_factors <- tibble(
  위험요인 = c("S&P500 과열", "높은 상관관계", "금리 불확실성", "지정학적 리스크"),
  영향도 = c("상", "중상", "중", "중"),
  대응방안 = c(
    "S&P500 비중 축소 및 점진적 조정",
    "안전자산 비중 확대",
    "국채 듀레이션 관리",
    "금 비중 확대"
  )
)

DT::datatable(risk_factors,
              caption = "주요 리스크 요인 및 대응 방안",
              options = list(pageLength = 5))

4.3 포트폴리오 재조정 전략

Code
portfolio_revision <- tibble(
  자산명 = c("TIGER 골드선물(H)", 
           "KODEX 미국S&P500TR",
           "KODEX 미국10년국채선물",
           "TIGER 미국나스닥100커버드콜",
           "KODEX 미국배당커버드콜액티브"),
  기존비중 = c(10, 20, 30, 20, 20),
  신규비중 = c(15, 15, 35, 20, 15),
  변동폭 = c(5, -5, 5, 0, -5),
  조정금액 = c(450, -450, 450, 0, -450)
)

DT::datatable(portfolio_revision,
              caption = "포트폴리오 재조정 계획 (단위: %, 만원)",
              options = list(pageLength = 5))

5. 실행 계획

5.1 단계별 리밸런싱 계획

Code
rebalancing <- tibble(
  단계 = c("1단계", "2단계", "3단계"),
  시기 = c("1월 15일까지", "1월 25일까지", "FOMC 회의 후"),
  매수예정 = c("금 ETF +5%", "국채 ETF +5%", "필요시 추가 매수"),
  매도예정 = c("S&P500 ETF -5%", "배당커버드콜 -5%", "필요시 추가 매도"),
  조정금액 = c("±450만원", "±450만원", "상황에 따라 결정")
)

DT::datatable(rebalancing,
              caption = "단계별 리밸런싱 계획",
              options = list(pageLength = 5))

5.2 주요 이벤트 대응 전략

Code
events_strategy <- tibble(
  일자 = c("2025-01-20", "2025-01-28", "2025-01-30~31"),
  이벤트 = c("트럼프 취임식", "일본 금리 조정", "FOMC 회의"),
  영향분석 = c("정치적 불확실성 증가", "엔화 강세 가능성", "금리 동결 예상"),
  대응전략 = c(
    "안전자산 비중 확대 완료",
    "환헤지 포지션 점검",
    "전체 포트폴리오 재점검"
  )
)

DT::datatable(events_strategy,
              caption = "주요 이벤트별 대응 전략",
              options = list(pageLength = 5))

6. 모니터링 계획

6.1 주요 모니터링 지표

Code
monitoring_items <- tibble(
  지표 = c("S&P500 기술적 지표", "VIX 지수", "금/주식 상관관계", "실질금리"),
  모니터링주기 = c("일간", "일간", "주간", "주간"),
  주요관심수준 = c(
    "이동평균선 교차",
    "20 이상",
    "0.7 이상",
    "2% 이상 변동"
  ),
  대응기준 = c(
    "하락 추세 확인시 추가 비중 축소",
    "30 이상시 안전자산 비중 확대",
    "0.8 이상시 분산투자 재검토",
    "상승시 국채 비중 축소 검토"
  )
)

DT::datatable(monitoring_items,
              caption = "주요 모니터링 지표 및 대응 기준",
              options = list(pageLength = 5))
Code
# 실시간 데이터 수집
current_sp500 <- getQuote("^GSPC")
current_vix <- getQuote("^VIX")
current_gold <- getQuote("GLD")
current_treasury <- getQuote("^TNX")

# 50일 이동평균 계산
sp500_50ma <- mean(tail(Cl(GSPC), 50))

# 현재 지표값 데이터프레임 생성
current_indicators <- tibble(
  지표 = c("S&P500 현재가", 
           "S&P500 50일 이평선",
           "VIX 지수",
           "금/S&P500 상관계수",
           "미국 10년물 금리",
           "실질금리 추정치"),
  현재값 = c(
    sprintf("%.2f", as.numeric(current_sp500$Last)),
    sprintf("%.2f", sp500_50ma),
    sprintf("%.2f", as.numeric(current_vix$Last)),
    sprintf("%.2f", cor(tail(data$gold, 20), tail(data$sp500, 20))),
    sprintf("%.2f%%", as.numeric(current_treasury$Last)),
    sprintf("%.2f%%", as.numeric(current_treasury$Last) - tail(inflation_rate, 1))
  ),
  상태 = c(
    ifelse(as.numeric(current_sp500$Last) > sp500_50ma, "고평가 주의", "안정적"),
    "기준선",
    ifelse(as.numeric(current_vix$Last) > 20, "변동성 주의", "안정적"),
    ifelse(cor(tail(data$gold, 20), tail(data$sp500, 20)) > 0.7, "높은 상관성", "안정적"),
    "-",
    ifelse(as.numeric(current_treasury$Last) - tail(inflation_rate, 1) > 2, "금리 부담", "안정적")
  ),
  전일대비 = c(
    sprintf("%.2f%%", as.numeric(current_sp500$`% Change`)),
    "-",
    sprintf("%.2f%%", as.numeric(current_vix$`% Change`)),
    "-",
    sprintf("%.2f bp", (as.numeric(current_treasury$Last) - lag(as.numeric(current_treasury$Last)))*100),
    "-"
  )
)

# 현재 지표 테이블 표시
DT::datatable(current_indicators,
              caption = paste("시장 모니터링 지표 (", format(Sys.time(), "%Y-%m-%d %H:%M"), ")"),
              options = list(pageLength = 10)) %>%
  formatStyle(
    '상태',
    backgroundColor = styleEqual(
      c("고평가 주의", "변동성 주의", "높은 상관성", "금리 부담", "안정적"),
      c('#ffcdd2', '#ffcdd2', '#ffcdd2', '#ffcdd2', '#c8e6c9')
    )
  )
Code
monitoring_items <- tibble(
  지표 = c("S&P500 기술적 지표", "VIX 지수", "금/주식 상관관계", "실질금리"),
  모니터링주기 = c("일간", "일간", "주간", "주간"),
  현재수준 = c(
    sprintf("%.2f%%", (as.numeric(current_sp500$Last)/sp500_50ma - 1)*100),
    sprintf("%.2f", as.numeric(current_vix$Last)),
    sprintf("%.2f", cor(tail(data$gold, 20), tail(data$sp500, 20))),
    sprintf("%.2f%%", as.numeric(current_treasury$Last) - tail(inflation_rate, 1))
  ),
  주요관심수준 = c(
    "50일 이평선 대비 ±5%",
    "20 이상",
    "0.7 이상",
    "2% 이상 변동"
  ),
  대응기준 = c(
    "하락 추세 확인시 추가 비중 축소",
    "30 이상시 안전자산 비중 확대",
    "0.8 이상시 분산투자 재검토",
    "상승시 국채 비중 축소 검토"
  )
)
DT::datatable(monitoring_items,
              caption = "모니터링 기준 및 현재 수준",
              options = list(pageLength = 5)) %>%
  formatStyle(
    '현재수준',
    backgroundColor = styleEqual(
      c(">5%", ">20", ">0.7", ">2%"),
      c('#ffcdd2', '#ffcdd2', '#ffcdd2', '#ffcdd2')
    )
  )

7. 결론

7.1 전략 수정의 핵심 포인트

  1. 안전자산 강화
    • 금 ETF 비중 15%로 확대
    • 국채 비중 35%로 확대
    • 총 안전자산 비중 50%
  2. 위험자산 조정
    • S&P500 비중 축소로 하방 리스크 관리
    • 커버드콜 전략 유지로 변동성 관리
    • 배당주 비중 조정으로 수익 안정성 추구
  3. 단계적 실행
    • 1월 중 2단계 리밸런싱 진행
    • FOMC 회의 결과에 따른 미세조정
    • 지속적인 모니터링 및 대응

7.2 기대 효과

  1. 포트폴리오 안정성 강화
    • 안전자산 비중 확대로 변동성 감소
    • 위험자산 축소로 하방 리스크 관리
    • 분산투자 효과 개선
  2. 시장 변화 대응력 향상
    • 단계적 리밸런싱으로 시의적절한 대응
    • 주요 이벤트별 대응 전략 수립