Indicator as histogram or rectangle boxes instead of line

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

Indicator as histogram or rectangle boxes instead of line

Mike-3
I use chart_Series for plotting. add_TA adds an indicator with line
chart.

Can I use add_TA also for plotting an indicator as histogram or
rectangle boxes like add_Vo?

I tried add_TA's parameter taType with 'h' or 'b' without success.

Mike

_______________________________________________
[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: Indicator as histogram or rectangle boxes instead of line

braverock
plot.xts was based on chart_Series, so adding panels with plot.xts
should work.

Also, you can absolutely use 'h' plots with add_TA.  See e.g.
chart.Posn in the blotter package:

https://github.com/braverock/blotter/blob/master/R/chart.Posn.R

Regards,

Brian

On Mon, 2021-04-05 at 14:28 +0200, Mike wrote:

> I use chart_Series for plotting. add_TA adds an indicator with line
> chart.
>
> Can I use add_TA also for plotting an indicator as histogram or
> rectangle boxes like add_Vo?
>
> I tried add_TA's parameter taType with 'h' or 'b' without success.
>
> Mike
>
> _______________________________________________
> [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.

        [[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: Indicator as histogram or rectangle boxes instead of line

Joshua Ulrich
And here's a simple example

getSymbols("SPY")
chart_Series(SPY, subset = "2021")
add_TA(Vo(SPY), type = "h")

You can get better help if you create a minimal reproducible example
of your problem.

On Mon, Apr 5, 2021 at 10:56 AM Brian G. Peterson <[hidden email]> wrote:

>
> plot.xts was based on chart_Series, so adding panels with plot.xts
> should work.
>
> Also, you can absolutely use 'h' plots with add_TA.  See e.g.
> chart.Posn in the blotter package:
>
> https://github.com/braverock/blotter/blob/master/R/chart.Posn.R
>
> Regards,
>
> Brian
>
> On Mon, 2021-04-05 at 14:28 +0200, Mike wrote:
> > I use chart_Series for plotting. add_TA adds an indicator with line
> > chart.
> >
> > Can I use add_TA also for plotting an indicator as histogram or
> > rectangle boxes like add_Vo?
> >
> > I tried add_TA's parameter taType with 'h' or 'b' without success.
> >
> > Mike
> >
> > _______________________________________________
> > [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.
>
>         [[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

_______________________________________________
[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: Indicator as histogram or rectangle boxes instead of line

Mike-3
On 05.04.21 Joshua Ulrich wrote:

> getSymbols("SPY")
> chart_Series(SPY, subset = "2021")
> add_TA(Vo(SPY), type = "h")

It seems that additional params to add_TA are passed to plot. So I
can refer to the plot manual. I wasn't aware of that.

> You can get better help if you create a minimal reproducible example
> of your problem.

Generally I'm aware of that. But I was looking for a feature, not
hunting a bug. So I didn't know how I could provide a minimal
reproducible here. But now I have:

getSymbols("SPY")
chart_Series(SPY, subset = "2021")
add_TA(ATR(SPY,10)[,"atr"], type="h") # That's what I was looking for
add_TA(ATR(SPY,10)[,"atr"]) # instead of that

> On Mon, Apr 5, 2021 at 10:56 AM Brian G. Peterson <[hidden email]> wrote:
> >
> > plot.xts was based on chart_Series, so adding panels with plot.xts
> > should work.
> >
> > Also, you can absolutely use 'h' plots with add_TA.  See e.g.
> > chart.Posn in the blotter package:
> >
> > https://github.com/braverock/blotter/blob/master/R/chart.Posn.R

I will have a look at this.

Mike

_______________________________________________
[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.