doSeriesOfSimulateStopLimitPrices: doSeriesOfSimulateStopLimitPrices

Description Usage Arguments Examples

Description

a function which can help you transform your forward sampling xts to data.frame

Usage

1
2
doSeriesOfSimulateStopLimitPrices(longFswXtDf, limitRatioSeq = seq(0.01, 0.1,
  0.01), stopRatioSeq = seq(0.01, 0.1, 0.01), NonHitIdxValue = 1e+06)

Arguments

longFswXtDf

a forward sampling xts with long format

limitRatioSeq

series of limit return ratio

stopRatioSeq

series of stop return ratio

NonHitIdxValue

when the price not hit stop or limit, assign this value

Examples

1
2
Xt = getSymbols('2330.TW', auto.assign = F)
Xt %>% Pt2Rt %>% ForwardSlidingWindow(20) %>% FswXt2Df(index(Xt)[c(1,3,5,7,9)],longFormat=T) %>% simulateStopLimitPrices(0.06,0.06) %>% head

c3h3/QuantitativeBacktestingTools documentation built on May 13, 2019, 9:56 a.m.