quantstrat maCross demo problem
On 07/10/2012 09:15 PM, hifin wrote:
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:
<snip>
However, when I change the startdate from 1999-12-31 to 2005-12-31, it returns
<snip>
It starts with a SHORT position while the demo code should be LONG ONLY. Can anybody tell me what the problem is? Thanks!
I don't know what the root cause it yet, but I was able to replicate it. As a short workaround, using orderqty='all' for the exit order solves the problem, as does using osMaxPos. I'll dig deeper on the root cause of why the exit order fires there when I have a bit more time. Regards, Brian
Brian G. Peterson http://braverock.com/brian/ Ph: 773-459-4973 IM: bgpbraverock