backtest: Make judgements of an input quantler obj.

Description Usage Arguments Details Value Examples

Description

Make judgements of an input quantler obj.

Usage

1
backtest(trade.info, cash = 0, is.tax = T, tax.rate = 0.003)

Arguments

trade.info

A data frame contains the signal of trade information and stock data.

cash

Trade money at start.

is.tax

Boolean values of True or False, add trading commission or not.

tax.rate

Tax rate per trade, only valide when set is.tax to True.

is.pic

Plot results or not.

is.pic.whole

Should the pic output be in one piece together or in a list which contains all segments of different pics, only valied when is.pic is True.

plotlevel

Values in one of "1min", "60mins", "1day", only valied when is.pic is True.

is.simple

Boolean values of True or False, which means if the judgement should be done in a simple way to run faster, only valied when is.pic is True.

Details

Trade.info must be a data frame in the form of: data.frame( stock.code(character), stock.name(character), stock.price(numeric), stock.time(POSIXCT("yyyy-mm-dd hh:mm")), stock.date(as.Date("yyyy-mm-dd")), strategy.b(integer in c(-1, 0, 1), 0:"hold", 1:"buy", -1:"sell"), strategy.s(c(0,0,1,-1,0,0,....), 0:"hold", 1:"buy", -1:"sell") )

Value

A list contains the information of trading results.

Examples

1
2
3
data(stradeinfo_bp)
bt <- backtest(stradeinfo_bp, cash = 100000)
plot(bt$pic)

purplezippo/quantler documentation built on May 15, 2019, 4:27 p.m.