[R-SIG-Finance] Luxor strategy (quantstrat) - Why are successive short (and long) trades happening ?

amarjit chandhial a.chandhial at btinternet.com
Sat May 10 20:17:41 CEST 2014




I am unclear. There are 3 different results, which of these is correct ?


(a) Humme, Peterson pp.34/78  http://www.rinfinance.com/agenda/2013/workshop/Humme+Peterson.pdf



(b) Guy Yollin pp.24/78 
https://4310b1a9-a-a8fb2076-s-sites.googlegroups.com/a/r-programming.org/home/files/quantstrat-IV.pdf?attachauth=ANoY7cojS8K93NCMEI2gr1eWPE6nFGkEZAncLma__qYUXHgRzbbQCi1zrOZa5DnAANVw6nGZU9ppV1s69und3U7_uErEyb18pGOyH0UJsXtCsndrvcZWR4fB4mIJePELsQcuf3ksoDg3w7JV0TH_kpR3NDGBiDYzX9f43piDIk6vhfK5JMK68K1K7yqCZcHZ0krZzhRJ9Wq3KIZt5-399IqQ-Eeytar1o2n-VpqgoBIefXlC5iT6rlM%3D&attredirects=0



(c) The latest run of the demo, blotter(rev 1607), quantstrat(rev 1610) - chart.Posn attached.



Amarjit


 

________________________________
 From: Joshua Ulrich <josh.m.ulrich at gmail.com>
To: Pablo Rios <pablo.javier.rios at gmail.com> 
Cc: r-sig-finance <r-sig-finance at r-project.org> 
Sent: Friday, 9 May 2014, 12:26
Subject: Re: [R-SIG-Finance] Luxor strategy (quantstrat) - Why are successive short (and long) trades happening ?
  

On Thu, May 8, 2014 at 11:09 PM, Pablo Rios <pablo.javier.rios at gmail.com> wrote:
> Thanks for your quick response Joshua.
>
> Does the code changes in r1609 intend to fix the successive short (or long)
> trades that I'm describing in my email, or only the Warning: stack imbalance
> in 'lapply' message ? Although this warning message is no longer reported,
> and the results of the Luxor strategy changed after r1609 (ex.:
> Net.Trading.PL value changed, among other variables), I'm still observing
> the same behaviour of successive short (or long) trades running the Luxor
> demo code with the GBP/USD demo data available in quantstrat.
>
r1609 only intended to fix the stack imbalance warning (as it says in
the commit log).

> Moreover, if I run luxor.1.strategy.basic.R demo code with a longer GBP/USD
> time series, using 30 minutes bars as in the demo data (ex.: three years), I
> observed up to 5 successive short trades (i.e., Pos.Qty value of
> GBPUSD$posPL xts object equal to -500,000) and 4 successive long trades.
>
> Further, looking at the firstCross.c in r1609 I'm seeing in the
> switch(int_rel) statement that all comparisons are done by greater than
> ('>'). I don't know whether this is correct or not.
>
That was a careless error on my part.  r1610 corrects the comparisons.
Thank you very much for catching this.

> Thanks for your support, I'm eager to finally adopt quantstrat !
>
> Pablo
>
>
> On Thu, May 8, 2014 at 8:09 AM, Joshua Ulrich <josh.m.ulrich at gmail.com>
> wrote:
>>
>> On Wed, May 7, 2014 at 7:05 PM, fc_11 <jyorio at gmail.com> wrote:
>> > i also am getting the "Warning: stack imbalance in 'lapply'," warning
>> > since
>> > the 1608 upgrade
>> >
>> Fixed in r1609.
>> --
>> Joshua Ulrich  |  about.me/joshuaulrich
>> FOSS Trading  |  www.fosstrading.com
>>
>> _______________________________________________
>> R-SIG-Finance at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only. If you want to post, subscribe first.
>> -- Also note that this is not the r-help list where general R questions
>> should go.
>
>

_______________________________________________
R-SIG-Finance at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20140510/7f1dd3c4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: latest.jpg
Type: image/jpeg
Size: 189364 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20140510/7f1dd3c4/attachment.jpg>


More information about the R-SIG-Finance mailing list