<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span></span></div><div><br></div><div><br></div><div>I am unclear. There are 3 different results, which of these is correct ?</div><div><br></div><div><br></div><div>(a) Humme, Peterson pp.34/78  <a href="http://www.rinfinance.com/agenda/2013/workshop/Humme+Peterson.pdf" target="_blank" rel="nofollow"><font color="#2862c5">http://www.rinfinance.com/agenda/2013/workshop/Humme+Peterson.pdf</font></a></div><div><font color="#2862c5"><br></font></div><div><font color="#2862c5"><br></font></div><div><br></div><div>(b) Guy Yollin pp.24/78 </div><div><a
 href="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" target="_blank" rel="nofollow"><font color="#2862c5">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</font></a></div><div><font color="#2862c5"><br></font></div><font color="#2862c5"><div><br></div><div><br></div></font><div>(c) The latest
 run of the demo, blotter(rev 1607), quantstrat(rev 1610) - chart.Posn attached.</div><div><br></div><div><br></div><div><br></div><div>Amarjit</div><div><br></div><div><br></div><div><br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <div class="hr" style="margin: 5px 0px; padding: 0px; border: 1px solid rgb(204, 204, 204); border-image: none; height: 0px; line-height: 0; font-size: 0px;" contenteditable="false" readonly="true"></div>  <font face="Arial" size="2"> <b><span style="font-weight: bold;">From:</span></b> Joshua Ulrich <josh.m.ulrich@gmail.com><br> <b><span style="font-weight: bold;">To:</span></b> Pablo Rios <pablo.javier.rios@gmail.com> <br><b><span style="font-weight: bold;">Cc:</span></b> r-sig-finance <r-sig-finance@r-project.org> <br> <b><span style="font-weight:
 bold;">Sent:</span></b> Friday, 9 May 2014, 12:26<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [R-SIG-Finance] Luxor strategy (quantstrat) - Why are successive short (and long) trades happening ?<br> </font> </div> <div class="y_msg_container"><br>On Thu, May 8, 2014 at 11:09 PM, Pablo Rios <<a href="mailto:pablo.javier.rios@gmail.com" ymailto="mailto:pablo.javier.rios@gmail.com">pablo.javier.rios@gmail.com</a>> wrote:<br>> Thanks for your quick response Joshua.<br>><br>> Does the code changes in r1609 intend to fix the successive short (or long)<br>> trades that I'm describing in my email, or only the Warning: stack imbalance<br>> in 'lapply' message ? Although this warning message is no longer reported,<br>> and the results of the Luxor strategy changed after r1609 (ex.:<br>> Net.Trading.PL value changed, among other variables), I'm still observing<br>> the same behaviour of successive short (or long)
 trades running the Luxor<br>> demo code with the GBP/USD demo data available in quantstrat.<br>><br>r1609 only intended to fix the stack imbalance warning (as it says in<br>the commit log).<br><br>> Moreover, if I run luxor.1.strategy.basic.R demo code with a longer GBP/USD<br>> time series, using 30 minutes bars as in the demo data (ex.: three years), I<br>> observed up to 5 successive short trades (i.e., Pos.Qty value of<br>> GBPUSD$posPL xts object equal to -500,000) and 4 successive long trades.<br>><br>> Further, looking at the firstCross.c in r1609 I'm seeing in the<br>> switch(int_rel) statement that all comparisons are done by greater than<br>> ('>'). I don't know whether this is correct or not.<br>><br>That was a careless error on my part.  r1610 corrects the comparisons.<br> Thank you very much for catching this.<br><br>> Thanks for your support, I'm eager to finally adopt quantstrat
 !<br>><br>> Pablo<br>><br>><br>> On Thu, May 8, 2014 at 8:09 AM, Joshua Ulrich <<a href="mailto:josh.m.ulrich@gmail.com" ymailto="mailto:josh.m.ulrich@gmail.com">josh.m.ulrich@gmail.com</a>><br>> wrote:<br>>><br>>> On Wed, May 7, 2014 at 7:05 PM, fc_11 <<a href="mailto:jyorio@gmail.com" ymailto="mailto:jyorio@gmail.com">jyorio@gmail.com</a>> wrote:<br>>> > i also am getting the "Warning: stack imbalance in 'lapply'," warning<br>>> > since<br>>> > the 1608 upgrade<br>>> ><br>>> Fixed in r1609.<br>>> --<br>>> Joshua Ulrich  |  about.me/joshuaulrich<br>>> FOSS Trading  |  www.fosstrading.com<br>>><br>>> _______________________________________________<br>>> <a href="mailto:R-SIG-Finance@r-project.org" ymailto="mailto:R-SIG-Finance@r-project.org">R-SIG-Finance@r-project.org</a> mailing list<br>>> <a
 href="https://stat.ethz.ch/mailman/listinfo/r-sig-finance" target="_blank">https://stat.ethz.ch/mailman/listinfo/r-sig-finance</a><br>>> -- Subscriber-posting only. If you want to post, subscribe first.<br>>> -- Also note that this is not the r-help list where general R questions<br>>> should go.<br>><br>><br><br>_______________________________________________<br><a href="mailto:R-SIG-Finance@r-project.org" ymailto="mailto:R-SIG-Finance@r-project.org">R-SIG-Finance@r-project.org</a> mailing list<br><a href="https://stat.ethz.ch/mailman/listinfo/r-sig-finance" target="_blank">https://stat.ethz.ch/mailman/listinfo/r-sig-finance</a><br>-- Subscriber-posting only. If you want to post, subscribe first.<br>-- Also note that this is not the r-help list where general R questions should go.<br><br><br></div> </div> </div>  </div></body></html>