Description Usage Arguments Examples
View source: R/user_communication.R
Select data to backtest.
1 2 3 4 | setUserData(this, l)
## S3 method for class 'modelStrategy'
setUserData(this, l)
|
this |
modelStrategy |
l |
list or xts, list can contain xts in each cell or should contain following fields: 1. dataset – name of dataset, now only "Russia" is available 2. period – periodicity of data. It is one of c('hour', 'day'). 3. assets – character vector of names of assets from dataset 4. time – numeric, if period == 'day', then time should be specified. Time here is hour. For example, if time == 19, then data will be at 19:00 every business day. This field works only in Russia dataset. Xts – table of timeserieses of instruments. if l is xts, then each column should be close price for instruments. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## Not run:
setUserData(this, list(
dataset = 'Russia',
period = 'day',
assets = c('GAZP', 'LKOH'),
time = 19
))
x <- xts(cumsum(rnorm(1000)) + 300, Sys.Date() + 1:1000)
setUserData(this, x)
x <- xts(cumsum(rnorm(1000)) + 300, Sys.Date() + 1:1000)
y <- xts(cumsum(rnorm(1000)) + 300, Sys.Date() + 1:1000)
setUserData(this, cbind(x, y))
x <- quantmod::getSymbols("AAPL", from = Sys.Date() - 365)
x <- quantmod::getSymbols("MSFT", from = Sys.Date() - 365)
setUserData(this, cbind(x, y))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.