Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
f302f2e
:hammer: v0.9-2 --> v0.9-3
serkor1 May 10, 2026
9fc3f3e
:hammer: Support cached builds
serkor1 May 15, 2026
3abdfd2
:books: Updated README (#60)
serkor1 May 16, 2026
4e6ce9e
:bug:-fix: restore numeric vector outputs (#63)
nvphungdev May 17, 2026
62465f9
:books: Reworked benchmarks
serkor1 May 20, 2026
c072867
:books: Added references to benchmarks
serkor1 May 20, 2026
a2d960c
:hammer: Disable remote installs for R-devel
serkor1 Jun 6, 2026
98f6c78
:hammer: Lookback-functions (#71)
serkor1 Jun 21, 2026
3ccc69e
:hammer: Merged code generation for C-files + lookback-fix
serkor1 Jun 27, 2026
ca0df24
:hammer: Simplified logic in generating indicators
serkor1 Jun 27, 2026
c1d141e
:hammer: Regenerated C-code
serkor1 Jun 27, 2026
58b1766
:hammer: Corrected use of assignment operators
serkor1 Jun 27, 2026
61fa870
:bug:-fix: Added title-tag to lookback
serkor1 Jun 27, 2026
1df8d8d
:bug:-fix and safeguarding lookback-calls
serkor1 Jun 29, 2026
29e4c91
:hammer: TA-Lib: Bump src/ta-lib from `c042ea3` to `bffd837`
dependabot[bot] Jul 1, 2026
1f8d568
:hammer: TA-Lib: Bump src/ta-lib from `bffd837` to `2247d59`
dependabot[bot] Jul 4, 2026
aff4c9b
:fire: Initial Rust-based code generator
serkor1 Jul 9, 2026
43d217b
:bug:-fix: Parser were using old type macros
serkor1 Jul 10, 2026
1f003c1
:hammer: Lookback parsing + descriptive fn naming
serkor1 Jul 13, 2026
0fe13be
:hammer: Candlestick/Non-candlestick specific identifiers
serkor1 Jul 14, 2026
caec6ef
:wastebasket: Removed lookback functions
serkor1 Jul 14, 2026
cbcec3d
:hammer: X-Macros (#78)
serkor1 Jul 14, 2026
0548d18
:hammer: Added cargo commands and removed obsolete scripts
serkor1 Jul 14, 2026
2d39fae
:broom: Formatted .rs-files
serkor1 Jul 14, 2026
1aba213
:fire: Refactored R codegen
serkor1 Jul 26, 2026
c8c8a5f
:hammer: Added optional parameter documentation
serkor1 Jul 26, 2026
756efeb
:books: n --> timePeriod and eps --> penetration
serkor1 Jul 26, 2026
783832c
:hammer: Regenerated R-code with documentation
serkor1 Jul 26, 2026
ee581b9
:books: Updated README in response to (d7a2e979d8948fefd4b0d4338b572e…
serkor1 Jul 26, 2026
dc694a5
:hammer: Mine <Name> instead of <Type>
serkor1 Jul 26, 2026
d48861d
:bug:-fix: Bivariate indicators emitted one 'x'
serkor1 Jul 26, 2026
6dc76c7
:hammer: (Proper) function naming of residual indicators
serkor1 Jul 26, 2026
a9f5914
:hammer: Map maType to characters
serkor1 Jul 26, 2026
f899afa
:hammer: Added charting methods for MAVP
serkor1 Jul 26, 2026
14d2b04
:hammer: ma --> maType and n --> timePeriod
serkor1 Jul 26, 2026
a75bbaf
:books: Add periods column to template generation
serkor1 Jul 26, 2026
50bc1c7
:books: Documented maType (ma before)
serkor1 Jul 26, 2026
94da97b
:hammer: [INSERT_WHATEVER_AI_AGENT].md ignored
serkor1 Jul 26, 2026
edded8b
:hammer: Added charting methods for ta_MIDPRICE/ta_MIDPOINT
serkor1 Jul 26, 2026
84db85a
:wastebasket: Removed maType-tests
serkor1 Jul 26, 2026
5b2ee2c
:wastebasket: Remove TSF
serkor1 Jul 26, 2026
c7d0b8b
:books: Updated NAMESPACE
serkor1 Jul 26, 2026
d8156c8
🗑 Remove TSF (C)
serkor1 Jul 26, 2026
fabfa2e
:hammer: Small maType-helper in S3
serkor1 Jul 26, 2026
e18ce2d
:hammer: Added as.maType for maType args
serkor1 Jul 26, 2026
983878e
:books: Adapted vignettes to new interface
serkor1 Jul 26, 2026
17b7343
:wastebasket: Deleted AI-slop
serkor1 Jul 26, 2026
665d2fc
:books: Removed TSF, and added as.maType
serkor1 Jul 26, 2026
c118721
:fire: Custom examples tags
serkor1 Jul 26, 2026
236b916
:books: Added custom example flag
serkor1 Jul 26, 2026
82f3af6
:hammer: Unexport generic / Export dispatches
serkor1 Jul 26, 2026
f15ddc0
:hammer: data-helper for unit-tests
serkor1 Jul 26, 2026
b2d1808
:hammer: Pass NULL
serkor1 Jul 26, 2026
c472d98
:hammer: Enable (rolling) math operators
serkor1 Jul 27, 2026
84a3387
:hammer: Coerce family tags to 'Rolling Statistics'
serkor1 Jul 27, 2026
8fdd27c
:bug:-fix: Mispelled stuff fixed...
serkor1 Jul 27, 2026
557390b
:fire: Allow for passthrough arguments
serkor1 Jul 27, 2026
1a15a5d
:hammer: Reworked MAVP and downstream effects
serkor1 Jul 27, 2026
ef9b844
:hammer: Readded ROCR (Incorrectly excluded)
serkor1 Jul 28, 2026
9aa173f
:hammer: Lookback functions and tests
serkor1 Jul 28, 2026
2534941
:books: Initial NEWS update
serkor1 Jul 27, 2026
2475dd7
:books: Added bug-fixes and finished new features
serkor1 Jul 28, 2026
eba5504
:broom: Formatted code with air formatter
serkor1 Jul 29, 2026
95fc383
:hammer: Simplify Makefile
serkor1 Jul 29, 2026
95945ea
:books: Change input parameters from n --> TimePeriod
serkor1 Jul 29, 2026
d69c88d
:books: Logos and social previews
serkor1 Jul 29, 2026
da0df14
:hammer: Updated {pkgdown} CI/CD and .YAML
serkor1 Jul 29, 2026
dd4c369
:bug:-fix: overlapping last-values in merged indicators
serkor1 Jul 29, 2026
febb7bb
:hammer: Regenerated code in response to dd4c36960a08b98274a11f79181b…
serkor1 Jul 29, 2026
6c8c19a
:books: Added description of dd4c36960a08b98274a11f79181bf8a6a0cb74fe
serkor1 Jul 29, 2026
e74e02e
:books: Regenerated README with the fix in dd4c36960a08b98274a11f7918…
serkor1 Jul 29, 2026
1b1feb9
:hammer: Added camelCase aliases
serkor1 Jul 30, 2026
eb69b63
:hammer: TA-Lib: Bump src/ta-lib from `f51cba1` to `a8272d0`
dependabot[bot] Aug 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,7 @@ src/ta-lib/Makefile.in
^codegen$
^CRAN-SUBMISSION$
^tests/testthat/test-parity.R

## Claude.md
^src/ta-lib/CLAUDE.md
^src/ta-lib/.claude
7 changes: 6 additions & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,18 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown any::devtools any::roxygen2
extra-packages: any::pkgdown any::devtools any::roxygen2 any::rsvg any::magick
needs: website

- name: Render documentation and NAMESPACE
run: devtools::document()
shell: Rscript {0}

# realfavicongenerator.net rejects SVG logos (HTTP 500), so build
# the favicons locally; pkgdown skips the API when they exist
- name: Build favicons
run: Rscript dev/favicons.R

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = TRUE, clean = TRUE)
shell: Rscript {0}
Expand Down
115 changes: 110 additions & 5 deletions .github/workflows/remote-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
paths:
- 'configure'
- 'configure.win'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand All @@ -21,7 +22,9 @@ concurrency:
permissions: read-all

jobs:
R-CMD-check:
## Vanilla remote install - verifies pak::pak("serkor1/ta-lib-R")
## works on a clean runner with no compiler-wrapping in ~/.R/Makevars.
Remote-Install:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})
Expand All @@ -31,19 +34,19 @@ jobs:
matrix:
config:
## macOS
- {os: macos-latest, r: 'devel', http-user-agent: 'release'}
- {os: macos-latest, r: 'release'}
- {os: macos-latest, r: 'oldrel-1'}
- {os: macos-latest, r: 'oldrel-2'}

## windows
- {os: windows-latest, r: 'devel', http-user-agent: 'release'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'oldrel-1'}

- {os: windows-latest, r: 'oldrel-2'}

# Ubuntu
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -72,3 +75,105 @@ jobs:
- name: Calculate an indicator
run: talib::bollinger_bands(talib::BTC)
shell: Rscript {0}

## Remote install with ccache configured in ~/.R/Makevars - regression
## guard for https://github.com/serkor1/ta-lib-R/issues/57, where installs
## with `CC = ccache gcc` in Makevars hit
## "/usr/bin/ccache: invalid option -- 'D'" because the configure script
## passed `CMAKE_C_COMPILER=ccache` and CMake then invoked ccache with
## raw `-D` definitions.
Remote-Install-ccache:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }}, ccache)

