backtestBeta2Neutral: Backtest a two-asset beta neutral strategy

View source: R/beta.R

backtestBeta2NeutralR Documentation

Backtest a two-asset beta neutral strategy

Description

Idealized backtest on closing prices under a 2-asset beta neutral strategy. The estimating of the betas can be done on a rolling basis, optionally. Returns various measures of performance and plots the total log-growth of the indidivual assets compared to the benchmark and the beta-neutral portfolio.

Usage

backtestBeta2Neutral(
  asset,
  rolling,
  bankroll,
  rate,
  numDays,
  sampleSize,
  fraction
)

Arguments

asset

the high beta asset to long

rolling

whether to use a rolling window of size sampleSize

bankroll

initial bankroll

rate

the risk-free rate earned on cash

numDays

number of days to trade

sampleSize

initial training data size/rolling window size

fraction

fraction to trade in stocks versus cash


shill1729/trader documentation built on Dec. 27, 2022, 10:55 p.m.