simulateStopLimitPrices: simulateStopLimitPrices

Description Usage Arguments Examples

Description

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

Usage

1
2
simulateStopLimitPrices(longFswXtDf, limitRatio, stopRatio,
  NonHitIdxValue = 1e+06)

Arguments

longFswXtDf

a forward sampling xts with long format

limitRatio

limit return ratio

stopRatio

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.