Wish list: Could OHLC use up/down colors?

Issue #3 closed
Dirk Eddelbuettel created an issue

Some packages do this well, dygraphs and quantmod are examples. This would be quite nice to have.

Comments (3)

  1. rtsvizteam repo owner

    Good idea. Code updated.

    The following example creates time series plot with OHLC style. Each bar is colored with up/down colors according to rtsplot.candle.col function. The rtsplot.candle.col function sets colors based on Open and Close prices. I.e. iif( Cl(y) > Op(y), theme$col.up, theme$col.dn)

    library(quantmod)
    
    symbol = 'AAPL'
    y = getSymbols(symbol, src = 'yahoo', auto.assign=F, from='2018-01-01')
    
    library(rtsplot)
    rtsplot(y, type = 'ohlc', col=rtsplot.candle.col(y))
        rtsplot.legend(symbol, 'black', y)
    
  2. Log in to comment