Fixed Commission Backtest

fixed_commission_backtest(
  prices,
  theo_weights,
  trade_buffer = 0,
  initial_cash = 10000,
  commission_pct = 0,
  capitalise_profits = FALSE
)

Arguments

prices

Matrix of trade prices. Column 1 must be the timestamp or index.

theo_weights

Matrix of theoretical weights. Column 1 must be the timestamp or index.

trade_buffer

Trade buffer parameter

initial_cash

Inital cash balance

commission_pct

Percent commission charged on trades

capitalise_profits

If TRUE, utilise profits and initial cash balance in determining position sizes. If FALSE, profits accrue as a cash balance and are not reinvested.

Value

long dataframe of results - dates, trades, commissions, value of portfolio components

Details

theo_weights should be date-aligned with prices - it is up to the user to lag theo_weights as necessary to ensure that trades occur at appropriate prices.