SMA of RSI

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SMA of RSI

John Klingensmith
Hi,
 How do take a simple moving average of an indicator, like a 5 period SMA
of a 3 period RSI?

Best,
 John

        [[alternative HTML version deleted]]

_______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|

Re: SMA of RSI

Joshua Ulrich
On Mon, Feb 27, 2017 at 1:49 PM, John Klingensmith <[hidden email]> 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]]
>
> _______________________________________________
> [hidden email] 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

_______________________________________________
[hidden email] 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 | Threaded
Open this post in threaded view
|

Re: SMA of RSI

John Klingensmith
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 <[hidden email]>
wrote:

> On Mon, Feb 27, 2017 at 1:49 PM, John Klingensmith <[hidden email]>
> 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]]
> >
> > _______________________________________________
> > [hidden email] 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]]

_______________________________________________
[hidden email] 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.