Learn R Programming

PortfolioTesteR (version 0.1.4)

weight_equally: Equal Weight Portfolio Construction

Description

Creates equal-weighted portfolio from selection matrix. The simplest and often most robust weighting scheme.

Usage

weight_equally(selected_df)

Value

Data.table with equal weights for selected securities

Arguments

selected_df

Binary selection matrix (1 = selected, 0 = not)

Examples

Run this code
data("sample_prices_weekly")
momentum <- calc_momentum(sample_prices_weekly, lookback = 12)
selected <- filter_top_n(momentum, 10)
weights <- weight_equally(selected)

Run the code above in your browser using DataLab