Beta for Last 50 Daily Gains
Calculate beta for a ticker symbol based on the previous 50 daily gains. The function loads in closing prices for the ticker and for SPY, calculates the last 50 daily gains, and calculates beta by regressing the fund's gains vs. SPY's gain and extracting the slope.
Character vector with a ticker symbol that Yahoo! Finance recognizes.
Numeric value indicating the trailing 50-day beta.
This function prints warnings which are typically nothing to worry about.
Dane R. Van Domelen
Acknowledgment: This material is based upon work supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE-0940903.
# Calculate TLT's beta based on the previous 50 daily gains beta.trailing50("TLT")
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.