From 3165b78b7a0bead9fb6ace45521c789e37ce9451 Mon Sep 17 00:00:00 2001 From: serkor1 <77464572+serkor1@users.noreply.github.com> Date: Mon, 27 Jul 2026 09:37:19 +0200 Subject: [PATCH 1/2] :books: Initial NEWS update * This is a work in progress. --- NEWS.md | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/NEWS.md b/NEWS.md index f5cca55cb..74b23769f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # version 0.9-3 +This version brings *many* changes to the R package. +The entire code generating backend have been rewritten so it *closely* follows the upstream naming of parameters and it uses X-macros so it also installs way fastert than before - but it also means that there is alot of breaking changes. +The update is a big leap towards a stable release. + ## improvements * A new function for pre-calculating the lookback-period has been implemented. It can be used as follows: @@ -15,8 +19,120 @@ talib::lookback( The function returns the minimum required lookback for calculating the indicator. Its use-case is customized control-flows for downstream wrappers and/or packages that declares dependency on {talib}. +* The underlying source code have been completely rewritten so {talib} compiles much faster than before. + + +* ***MAVP:** Moving Average Variable Periods*—The function calculates a moving average with variable periods between candles. See below: + +```R +## generate series +x <- data.frame( + close = 1:10, + periods = c(1, 1, 1, 2, 2, 2, 3, 4, 4, 4) +) + +talib::variable_moving_average_period( + x = x, + minimumPeriod = 2, + maximumPeriod = 4 +) + +#> MAVP +#> 1 NA +#> 2 NA +#> 3 NA +#> 4 3.5 +#> 5 4.5 +#> 6 5.5 +#> 7 6.0 +#> 8 6.5 +#> 9 7.5 +#> 10 8.5 +``` + + + + +* AVGDEV + + +## breaking changes + +* **General:** All functions now follows the naming convention of TA-Lib. All function signatures are on the following form: + +```R +indicator( + x, ## unchanged + cols, ## unchanged + ## additional/optional TA-Lib parameters + ## are now camelCase mined upstream + timePeriod, ## was 'n' before + fooBar, ## was 'foo_bar' or 'foobar' before + fooBaz, ## was 'foo_baz' or 'foobaz' before + na.bridge = FALSE ## unchanged +) +``` + +This has the benefit of being transparent when comparing or reading the source code. + +* **MATypes:** Functions that used MATypes in the indicator function are now significantly different. See the `bollinger_bands()` below: + +```R +talib::bollinger_bands( + talib::BTC, + timePeriod = 20, + maType = talib::EMA() +) +``` + +Prior to this update, the correct call was: + +```R +talib::bollinger_bands( + talib::BTC, + ma = talib::EMA(n = 20) +) +``` + +While the above function call is aestethically pleasing, it did introduce some ambigiuites in other calls. See, for example, `APO()` (v0.9.2) below: + +```R +absolute_price_oscillator( + x, + cols, + fast = 12, + slow = 26, + ma = SMA(n = 9), + na.bridge = FALSE, + ... +) +``` + +In this specific case the function has three different `n` - the underlying function were discarding `n = 9` while keeping the MAType. +The new call is given as: + +```R +absolute_price_oscillator( + x, + cols, + fastPeriod = 12, + slowPeriod = 26, + maType = 0, + na.bridge = FALSE, + ... +) +``` + +In this call the role of each argument is *should* be clearer than before. + + + ## bug-fixes +* CCI as main chart should have been subchart +* Correct return of one-dimensional indicators + + # version 0.9-2 ## improvements From e3a1ed88971dc36028fff83d3753bd05926e3360 Mon Sep 17 00:00:00 2001 From: serkor1 <77464572+serkor1@users.noreply.github.com> Date: Tue, 28 Jul 2026 08:11:07 +0200 Subject: [PATCH 2/2] :books: Added bug-fixes and finished new features --- NEWS.md | 48 +++++++++++++++++++----------------------------- 1 file changed, 19 insertions(+), 29 deletions(-) diff --git a/NEWS.md b/NEWS.md index 74b23769f..a7dee5f30 100644 --- a/NEWS.md +++ b/NEWS.md @@ -19,42 +19,34 @@ talib::lookback( The function returns the minimum required lookback for calculating the indicator. Its use-case is customized control-flows for downstream wrappers and/or packages that declares dependency on {talib}. -* The underlying source code have been completely rewritten so {talib} compiles much faster than before. +* The source code have been re-written so it generates the underlying TA-Lib wrappers using preprocessors and X-Macros, which compiles much faster than before. - -* ***MAVP:** Moving Average Variable Periods*—The function calculates a moving average with variable periods between candles. See below: +* _**MAVP:** Moving Average Variable Periods_—The function calculates a moving average with variable periods between candles. See below: ```R -## generate series -x <- data.frame( - close = 1:10, - periods = c(1, 1, 1, 2, 2, 2, 3, 4, 4, 4) -) - talib::variable_moving_average_period( - x = x, + x = 1:10, + periods = c(1, 1, 1, 2, 2, 2, 3, 4, 4, 4), minimumPeriod = 2, maximumPeriod = 4 ) -#> MAVP -#> 1 NA -#> 2 NA -#> 3 NA -#> 4 3.5 -#> 5 4.5 -#> 6 5.5 -#> 7 6.0 -#> 8 6.5 -#> 9 7.5 -#> 10 8.5 +#> [1] NA NA NA 3.5 4.5 5.5 6.0 6.5 7.5 8.5 +#> attr(,"lookback") ``` +* _**AVGDEV:** Averge deviation_—The function calculates the average deviation of a series. See below: - - -* AVGDEV - +```R +talib::average_deviation( +x = 1:10, +periods = c(1, 1, 1, 2, 2, 2, 3, 4, 4, 4), +timePeriod = 5 +) +#> [1] NA NA NA NA 1.2 1.2 1.2 1.2 1.2 1.2 +#> attr(,"lookback") +#> [1] 4 +``` ## breaking changes @@ -125,13 +117,11 @@ absolute_price_oscillator( In this call the role of each argument is *should* be clearer than before. - - ## bug-fixes -* CCI as main chart should have been subchart -* Correct return of one-dimensional indicators +* _**CCI:** Incorrect charting_—The indicator were incorrectly classified as a main chart indicator— +* _**One-dimensional indicators:** incorrect return \_—Indicators that returns a one-dimensional indicator (MA, RSI, etc.) were returning a \ or \ instead of \. # version 0.9-2