Opening — Why this matters now

Most trading libraries die of obesity.

They start life as tidy indicator toolkits and, over time, accumulate ad‑hoc features, half‑finished strategies, and opinionated shortcuts that quietly blur the line between describing markets and acting on them. Eventually, users stop trusting what a signal actually means.

The latest strategyr refactor is interesting because it does the opposite: it removes functionality. Aggressively. And in doing so, it clarifies what kind of system this wants to be.

Background — The indicator trap

Traditional technical‑analysis libraries are optimized for familiarity, not accountability. EMA, RSI, ATR, bands, pivots—everything looks mathematically precise, yet very little is framed around decision relevance.

The earlier architecture of strategyr reflected this tension. Indicators, event detectors, position builders, and order generators coexisted in one package. Convenient, yes. Conceptually clean? Not quite.

The refactor draws a hard line: features describe, strategies decide, engines execute.

Analysis — What the refactor actually does

1. From “features” to predictive objects

The new structure sharply distinguishes between:

Category Role Example
Descriptive features Market state EMA, ATR (log‑return), volatility
Predictive features Outcome estimation ATR quantiles, trend age
Binary events Discrete regime markers EMA cross events
Positions Intent without leverage −1 to +1
Orders Executable actions TP/SL, breakout layers

This matters because it stops pretending that all indicators are equal. Some describe. Some predict. Some only make sense when backtested as events.

2. Half‑life replaces magic numbers

One subtle but important shift: volatility and momentum features increasingly use statistical half‑life instead of arbitrary lookback windows.

ATR in log‑return space, parameterized by half‑life $h$, aligns the indicator with decay dynamics rather than calendar superstition. It also makes cross‑asset comparisons sane.

3. Fewer exports, clearer intent

Large chunks of strategy‑level helpers—ladder builders, breakout order generators, composite position logic—are removed from the public API.

That’s not regression. It’s a boundary decision.

strategyr is no longer trying to be:

  • a strategy cookbook
  • a signal‑to‑order engine

It is becoming a feature and intent layer that upstream systems can trust.

4. data.table + Rcpp, unapologetically

The refactor doubles down on two choices:

  • data.table for reference semantics and zero‑copy workflows
  • Rcpp for iteration‑heavy kernels

The design philosophy is explicit: human‑readable orchestration in R, deterministic kernels in C++.

Findings — What changes in practice

Before vs After

Dimension Before After
Scope Indicators + strategies Features + intent
Parameterization Lookback‑based Half‑life‑based
API surface Broad Narrow
Strategy opinion Embedded Externalized

The refactor doesn’t make strategyr smaller in capability—it makes it more composable.

Implications — Who this is for (and who it isn’t)

This version of strategyr is not for traders who want plug‑and‑play signals.

It is for:

  • researchers building multi‑strategy engines
  • practitioners separating modelling from execution
  • anyone tired of indicator libraries that quietly smuggle strategy assumptions

In other words: people who care where intent actually enters the system.

Conclusion — Less magic, more structure

The quiet achievement of this refactor is philosophical discipline.

By deleting code, strategyr becomes easier to reason about, easier to test, and harder to misuse. In trading systems, that’s not minimalism—it’s risk control.

Cognaptus: Automate the Present, Incubate the Future.