Pablo,

The luxor.1.strategy.basic.R strategy doesn't cancel old unfulfilled
stoplimit orders, and hence there are positions

book  = getOrderBook(portfolio=portfolio.st)
book$forex$GBPUSD['2002-10-22/2002-10-24']

> book$forex$GBPUSD['2002-10-22/2002-10-24']
                    Order.Qty Order.Price Order.Type  Order.Side
Order.Threshold Order.Status Order.StatusTime      Prefer Order.Set
Txn.Fees Rule         Time.In.Force
2002-10-22 17:00:00 "all"     "1.5453"    "market"    "long"     NA
     "closed"     "2002-10-22 17:30:00" ""     NA        "-6"
"Exit2SHORT" ""
2002-10-22 17:00:00 "-1e+05"  "1.5447"    "stoplimit" "short"    "-5e-04"
     "closed"     "2002-10-22 17:30:00" "Low"  NA        "0"
 "EnterSHORT" ""
2002-10-23 02:30:00 "all"     "1.5485"    "market"    "short"    NA
     "closed"     "2002-10-23 03:00:00" ""     NA        "-6"
"Exit2LONG"  ""
2002-10-23 02:30:00 "1e+05"   "1.5492"    "stoplimit" "long"     "5e-04"
      "closed"     "2002-10-23 03:00:00" "High" NA        "0"
 "EnterLONG"  ""
2002-10-23 17:00:00 "all"     "1.5468"    "market"    "long"     NA
     "closed"     "2002-10-23 17:30:00" ""     NA        "-6"
"Exit2SHORT" ""
2002-10-23 17:00:00 "-1e+05"  "1.5463"    "stoplimit" "short"    "-5e-04"
     "closed"     "2002-10-24 02:00:00" "Low"  NA        "0"
 "EnterSHORT" ""
2002-10-23 22:00:00 "1e+05"   "1.5491"    "stoplimit" "long"     "5e-04"
      "replaced"   "2002-10-24 11:00:00" "High" NA        "0"
 "EnterLONG"  ""
2002-10-24 01:30:00 "-1e+05"  "1.5459"    "stoplimit" "short"    "-5e-04"
     "closed"     "2002-10-24 03:00:00" "Low"  NA        "0"
 "EnterSHORT" ""
2002-10-24 11:00:00 "all"     "1.5476"    "market"    "short"    NA
     "closed"     "2002-10-24 11:30:00" ""     NA        "-6"
"Exit2LONG"  ""
2002-10-24 11:00:00 "1e+05"   "1.5493"    "stoplimit" "long"     "5e-04"
      "closed"     "2002-10-24 12:00:00" "High" NA        "0"
 "EnterLONG"  ""


>From above orderbook you can see that at the short position taken
on 2002-10-24 02:00:00 is actually from the stoplimit order from 2002-10-23
17:00:00. and the short position taken on 2002-10-24 03:00:00 is actually
from the stoplimit order from 2002-10-24 01:30:00





On Fri, May 9, 2014 at 12:32 PM, Pablo Rios <pablo.javier.r...@gmail.com>wrote:

> Just an additional comment:
> I had seen up to 4-5 successive short/long trades running
> luxor.1.strategy.basic.R demo code, with a longer GBP/USD time series, with
> lower code revisions (ex.: r15nn); r1609 is not the first time in which
> this behaviour happened.
> Thanks
> Pablo
>
>
> On Fri, May 9, 2014 at 1:09 AM, Pablo Rios <pablo.javier.r...@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.
> >
> > 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.
> >
> > 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.ulr...@gmail.com
> >wrote:
> >
> >> On Wed, May 7, 2014 at 7:05 PM, fc_11 <jyo...@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@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.
> >>
> >
> >
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance@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.
>

        [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Finance@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.

Reply via email to