[R-SIG-Finance] SMA of RSI

John Klingensmith johnsk00 at gmail.com
Tue Feb 28 19:04:10 CET 2017


After thinking about what you gave me, I tried the following, which seems
to work:

add.indicator(strategy.st,name = "SMA",
              arguments = list(x = RSI(Cl(SPY),nRSI),n = nSMAofRSI),
              label = "smaofrsi")

Thanks for your help!

On Mon, Feb 27, 2017 at 2:52 PM, Joshua Ulrich <josh.m.ulrich at gmail.com>
wrote:

> On Mon, Feb 27, 2017 at 1:49 PM, John Klingensmith <johnsk00 at gmail.com>
> wrote:
> > Hi,
> >  How do take a simple moving average of an indicator, like a 5 period SMA
> > of a 3 period RSI?
> >
> Have you tried anything?
>
> What's wrong with something straight-forward and simple like:
>
> R> require(TTR)
> Loading required package: TTR
> R> data(ttrc)
> R> RSI.SMA <- SMA(RSI(ttrc$Close, 3), 5)
> R> tail(RSI.SMA)
> [1] 56.32127 42.49744 38.26578 37.85953 39.58722 43.33587
>
>
> > Best,
> >  John
> >
> >         [[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.
>
>
>
> --
> Joshua Ulrich  |  about.me/joshuaulrich
> FOSS Trading  |  www.fosstrading.com
> R/Finance 2017 | www.rinfinance.com
>

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list