Hi,
I spend the last couple of days trying out the functionality of the
TradeAnalytics packages. There are some observations that I would like
to share. I use RStudio as GUI and derived the attached code from a
demo example.
1) since the trading system operates with moving averages, I download
data prior the start of applying the strategy to have all moving
averages calculated at the start time. But although the Portfolio,
Account and Orders get initialized at the beginning of 2002, the
execution of the strategy seems to start from the beginning of 2001
2) the getSymbols command returns a warning I don't understand:
Warning message:
In if (as.character(sc[[1]]) != calling.fun) return() :
?the condition has length > 1 and only the first element will be used:
This is my sessionInfo:
sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: i686-pc-linux-gnu (32-bit)
locale:
?[1] LC_CTYPE=en_US.UTF-8 ? ? ? LC_NUMERIC=C
LC_TIME=de_DE.UTF-8 ? ? ? ?LC_COLLATE=en_US.UTF-8
?[5] LC_MONETARY=C ? ? ? ? ? ? ?LC_MESSAGES=en_US.UTF-8
LC_PAPER=de_DE.UTF-8 ? ? ? LC_NAME=C
?[9] LC_ADDRESS=C ? ? ? ? ? ? ? LC_TELEPHONE=C
LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats ? ? graphics ?grDevices utils ? ? datasets ?methods ? base
other attached packages:
[1] PerformanceAnalytics_1.0.3.2 quantstrat_0.5.6
blotter_0.8.4 ? ? ? ? ? ? ? ?FinancialInstrument_0.7.5
[5] quantmod_0.3-17 ? ? ? ? ? ? ?Defaults_1.1-1
TTR_0.21-0 ? ? ? ? ? ? ? ? ? xts_0.8-2
[9] zoo_1.7-5
loaded via a namespace (and not attached):
[1] grid_2.13.1 ? ? lattice_0.19-30 tools_2.13.1
Regards,
Andreas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: STRAT_MACROSS.R
Type: text/x-r-source
Size: 3358 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20111028/d2c3dd3c/attachment.bin>