Learn R Programming

PortfolioTesteR (version 0.1.4)

filter_threshold: Filter by Threshold Value

Description

Selects stocks above or below a threshold value.

Usage

filter_threshold(signal_df, value, type = c("above", "below"))

Value

Binary selection matrix

Arguments

signal_df

Data frame with signal values

value

Threshold value

type

"above" or "below"

Examples

Run this code
data("sample_prices_weekly")
momentum <- calc_momentum(sample_prices_weekly, 12)
# Select stocks with positive momentum
positive <- filter_threshold(momentum, 0, type = "above")

Run the code above in your browser using DataLab