[R-SIG-Finance] quantstrat - problems with ordersize function

Jeff Ryan jeff.a.ryan at gmail.com
Thu Apr 5 05:34:53 CEST 2012


<shameless plug>

If you like the list, you should consider coming to the R/Finance conference here in Chicago May 11 and 12. This is our fourth year, and is looking to be the biggest yet - upwards of 250 of fellow list subscribers and others in R and finance. 

http://www.RinFinance.com

</shameless plug>

Jeffrey Ryan    |    Founder    |    jeffrey.ryan at lemnica.com

www.lemnica.com

On Apr 4, 2012, at 5:49 PM, FJ M <chicagobrownblue at hotmail.com> wrote:

> 
> This mailing list is great. I just subscribed to find out more about the finance/trading part of R. Knowing that the pair trade demo broke let's me know about the pair trading functionality. I haven't used it but will put it on my to do list. A friend of mine is trading ETF pairs, so I will let him know about. 
> 
> 
>> Date: Wed, 4 Apr 2012 10:28:44 -0500
>> From: gsee000 at gmail.com
>> To: andreas.mikkelsen at stud.hibo.no
>> CC: r-sig-finance at r-project.org
>> Subject: Re: [R-SIG-Finance] quantstrat - problems with ordersize function
>> 
>> The pair_trade demo broke in revision 982. We're aware of it and (and
>> working on it?).
>> 
>> Until it's fixed, you can checkout an older revision (981 or earlier)
>> and the pair_trade demo will hopefully work as advertised..
>> 
>> Best,
>> Garrett
>> 
>> On Wed, Apr 4, 2012 at 10:16 AM, Andreas Mikkelsen
>> <andreas.mikkelsen at stud.hibo.no> wrote:
>>> Hi everyone,
>>> 
>>> I am currently writing my master thesis in finance . The scope of the thesis
>>> is to backtest on historical data whether the pairs trading strategy is
>>> profitable or not.
>>> 
>>> I have a couple of questions regarding the pairs trading demo script in the
>>> quantstrat package.  I managed to run it without any mishap, but as far as I
>>> can see, there are at no time a long / short leg in the transactions.  I.e.
>>> [1] "2009-03-03 SPY 1e+06 @ 67.1509470105226"
>>> [1] "2009-03-09 SPY 1e+06 @ 65.2725988423961"
>>> [1] "2009-03-03 DIA 1e+06 @ 63.717805901226"
>>> [1] "2009-03-09 DIA 1e+06 @ 62.0397741136174"
>>> 
>>>> From what I can understand it goes long at the same time on both stocks?
>>> Which would not equal a pairs trading strategy. In the summary page of
>>> blotter I could not find a single date with entries on both the long and
>>> short.  Has any one else experienced this?
>>> 
>>> Further on I have tried to adjust the script from the package to our needs
>>> with a fellow student and our prof. What we can�t seem to figure out is how
>>> to adjust the orderqty with osFUN.
>>> What we are trying to do is to make every order a fixed amount with equal
>>> dollar amount on either leg whenever the trade signal is activated.
>>> Attached is our efforts so far.
>>> http://r.789695.n4.nabble.com/file/n4532216/Quantstrat_PairTrade11.R
>>> Quantstrat_PairTrade11.R
>>> Best regards,
>>> Andreas Mikkelsen
>>> 
>>> 
>>> --
>>> View this message in context: http://r.789695.n4.nabble.com/quantstrat-problems-with-ordersize-function-tp4532216p4532216.html
>>> Sent from the Rmetrics mailing list archive at Nabble.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.
> 
>   [[alternative HTML version deleted]]
> 
> _______________________________________________
> 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