A Strategy is the top-level research artifact in the Hedge Fund Backend — the single entity that binds together a universe of symbols, a timeframe, a set of computed features, a trained ML model, and a signal logic definition. Every other domain object — features, models, signals, backtests, and validation runs — ultimately rolls up to a Strategy. Once a strategy passes backtesting and the validation gate, it can be promoted to the Portfolio Construction Layer for live trading or paper execution.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/najmulhossainnj/Hedge-fund-backend/llms.txt
Use this file to discover all available pages before exploring further.
What is a Strategy?
At its core a Strategy is a named, versioned configuration record stored in thestrategies table. It holds references (UUIDs) to the features, model, and signal logic it uses, plus the list of ticker symbols and the bar timeframe it operates on.
Core Fields
| Field | Type | Description |
|---|---|---|
name | string | Human-readable identifier, max 255 characters |
description | string | null | Optional prose describing the strategy hypothesis |
universe | string[] | Array of ticker symbols the strategy trades |
timeframe | string | Bar resolution — "1d", "1h", "15m", etc. |
feature_ids | UUID[] | References to Feature definitions in the Feature Store |
model_id | UUID | null | Reference to the trained MLModel |
signal_logic_id | UUID | null | Reference to a SignalLogic rule tree |
pipeline_config | object | Backtest and execution settings (capital, fees, sizing) |
status | string | Lifecycle status — see below |
version | integer | Monotonically incrementing optimistic-lock version |
Strategy Statuses
Thestatus field controls which operations are permitted on a strategy and whether it is eligible for promotion. Statuses are defined as string constants in the ORM:
draft
Initial state when a strategy is created. Features, model, and signal logic can be freely attached or replaced. No backtest has completed.
backtested
At least one backtest has completed successfully. Metrics are available for review. The strategy is ready for validation.
validated
Walk-forward analysis and/or CPCV have passed all configured gates. The strategy has demonstrated out-of-sample robustness.
promoted
The strategy has been promoted to the Portfolio Construction Layer and is eligible for live or paper trading.
archived
The strategy has been retired. Archived strategies are read-only; their historical results remain accessible.
Status transitions are enforced by the API layer. You cannot promote a strategy that is not in
validated status, and you cannot validate a strategy that has no completed backtest.Strategy Lifecycle
Building a production-ready strategy involves six sequential phases. Each phase produces an artifact that feeds the next.Phase 1 — Create and Configure
Phase 1 — Create and Configure
Create a strategy with
POST /api/strategies. At this point only name, description, universe, timeframe, and pipeline_config are required. The strategy starts in draft status with no feature, model, or signal references.Phase 2 — Attach Features
Phase 2 — Attach Features
Define
Feature records via POST /api/features for each indicator or dataset you want (e.g., RSI, ATR, news sentiment). Then update the strategy’s feature_ids array with PATCH /api/strategies/{id}. The Feature Engine will generate and version-hash the actual datasets on demand.Phase 3 — Train a Model
Phase 3 — Train a Model
Create a model definition and train it via
POST /api/models/{id}/train. The training request specifies the same feature_ids, symbol, and date range. On completion, model_id is written back to the strategy.Phase 4 — Define Signal Logic
Phase 4 — Define Signal Logic
Use the Signal Builder or POST a
SignalLogic rule tree to POST /api/signals. Attach it to the strategy by patching signal_logic_id. You can dry-run the rule tree against a prediction sample with POST /api/signals/validate-rule-tree before committing it.Phase 5 — Run a Backtest
Phase 5 — Run a Backtest
Execute a backtest with
POST /api/backtests + POST /api/backtests/{id}/execute. The pipeline resolves all referenced artifacts, runs the chosen engine (vectorbt or Backtrader), and persists the equity curve, trade list, and computed metrics. On success the strategy transitions to backtested.Phase 6 — Validate
Phase 6 — Validate
Trigger walk-forward analysis with
POST /api/validation/walk-forward or CPCV with POST /api/validation/cpcv. If all promotion gates are passed the strategy status automatically transitions to validated.Phase 7 — Promote
Phase 7 — Promote
Call
POST /api/strategies/{id}/promote. The API checks promotion readiness (see below) and — if satisfied — transitions status to promoted and signals the Portfolio Construction Layer.Promotion Readiness Checklist
Before a strategy can be promoted, the following conditions must all be true:Status is validated
The strategy must be in
validated status, meaning all walk-forward and/or CPCV gates have been passed.Completed backtest exists
At least one
Backtest record linked to this strategy must have status == "completed".Model is attached
model_id must be non-null and the referenced MLModel must have a valid artifact_uri.Signal logic is attached
signal_logic_id must be non-null and the referenced SignalLogic must have a non-empty rule_tree.Versioning
EveryStrategy carries a version integer that increments on every write. The ORM uses the VersionMixin which applies optimistic locking — concurrent updates to the same strategy will conflict rather than silently overwrite each other. Always include the current version in PATCH requests when building UIs or automation pipelines.