strategy:
fail-fast: false
matrix:
config:
## macOS
- {os: macos-latest, r: 'release'}
- {os: macos-latest, r: 'oldrel-1'}
- {os: macos-latest, r: 'oldrel-2'}

## windows
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'oldrel-1'}
- {os: windows-latest, r: 'oldrel-2'}

# Ubuntu
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- name: Install ccache (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y ccache
shell: bash

- name: Install ccache (macOS)
if: runner.os == 'macOS'
run: brew install ccache
shell: bash

- name: Install ccache (Windows)
if: runner.os == 'Windows'
run: choco install ccache -y --no-progress
shell: pwsh

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pak any::plotly any::devtools any::roxygen2
needs: check

- name: Configure ~/.R/Makevars to use ccache
run: |
dir <- path.expand(file.path("~", ".R"))
dir.create(dir, recursive = TRUE, showWarnings = FALSE)
name <- if (.Platform$OS.type == "windows") "Makevars.win" else "Makevars"
if (Sys.info()[["sysname"]] == "Darwin") {
cc <- "clang"; cxx <- "clang++"
} else {
cc <- "gcc"; cxx <- "g++"
}
path <- file.path(dir, name)
writeLines(
c(paste0("CC=ccache ", cc),
paste0("CXX=ccache ", cxx)),
path
)
cat("--- ", path, " ---\n", sep = "")
cat(readLines(path), sep = "\n"); cat("\n")
shell: Rscript {0}

- name: Reset ccache statistics
run: ccache --zero-stats
shell: bash

- name: Install {talib}
run: pak::pak("serkor1/ta-lib-R")
shell: Rscript {0}

- name: Show ccache statistics
if: always()
run: ccache -s
shell: bash

- name: Calculate an indicator
run: talib::bollinger_bands(talib::BTC)
shell: Rscript {0}
20 changes: 9 additions & 11 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ R package (`talib`) providing an interface to the TA-Lib C library for technical
## Build Commands

```bash
make build # Full build: gen-code → document → install
make build # Full build: cleanfmt → document → install (does NOT run gen-code)
make check # R CMD check --as-cran
make check-full # R CMD check with valgrind
make test # Run testthat suite
Expand All @@ -25,21 +25,19 @@ Single test file: `Rscript -e "testthat::test_file('tests/testthat/test-ta_APO.R

### Code Generation (Most Source Files Are Generated)

Most R wrappers (`R/ta_*.R`), C wrappers (`src/ta_*.c`), and tests (`tests/testthat/test-ta_*.R`) are **auto-generated**. Do not edit these directly — modify the generation infrastructure in `codegen/` instead:
Most R wrappers (`R/ta_*.R`), the C X-macro header (`src/TA-Lib.h`), and tests (`tests/testthat/test-ta_*.R`) are **auto-generated** by the zero-dependency Rust crate in `codegen/` — see `codegen/README.md` for the full architecture. Do not edit generated files directly — modify the generation infrastructure instead:

- `codegen/gen_code/indicators.R` — Unified metadata for all 128 indicators
- `codegen/gen_code/generate.R` — Single driver script that generates R, C, and test files
- `codegen/gen_code/utils.R` — `impl_generate_indicator()` and `impl_generate_test()` helpers
- `codegen/generate_indicator.sh`, `generate_API.sh`, `generate_FFI.sh` — Shell scripts for template-driven generation
- `src/api.h` and `src/init.c` — Auto-generated (function prototypes and R registration)
- `codegen/src/` — `main.rs` (driver), `c_header.rs` (C X-macro lines from ta_func.h), `metadata.rs` (XML mining), `render.rs` (template rendering + splice preservation), `testthat.rs` (test files), `tables.rs` (the hand-maintained per-indicator lookup tables: names, chart types, classifications, exclusions)
- `codegen/templates/` — plain R files with `${...}` placeholders; the `chart_*` templates are dual-backend (one file renders both the `.plotly` and `.ggplot` method)
- Hand-edited content between `## splice:<name>:start` / `## splice:<name>:end` markers in generated files survives regeneration

Run `make gen-code` after changing any generation logic.
Run `make gen-code` after changing any generation logic (`cargo test` inside `codegen/` tests the generator itself).

### R ↔ C Binding

Uses `.Call()` (R's native C interface), not Rcpp. Each indicator has:

1. **C wrapper** (`src/ta_*.c`): Converts R SEXP → C arrays, calls TA-Lib, returns SEXP matrix
1. **C wrapper**: one X-macro line in the generated `src/TA-Lib.h`, expanded by the hand-written `src/wrapper.h`/`src/init.c` macros into a function that converts R SEXP → C arrays, calls TA-Lib, and returns a SEXP matrix (there are no per-indicator `.c` files)
2. **R wrapper** (`R/ta_*.R`): S3 generic with methods for `default`, `data.frame`, and `plotly`

C memory management uses manual `PROTECT`/`UNPROTECT` with protection counters.
Expand Down Expand Up @@ -87,8 +85,8 @@ isolated without depending on those packages. `chart()` and its
- `R/helper.R` — Operators (`%nn%`, `%or%`), chart helpers (`plotly_init`, `plotly_line`, `ggplot_init`, `ggplot_line`, `modify_traces`, `add_idx`, `rebuild_formula`)
- `R/BTC.R`, `R/NVDA.R`, `R/SPY.R`, `R/ATOM.R` — Built-in OHLCV datasets (docs only; `.rda` files in `data/`)
- `R/talib-package.R` — `generate_returns_section()` used at roxygen-render time by `man-roxygen/returns.R`
- `src/dataframe.c` — Matrix↔data.frame conversion (`map_dfr`)
- `src/container.h`, `src/shift.h`, `src/names.h` — Shared C utilities
- `src/data-frame.c` — Matrix↔data.frame conversion (`map_dfr`)
- `src/shift.h`, `src/names.h` — Shared C utilities

### TA-Lib Submodule

Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: talib
Title: Interface to 'TA-Lib' for Technical Analysis and Candlestick Patterns
Version: 0.9-2
Version: 0.9-3
Authors@R: c(
person(
given = "Serkan",
Expand Down
Loading
Loading