backtest: backtest the given strategies & provide the The difference...

Description Usage Arguments Value

View source: R/backtest.R

Description

backtest the given strategies & provide the The difference between backtest & backtestV2 is , former technicallu loops all shorts/longs in one for loop. V2 - in different for loops.

Usage

1
2
backtest(pf, dataset, parms, startat = 2, longE, longX, shortE, shortX,
  calcLimits = calcLimits, ...)

Arguments

pf

- portfolio to be tested

dataset

- OHLCV with price objects, preferably xts

parms

- parameters defining slp, profit booking etc. see tradeparms function

startat

- From which row of the dataset to start testing. default 3

longE

- A function which has conditions for long entry

longX

- A function that has conditions for long exit

shortE

- A function which has conditions for short entry

shortX

- A function that has conditions for short exit

calcLimits

- This is sample function given in this package, this can be overwritten by providing as parameter

...

- Can pass instrument names like instr & other things needed by longE,shortE functions etc.

Value

portfolio name that has all the trades,transactions.


sivasunku/rulesNtrades documentation built on May 29, 2019, 11 p.m.