chrono-ta
Timestamp-aware technical indicators for Rust.
chrono-ta computes moving averages, momentum, volatility, extrema, drawdown,
and drawup over elapsed-time windows. Every streaming input carries a UTC
timestamp, so a 30-day indicator means 30 calendar days of observations rather
than the last 30 calls.

The animation uses the same irregular observations on both sides: upstream
ta retains the last N calls, while chrono-ta replaces a repeated time bucket
and expires observations according to elapsed time. Its reproducible Remotion
source lives in graphic/.
The project began as a fork of Greyblake's ta,
but its input model and window semantics now differ substantially. It powers the
indicator path in NexusTrade.
Why this exists
Observation-count windows are useful when every series has a fixed cadence. In
market systems, the same strategy may instead receive daily bars, hourly bars,
irregular historical data, or repeated live updates to the current bar.
chrono-ta makes time part of the indicator contract:
(timestamp, value) -> indicator -> value for that point in time
That enables:
- windows expressed as
std::time::Duration; - expiration based on timestamps rather than call count;
- replacement of repeated updates within the current time bucket;
- scalar streaming and batched processing through the same stateful API;
- SIMD-backed batch paths for EMA and RSI, with scalar parity tests;
- bounded storage for long-running windowed indicators.
chrono-ta versus ta
These crates share ancestry, not a drop-in-compatible API.
chrono-ta |
Upstream ta |
|
|---|---|---|
| Window definition | Elapsed time, such as 15 minutes or 30 days | Number of observations, such as 14 values |
| Streaming input | (DateTime<Utc>, value) |
A value or market-data item |
| Repeated live updates | Replaces the current time bucket | Every call advances state |
| Batch API | NextBatch plus public SIMD primitives |
Scalar Next |
| Indicator scope | Focused set used by the timestamped engine | Broader classic indicator catalog |
| Install name | chrono-ta |
ta |
| Rust import | chrono_ta |
ta |
Choose upstream ta when you want its larger indicator catalog and
observation-count semantics. Choose chrono-ta when timestamps, elapsed-time
expiration, repeated current-bar updates, or batch processing are part of the
problem.
Install
Install the published crate:
[]
= "2.1"
Enable serialization when indicator state must survive a restart:
[]
= { = "2.1", = ["serde"] }
To test an unreleased GitHub revision instead:
[]
= { = "https://github.com/austin-starks/chrono-ta" }
Quick start
use ;
use ExponentialMovingAverage;
use Next;
use Duration;
let mut ema = new.unwrap;
let start = Utc.with_ymd_and_hms.unwrap;
assert_eq!;
assert_eq!;
assert_eq!;
All indicators implement Next<T>. They also implement Reset, Debug,
Display, Default, and Clone where appropriate.
Current-bar replacement
Streaming feeds often send several revisions of a bar before it closes. The adaptive detector keeps those revisions from becoming several observations:
- windows shorter than five minutes use one-second buckets;
- intraday windows use one-minute buckets;
- windows of one day or longer use the library's daily-session gap rule.
Calling next twice inside the same bucket replaces the current observation
instead of advancing the indicator. Timestamps should therefore arrive in
nondecreasing order. This behavior is a core difference from upstream ta, not
an incidental optimization.
Batch processing
NextBatch returns the same state transition as calling next repeatedly.
EMA and RSI use optimized batch implementations when no input would trigger
same-bucket replacement; other indicators use the trait's scalar fallback.
use ;
use RelativeStrengthIndex;
use NextBatch;
use Duration;
let start = Utc.with_ymd_and_hms.unwrap;
let inputs = vec!;
let mut rsi = new.unwrap;
let values = rsi.next_batch;
assert_eq!;
The public simd module also exposes EMA, rate-of-change, reduction, rolling
mean, and rolling-standard-deviation primitives for callers that already own
contiguous slices.
Indicators
| Family | Indicators |
|---|---|
| Trend | Exponential Moving Average, Simple Moving Average |
| Momentum | Relative Strength Index, Rate of Change |
| Volatility | Bollinger Bands, Standard Deviation, Mean Absolute Deviation |
| Extrema and risk | Minimum, Maximum, Max Drawdown, Max Drawup |
The narrower catalog is intentional. Indicators present in upstream ta, such
as MACD, stochastic oscillators, ATR, and OBV, are not currently implemented
here. Do not select this crate on the assumption that every upstream indicator
is available.
State and serialization
The optional serde feature serializes indicator state. Optimized derived
state is rebuilt when needed after deserialization, and the test suite covers
continuing an indicator after a round trip.
Serialized representations are an implementation detail, not a stable wire format. Keep the crate version with persisted state and test migrations before upgrading a long-lived store.
Migrating from the old repository name
GitHub redirects the former austin-starks/ta-rs-improved URL, so dependencies
pinned to an existing commit continue to resolve. New dependencies should use
the chrono-ta package and URL.
To preserve existing use ta::... imports while moving to a new revision,
rename the dependency locally:
[]
= { = "chrono-ta", = "https://github.com/austin-starks/chrono-ta" }
The source imports can then remain unchanged even though the published package
is named chrono-ta.
Development
See CONTRIBUTING.md for defect reports, test expectations, and pull-request scope. Security problems should be reported privately through SECURITY.md.
Releases
Published versions are available on crates.io, with API documentation built by docs.rs. The release checklist in CONTRIBUTING.md treats the registry upload as a deliberate, irreversible step after the exact commit passes CI.
NexusTrade
chrono-ta powers time-windowed technical indicators in
NexusTrade, an AI-assisted platform for researching,
testing, optimizing, and deploying systematic trading strategies.
The fork's original RSI correction is described in this development article.
License and upstream credit
Released under the MIT License. chrono-ta is derived from
Greyblake's ta, created by Sergey
Potapov and its contributors. Austin Starks maintains this timestamp-aware fork.