PerformanceReport: Summarize Back Test Performance

Description Usage Arguments Value Examples

Description

Give 13 basic indicators base on the simple arithmetic investments.

Usage

1
PerformanceReport(df, cumPnL, initCap = NA) 

Arguments

df

The dataframe containing the portfolio.

cumPnL

the daily pnl series, including those days with no trades.

initCap

initial capital, if given 'NA', then use the total capital recorded on the first trading day in the trade log 'df'.

Value

A dataframe with 13 basic indicators.

DAYS

number of total trading days.

FIRSTTRD

the day when first trade happened, normally the first trading day.

LASTTRD

the day when last trade happened, normally the last trading day.

NONTRDPERC

percentage for non-trading days.

DAILYTRD

average number of trades daily.

TOTALPNL

total pnl.

RETPERTRD

average return per trade.

TRDHITRAT

trade-wise hit rate.

DLYHITRAT

daily hit rate.

ANNRET

annual return.

SHARPE

annual sharpe ratio.

DRAWDOWN

maximum draw down.

INRETURN

intrinsic return.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## locate tick data directory ##
dir <- system.file("extdata", '', package = "TickExec")
ticker = 000001

df <- c()
pnl <- c()

for (d in 20141012:20141017) {

dfLog = LimitBuy(dir = dir, date = d, ticker = ticker, capital = 1e6, 
                 limitPrice = NA, orderFrom = 94545, orderLast = 600, 
                 costIn = 0.001, market = 'SHSZ')

dfLogSold = MarketSell(dir = dir, date = d, orderTime = 140001, 
                       dfLog = dfLog, costOut = 0.001, market = 'SHSZ')


df <- rbind(df, dfLogSold)
pnl <- c(pnl, TotalPnL(dir = dir, df = df, date = d))
}

PerformanceReport(df = df, cumPnL = pnl, initCap = 1e6)

TickExec documentation built on May 2, 2019, 9:58 a.m.