[R-SIG-Finance] quantstrat maCross demo problem

Brian G. Peterson brian at braverock.com
Thu Jul 12 22:56:42 CEST 2012

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:
> However, when I change the startdate from 1999-12-31 to 2005-12-31, it
> returns
> 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.



Brian G. Peterson
Ph: 773-459-4973
IM: bgpbraverock

More information about the R-SIG-Finance mailing list