Trading Models API
Trading Models API
Use this endpoint to retrieve the currently dominant Trading Models for a symbol.
A Trading Model is the combination of Entry Logic (entry generation), Position Manager (risk & exits), and Regime Filter (when to trade).
Endpoint
GET https://api.darwintiq.com/v1/models
Query parameters
symbol(required) — e.g.EURUSD,USDJPY,XAUUSD,SP500,DAXsort(optional) —fitness(default) |latest|entryMovelimit(optional) — number of Trading Models to return (default:5, max:50)entryType(optional) — filter to a specific Entry Logic type
Example
curl -H "Authorization: Bearer [YOUR_TOKEN]" \
"https://api.darwintiq.com/v1/models?symbol=EURUSD&sort=fitness"
Response (example)
{
"status": "success",
"symbol": "EURUSD",
"trading_models": [
{
"id": "abc123",
"timeframe": "H1",
"created": "2026-02-10 09:20:00",
"tested": "2026-02-10 13:20:00",
"fitness": 74.6,
"stabilityScore": 72,
"entryMovePips": -6.4,
"entryPrice": 1.08742,
"currentPrice": 1.08678,
"entryLogic": {
"type": "breakout_extrema",
"class": "BreakoutExtrema",
"description": "Breakout entries around recent extrema.",
"params": {}
},
"positionManager": {
"type": "absolute",
"class": "Absolute",
"description": "Fixed stop and trailing stop.",
"params": {},
"initialStopPips": 20,
"trailingStopPips": 10,
"takeProfitPips": 40
},
"regimeFilter": {
"type": "nofilter",
"class": "Nofilter",
"description": "No regime filter applied.",
"params": {}
},
"lastEntry": {
"type": "BUY",
"time": "2026-02-10 10:00:00",
"timeElapsed": "20 minutes ago"
},
"totalPips": 132,
"pipsPerTrade": 3.1,
"tradesWon": 14,
"tradesLost": 7,
"pipsWon": 196,
"pipsLost": 64,
"maxDrawdown": 12.4,
"expectedValue": 0.62,
"profitFactor": 1.74,
"sharpe": 0.38,
"sortino": 0.56,
"calmar": 1.92,
"avgDrawdown": 4.7,
"exposure": 0.41,
"returnStability": 0.78,
"testPeriod": { "from": "2026-02-10 09:20:00", "to": "2026-02-10 13:20:00" }
}
],
"timeSemantics": {
"version": 1,
"fieldBases": {
"trading_models[].lastEntry.time": "BROKER_NY_CLOSE",
"trading_models[].lastEntry.timeElapsed": "RELATIVE",
"trading_models[].testPeriod.from": "BROKER_NY_CLOSE",
"trading_models[].testPeriod.to": "BROKER_NY_CLOSE",
"trading_models[].created": "RELATIVE",
"trading_models[].tested": "RELATIVE"
}
}
}
Field reference
| Field | Type | Description |
|---|---|---|
status | string | success when the request succeeds. |
symbol | string | Requested symbol (e.g., EURUSD). |
trading_models | array | List of trading model objects. |
trading_models[].id | string | Stable model identifier. |
trading_models[].timeframe | string | Model timeframe. |
trading_models[].created | string | Humanized relative creation time label (for example 2h ago). |
trading_models[].tested | string | Humanized relative backtest time label (for example 15m ago). |
trading_models[].fitness | number | Fitness score (higher = better). |
trading_models[].stabilityScore | number | null | Drift-based stability score (0–100). |
trading_models[].entryMovePips | number | null | Signed pip move since last entry. |
trading_models[].entryPrice | number | null | Entry price of last signal. |
trading_models[].currentPrice | number | null | Current price used for move calculation. |
trading_models[].entryLogic | object | Structured entry logic block. |
trading_models[].positionManager | object | Structured position manager block. |
trading_models[].regimeFilter | object | Structured regime filter block. |
trading_models[].lastEntry | object | Last entry time and direction. |
trading_models[].lastEntry.time | string | Last entry timestamp in broker chart time (BROKER_NY_CLOSE). |
trading_models[].lastEntry.timeElapsed | string | Humanized relative time label (RELATIVE). |
trading_models[].totalPips | number | Total net pips in test window. |
trading_models[].pipsPerTrade | number | Average pips per trade. |
trading_models[].tradesWon | number | Number of winning trades. |
trading_models[].tradesLost | number | Number of losing trades. |
trading_models[].pipsWon | number | Total pips from wins. |
trading_models[].pipsLost | number | Total pips from losses. |
trading_models[].maxDrawdown | number | Max drawdown (pips). |
trading_models[].expectedValue | number | Expected value (pips). |
trading_models[].profitFactor | number | null | Gross wins divided by gross losses. |
trading_models[].sharpe | number | null | Return/volatility ratio (trade-return based). |
trading_models[].sortino | number | null | Return/downside-volatility ratio. |
trading_models[].calmar | number | null | Net return divided by max equity drawdown. |
trading_models[].avgDrawdown | number | Average drawdown (pips). |
trading_models[].exposure | number | Time in market ratio (0..1). |
trading_models[].returnStability | number | null | Smoothness of equity trend (R², 0..1). |
trading_models[].testPeriod | object | Backtest window (from/to). |
trading_models[].testPeriod.from | string | Backtest window start in broker chart time (BROKER_NY_CLOSE). |
trading_models[].testPeriod.to | string | Backtest window end in broker chart time (BROKER_NY_CLOSE). |
trading_models[].analytics | object | Personality + stability analytics. |
trading_models[].analytics.stability | object | null | Stability metrics (stdDev, drift, MI). |
trading_models[].analytics.stability.score | number | null | Stability score (0–100), derived from drift metrics. |
trading_models[].analytics.stability.stdDev | number | null | Standard deviation of trade outcomes (pips). |
trading_models[].analytics.stability.drift | object | null | Drift metrics across features. |
trading_models[].analytics.stability.drift.profit_pips | object | null | Drift on profit per trade. |
trading_models[].analytics.stability.drift.rr | object | null | Drift on reward-to-risk distribution. |
trading_models[].analytics.stability.drift.holding_time | object | null | Drift on holding time distribution. |
trading_models[].analytics.stability.drift.stop_loss_pips | object | null | Drift on stop-loss sizing. |
trading_models[].analytics.stability.drift.*.js | number | null | Jensen–Shannon divergence. |
trading_models[].analytics.stability.drift.*.wasserstein | number | null | Wasserstein distance. |
trading_models[].analytics.stability.drift.*.ks | number | null | KS statistic. |
trading_models[].analytics.stability.drift.*.psi | number | null | Population Stability Index. |
trading_models[].analytics.stability.mi | object | null | Mutual information metrics. |
trading_models[].analytics.stability.mi.winloss_profit_pips | number | null | MI between win/loss and profit distribution. |
trading_models[].analytics.stability.mi.winloss_holding_time | number | null | MI between win/loss and holding time. |
trading_models[].analytics.stability.mi.winloss_rr | number | null | MI between win/loss and reward-to-risk. |
trading_models[].analytics.stability.mi.winloss_stop_loss_pips | number | null | MI between win/loss and stop-loss sizing. |
trading_models[].analytics.stability.driftWindow | object | null | Drift window meta. |
trading_models[].analytics.stability.driftWindow.split | string | null | Split strategy (e.g., first_half_vs_second_half). |
trading_models[].analytics.stability.driftWindow.start | string | null | Backtest start time. |
trading_models[].analytics.stability.driftWindow.mid | string | null | Midpoint time used for split. |
trading_models[].analytics.stability.driftWindow.end | string | null | Backtest end time. |
trading_models[].analytics.stability.driftWindow.min_trades_per_half | number | null | Minimum trades per half for drift calc. |
trading_models[].analytics.stability.driftWindow.insufficient_trades | boolean | null | True if drift couldn’t be computed. |
trading_models[].analytics.stability.driftWindow.pre_trades | number | null | Trades in first half. |
trading_models[].analytics.stability.driftWindow.post_trades | number | null | Trades in second half. |
timeSemantics | object | null | Optional timestamp semantics metadata for interpreting timestamp fields. |
timeSemantics.version | number | Metadata version (currently 1). |
timeSemantics.fieldBases | object | Map of field paths to time basis identifiers. |
timeSemantics.notes | array | null | Optional human-readable notes about timestamp semantics. |
Notes on the core ranking fields
- Fitness: overall score for recent performance + consistency.
- Stability Score: drift-based stability estimate (higher = more stable).
- Entry Move (pips): signed pip movement since the last entry, measured at request time.
- Entry/Current Price: raw prices used for the move calculation, useful for UI context.
- Relative labels like
created,tested, andlastEntry.timeElapsedare display strings (RELATIVE) and should not be parsed as absolute timestamps.
Timestamp semantics
BROKER_NY_CLOSEmeans Darwinex/MT4 chart time aligned to New York close (typicallyUTC+2in winter /UTC+3in summer).RELATIVEmeans a human-readable label (for example5 minutes ago), not an absolute timestamp.- If
timeSemanticsis present, prefer it over hard-coded assumptions in API clients.
Stability metrics
- Std Dev: dispersion of trade outcomes within the backtest window.
- Drift (JS / Wasserstein / KS / PSI): distribution shift between the first and second half of the window.
- Mutual Information (MI): how informative the distribution is about win/loss outcomes.
- Profit Factor / Sharpe / Sortino / Calmar: risk-adjusted performance and drawdown efficiency metrics.
- Avg Drawdown / Exposure / Return Stability: typical drawdown pressure, time-in-market, and equity smoothness.
Errors
400invalid symbol or query401missing/invalid token429rate limited500internal error