| filter_rank | R Documentation |
Selects the top N (best) or worst N stocks based on signal strength. Optimized using matrix operations for 5-10x speedup.
filter_rank(signal_df, n, type = c("top", "worst"))
signal_df |
Data frame with Date column and signal values |
n |
Number of stocks to select |
type |
"top" for highest values, "worst" for lowest values |
Binary selection matrix (1 = selected, 0 = not selected)
data("sample_prices_weekly")
momentum <- calc_momentum(sample_prices_weekly, 12)
# Select 10 highest momentum stocks
top10 <- filter_rank(momentum, 10, type = "top")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.