[R-SIG-Finance] Quantstrat - trading not just Crossovers (e.g. Moving Average)
kent.russell at live.com
Fri Aug 26 17:17:22 CEST 2011
See if this helps
On Aug 26, 2011, at 7:39 AM, igor_vilcek_external at tatrabanka.sk wrote:
> Thanks, works fine for me in this case.
> I am just wondering, however, how to use this solution in case i want to
> set my own order sizing function (e.g. order size based on a % of current
> portfolio equity).
> In other words, how to trade my system (above Moving Average, not
> crossover) and use flexible order quantity as well.
> Igor Vilèek
> Joshua Ulrich <josh.m.ulrich at gmail.com>
> 25.08.2011 03:16
> "Brian G. Peterson" <brian at braverock.com>
> igor_vilcek_external at tatrabanka.sk, r-sig-finance at r-project.org
> Re: [R-SIG-Finance] Quantstrat - trading not just Crossovers (e.g. Moving
> On Mon, Aug 22, 2011 at 10:33 AM, Brian G. Peterson <brian at braverock.com>
>> On Mon, 2011-08-22 at 17:19 +0200, igor_vilcek_external at tatrabanka.sk
>>> I've encountered a problem in quanstrat framework, in case I want to
>>> not just signalCrossovers (or better said, the modified version of a
>>> Specifically i would like to e.g. go Long if Price>MovingAverage and
>>> if Price<MovingAverage.
>>> This means, that if we have on a <b>starting </b>day
>>> (not a crossover, just "above"), i want the system to buy immediately
> on a
>>> starting day. However, just once.
>>> If i tried sigComparison, this solved the problem with trading
>>> on a starting day, but started trading <b>anytime</b> a
>>> Price>MovingAverage (every day in a row).
>>> To sum up, I need to know how to modify sigCrossover to trade also in
>>> "ABOVE" (not just crossover, e.g. on a start day if condition is met)
>>> how to modify sigComparison to make only 1 Long order (not every day
>>> condition is met, only on 1st and then not until Exit is made).
>> use osMaxPos and set a maximum position instead of the default osNoOp
>> order sizing function.
>> Details in the documentation, or I can work up a quick example later in
>> the week.
> I just wrote a blog post with an example strategy that uses osMaxPos
> and addPosLimit to do this. Here's the link: http://goo.gl/yBKDr
>> - Brian
>> Brian G. Peterson
>> Ph: 773-459-4973
>> IM: bgpbraverock
> Joshua Ulrich | FOSS Trading: www.fosstrading.com
> Informacie obsiahnute v tomto dokumente su urcene vylucne pre
> potreby jeho adresata. Dokument moze obsahovat informacie chranene
> ako bankove alebo obchodne tajomstvo, pripadne informacie
> podliehajuce ochrane podla inych pravnych predpisov. Preto Vas v
> pripade, ak Vam bol mylne doruceny, vyzyvame, aby ste sa zdrzali
> jeho odtajnenia ci jeho pouzitia pre vlastne potreby. Zaroven si Vas
> dovolujeme poziadat, aby ste nas o takomto pripade bez zbytocneho
> odkladu informovali a dokument nasledne zlikvidovali.
> Information stated in this document is intended only for needs of proper
> addressees of this document. This document can contain information
> protected as a bank or business secret, or information protected by
> other legal regulations. Thus in case of receiving the document by error,
> we kindly ask you not to disclose, or use the document for your own
> needs. Likewise we kindly ask you to notify us immediately upon such
> a case by sending an email message to the sender's address, and
> subsequently delete the document.
> Tatra banka, a.s.
> Hodzovo namestie 3, 811 06 Bratislava 1
> ICO: 00 686 930
> Zapisana v obchodnom registri Okresneho sudu Bratislava I
> Oddiel: Sa, vlozka cislo: 71/B
> [[alternative HTML version deleted]]
> R-SIG-Finance at r-project.org mailing list
> -- 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