Back test by enter and exit signals with stop loss on price history. Execution is immediate. Useful for testing on daily data.
back_test(enter, exit, price, stop_loss = -1000, side = 1L)
bool vector of length n of enter signals
bool vector of length n of exit signals
numeric vector of length n of prices
relative stop loss, must be negative
direction of enter order, -1
:short, 1
:long
trades data.table with columns price_enter,price_exit,mtm_min,mtm_max,id_enter,id_exit,pnl_trade,side