member_exit: Function to replace asset returns for non-index members with...

Description Usage Arguments Details

Description

Function to replace asset returns for non-index members with zero. Used to simulate moving to cash for returns-based simulations.

Usage

1
member_exit(df, hist_members = newHM)

Arguments

hist_members

xts object containing membership data. Column names are assumed to be asset names corresponding to those in df. Note: All entries not NA are assumed to represent active membership. #' @param df xts object containing price series of assets to rank. Every column will be treated as an independent asset. Column names of assets to rank must also appear in column names of 'hist_members'

Details

For the blotter simulation we exit any position for which the asset loses index membership and put that money in cash. For the returns-based simulation we can not do this explicitly without rebalancing all positions, which we do not want to do. However, we can simulate going to cash for that asset only, by assumming it generates zero return while it is not a member. That way, if we are holding the asset and it loses membership, it is as if we went to cash. The function will also replace missing returns (NAs) with zero.


T-Marty/trademartyr documentation built on May 31, 2019, 5:10 p.m.