backtest: Run a backtest on a strategy object

Description Usage Arguments Details Value

Description

This function performs a backtest on a compiled strategy object, and returns the same strategy object with trade data included.

Usage

1
2
backtest(strategy_object, ordersize = 100, use_price = "CLOSE",
  tx_fees = 0, init_equity = 1e+05, prior_tests = 0, progress = TRUE)

Arguments

strategy_object

strategy_object a strategy object

ordersize

the number of shares that will be traded per transaction

use_price

the price column to prefer for transactions

tx_fees

transaction fees

init_equity

starting cash value

prior_tests

the number of tests done on the data before backtesting (usually zero.)

progress

TRUE/FALSE. Specifies whether a progress bar should be displayed in the console during backtest.

Details

Backtesting tracks the number of tests done on data to quantify the risks of overfitting due to multiple testing. If a strategy parameter has been optimized using the optimize function prior to backtesting the final strategy, tests should be set to the total number of values in the optimize_range parameter used with that function during that step.

Value

a strategy object


jonaselm/fluxcapacitor documentation built on May 16, 2019, 2:53 a.m.