Learn R Programming

Trading (version 3.1)

CalcSetForLifePnL: PnL calculation for Set For Life backtesting

Description

Calculates the PnL for a pay out structure created during backtesting

Usage

CalcSetForLifePnL(backtested_results, plot_results = FALSE)

Value

PnL figures

Arguments

backtested_results

The Set For Life results backtested against the user input

plot_results

(Optional) If TRUE, the P&L historical graphs are plotted, default FALSE

Author

Tasos Grivas <tasos@openriskcalculator.com>

Examples

Run this code

setforlife_results = SetForLifeResults()
user_input = c(10,20,30,40,50,5)
backtested_results = SetForLifeBacktesting(setforlife_results, date_since='2005-01-01', user_input)
pnl_result = CalcSetForLifePnL(backtested_results, plot_results = FALSE)

Run the code above in your browser using DataLab