View source: R/cross_sectional.R
| calc_market_breadth | R Documentation |
Measures the percentage of stocks meeting a condition (market participation). Useful for assessing market health and identifying broad vs narrow moves.
calc_market_breadth(condition_df, min_stocks = 10)
condition_df |
Data frame with Date column and TRUE/FALSE values |
min_stocks |
Minimum stocks required for valid calculation (default: 10) |
A data.table with Date and Breadth_[Sector] columns (0-100 scale)
# Percent of stocks above 200-day MA
data("sample_prices_weekly")
ma200 <- calc_moving_average(sample_prices_weekly, 200)
above_ma <- filter_above(calc_distance(sample_prices_weekly, ma200), 0)
breadth <- calc_market_breadth(above_ma)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.