Beta for Last 50 Daily Gains

Share:

Description

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.

Usage

1

Arguments

ticker

Character vector with a ticker symbol that Yahoo! Finance recognizes.

Value

Numeric value indicating the trailing 50-day beta.

Note

This function prints warnings which are typically nothing to worry about.

Author(s)

Dane R. Van Domelen

References

Acknowledgment: This material is based upon work supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE-0940903.

Examples

1
2
# 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.