Reference / Limen research

limen.targets

Build supervised target columns from market data for manifest-driven and custom experiments.

Contents

Canonical docs

In the research projects

The Python project computes next-bar return separately inside each split. The Compiled project fits a quantile target on training observations and reuses its cutoff. The target reference preserves each alternative’s parameters, source columns and forward-label boundary.

What this package owns

TradeOutcomeTarget consumes the shared execution contract through an injected TradeTargetContext and exposes private OutcomeLabels. See simulated trade outcomes for configuration, completion masks and feature isolation.

Owns train-fitted and transform-time target builders, including binary classification targets, return targets, breakout targets, barrier targets, and identity passthrough targets. Does not own feature engineering, model fitting, calibration, or execution strategy.

Key entry points

Entry point Use case Notes
QuantileBinaryTarget Labels from a train-fitted quantile cutoff Fits the cutoff on train only.
ThresholdBinaryTarget Labels from a fixed threshold Supports explicit return thresholds.
TradelineLongBinaryTarget Long-entry label from price-line context Pairs with line-based feature helpers.
NextReturnTarget, VolNormalizedReturnTarget, ForwardVolNormalizedReturnTarget Continuous forward-return style targets Common for regression or ranking experiments.
NextBarUpTarget, NextBarDownTarget One-bar direction labels Classification baselines.
ForwardBreakoutTarget, EmaBreakoutTarget Breakout-oriented labels Uses forward path or EMA context.
TripleBarrierTarget Path-aware barrier label Requires enough rows for max_horizon and the volatility warmup.
RiskRewardRatioTarget, ExitQualityTarget Outcome labels from upstream trade-path columns Require the expected input columns to exist on every split.
RandomBinaryTarget, IdentityTarget Controls or already-present target columns Supports tests, baselines, and externally labelled data.

Adjacent modules

  • limen.transforms can derive target inputs before target construction.
  • limen.experiment.Manifest wires target builders into prepare_data().
  • limen.calibration evaluates predictions against the target labels after model output.

Quick orientation

text · README.md
targets/├── README.md├── __init__.py├── _barrier_paths.py├── _perturbation.py├── ema_breakout.py├── exit_quality.py├── forward_breakout.py├── forward_vol_normalized_return.py├── identity.py├── next_bar_down.py├── next_bar_up.py├── next_return.py├── quantile_binary.py├── random_binary.py├── risk_reward_ratio.py├── threshold_binary.py├── trade_outcome.py├── tradeline_long_binary.py├── triple_barrier.py└── vol_normalized_return.py

Things to know

  • Target classes receive the training split during construction and apply transform() to every split.
  • Train-fitted targets must store only train-derived state before validation and test transformation.
  • Forward-looking targets naturally create boundary nulls; manifest preparation drops null target rows downstream.
  • Outcome-derived targets require their upstream columns to exist before target construction.

Limen / Python Research and Compiled ResearchReturn to the research book
Edit this sourceSource revision · 9bc8a630
Reference / keep your place
Find a passage