Package 'wickra'

Title: Streaming-First Technical Indicators
Description: R bindings for the Wickra technical-analysis library over its C ABI hub. Exposes 514 indicators, each an O(1) streaming state machine shared with the Rust core and the other language bindings, so that live and historical evaluation use the exact same implementation.
Authors: Wickra contributors [aut, cre]
Maintainer: Wickra contributors <[email protected]>
License: MIT + file LICENSE | Apache License 2.0
Version: 0.8.8
Built: 2026-06-11 21:16:12 UTC
Source: https://github.com/wickra-lib/wickra

Help Index


Run an indicator over a whole series in one call

Description

Available for scalar indicators. The result is identical to feeding the same inputs through update() one at a time, with NA at warmup positions.

Usage

batch(object, ...)

## S3 method for class 'wickra_indicator'
batch(object, ...)

Arguments

object

A wickra_indicator.

...

The input vector(s).

Value

A numeric vector the same length as the input.

Examples

batch(Sma(3), c(1, 2, 3, 4, 5)) # NA NA 2 3 4

Reset an indicator to its warmup state

Description

Reset an indicator to its warmup state

Usage

reset(object)

## S3 method for class 'wickra_indicator'
reset(object)

Arguments

object

A wickra_indicator.

Value

The indicator, invisibly.

Examples

sma <- Sma(3)
update(sma, 1)
reset(sma)

Synthetic daily OHLCV sample series

Description

A deterministic, synthetic daily OHLCV (open / high / low / close / volume) price series for use in the examples, the Getting started vignette, and tests. It is a seeded random walk, not real market data. Regenerate with data-raw/sample_ohlcv.R.

Usage

sample_ohlcv

Format

A data frame with 250 rows and 6 columns:

date

Trading date (Date).

open

Opening price.

high

Session high.

low

Session low.

close

Closing price.

volume

Traded volume.


Update an indicator with one observation

Description

Update an indicator with one observation

Usage

## S3 method for class 'wickra_indicator'
update(object, ...)

Arguments

object

A wickra_indicator created by an indicator constructor.

...

The observation: a single value for scalar indicators, the OHLCV fields plus a timestamp for candle indicators, or two values for pairwise indicators.

Value

The indicator value: a numeric scalar; a named numeric vector for multi-output indicators (NA during warmup); a matrix of completed bars for bar builders; or a list / numeric vector for profile indicators (NULL during warmup).

Examples

sma <- Sma(3)
for (x in c(1, 2, 3, 4, 5)) v <- update(sma, x)
v # 4