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

Joshua Ulrich josh.m.ulrich at gmail.com
Fri May 9 13:26:49 CEST 2014


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.
>
>



More information about the R-SIG-Finance mailing list