Functions for loading, processing, and managing financial market data for ANNEM simulations. Includes data retrieval from various sources, return calculations, and market sentiment processing. Load Market Data

Downloads and processes daily stock market data for ANNEM analysis. Uses quantmod to retrieve data from Yahoo Finance.

load_market_data(symbols, period = "2y", from = NULL, to = NULL)

Arguments

symbols

Character vector of stock symbols (e.g., c("AAPL", "MSFT"))

period

Character string specifying time period (default: "2y")

from

Date to start data collection (optional)

to

Date to end data collection (optional)

Value

List containing:

  • prices: Matrix of adjusted close prices

  • returns: Matrix of log returns

  • volatility: Vector of rolling volatility measures

Examples

if (FALSE) { # \dontrun{
data <- load_market_data(c("AAPL", "MSFT", "GOOGL"))
head(data$prices)
head(data$returns)
} # }