{talib}: Interactive financial charts

Interested in publishing a one-time post on R-bloggers.com? Press here to learn how.

{talib} is a new R package built on TA-Lib, which is now available on CRAN. The R-package is targeted at individuals and, perhaps, institutions who, in some form or the other, interacts with the financial markets using technical analysis.

The library is built with minimal dependencies for long-term stability and freedom in mind. All functions are built around data.frame– and matrix-classes which are portable to all other data-containers with minimal effort.

Everything in the library is built ‘bottom-up’ for maximum speed and memory efficiency. Each indicator interacts directly with R’s C API via .Call().

In this blog post I will give a brief introduction to the charting interface which is built to mimick the behaviour of base R’s plotting API.

A quick introduction to charts

In this section I will briefly introduce the most important aspects of the charting, ‘quality of life’-features and themes. Below is a simple starting point; charting BTC:

talib::chart(
  talib::BTC
)

chart() returns a candlestick chart by default. Below are the formals:

str(formals(talib::chart))
#> Dotted pair list of 5
#>  $ x    : symbol 
#>  $ type : chr "candlestick"
#>  $ idx  : NULL
#>  $ title: symbol 
#>  $ ...  : symbol

Modifying themes

talib::set_theme("hawks_and_doves")

talib::chart(
  talib::BTC
)

Charting indicators

{
  talib::chart(talib::BTC)
  talib::indicator(talib::SMA, n = 7)
  talib::indicator(talib::SMA, n = 14)
  talib::indicator(talib::SMA, n = 21)
  talib::indicator(talib::SMA, n = 28)
  talib::indicator(talib::MACD)
  talib::indicator(talib::trading_volume)
}

Installation

{talib} is finally on CRAN, and can be installed as follows:

install.packages("talib")

It can also be built from source with additional CMake-flags:

install.packages(
  "talib",
  type = "source",
  configure.args = "-O3 -march=native"
)

Contributing and submitting bug-reports

{talib} is still in its early stage so contributions, even if small, bug-reports, suggestions and critiques are gratefully accepted.

Visit the repository here: https://github.com/serkor1/ta-lib-R.

Created on 2026-04-29 with reprex v2.1.1

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.