[R-SIG-Finance] quantstrat maCross demo problem

hifin hifin at live.com
Wed Jul 11 04:15:28 CEST 2012


I'm using R 2.15.1 and latest version of all packages. When I ran the maCross
demo, (AAPL from 1999-12-31 and LONG only), I got the following results:

[1] "2001-06-27 00:00:00 AAPL 100 @ 11.67"
[1] "2001-09-07 00:00:00 AAPL -100 @ 8.64"
[1] "2002-01-07 00:00:00 AAPL 100 @ 11.45"
[1] "2002-07-10 00:00:00 AAPL -100 @ 8.66"
[1] "2003-05-16 00:00:00 AAPL 100 @ 9.4"
[1] "2006-06-22 00:00:00 AAPL -100 @ 59.58"
[1] "2006-09-26 00:00:00 AAPL 100 @ 77.61"
[1] "2008-03-07 00:00:00 AAPL -100 @ 122.25"
[1] "2008-05-19 00:00:00 AAPL 100 @ 183.6"
[1] "2008-09-24 00:00:00 AAPL -100 @ 128.71"
[1] "2009-05-14 00:00:00 AAPL 100 @ 122.95"

However, when I change the startdate from 1999-12-31 to 2005-12-31, it
returns

[1] "2008-03-07 00:00:00 AAPL -100 @ 122.25"
[1] "2008-05-19 00:00:00 AAPL 100 @ 183.6"
[1] "2008-09-24 00:00:00 AAPL -100 @ 128.71"
[1] "2009-05-14 00:00:00 AAPL 100 @ 122.95"

It starts with a SHORT position while the demo code should be LONG ONLY. 
Can anybody tell me what the problem is? Thanks!



--
View this message in context: http://r.789695.n4.nabble.com/quantstrat-maCross-demo-problem-tp4636089.html
Sent from the Rmetrics mailing list archive at Nabble.com.



More information about the R-SIG-Finance mailing list