back_test: Generic back test function

Description Usage Arguments Value

View source: R/RcppExports.R

Description

Back test by enter and exit signals with stop loss on price history. Execution is immediate. Useful for testing on daily data.

Usage

1
back_test(enter, exit, price, stop_loss = -1000, side = 1L)

Arguments

enter

bool vector of length n of enter signals

exit

bool vector of length n of exit signals

price

numeric vector of length n of prices

stop_loss

relative stop loss, must be negative

side

direction of enter order, -1:short, 1:long

Value

trades data.table with columns price_enter,price_exit,mtm_min,mtm_max,id_enter,id_exit,pnl_trade,side


QuantTools documentation built on Oct. 23, 2020, 7:54 p.m.