Founding pricing available nowPricing review on May 1Early customers keep their price for life

Trading Models API

Trading Models API

This endpoint returns the currently dominant trading models for a symbol.

A trading model combines:

Use this endpoint when you want to rank, inspect, or integrate the strongest currently available model configurations for a symbol.

Endpoint

GET https://api.darwintiq.com/v1/models

Query Parameters

ParameterRequiredTypeDescription
symbolYesstringMarket symbol, for example EURUSD, USDJPY, XAUUSD, SP500, or DAX.
sortNostringSort order: fitness (default), latest, or entryMove.
limitNointegerNumber of trading models to return. Default is 5, maximum is 50.
entryTypeNostringRestricts results to a specific entry logic type.
entryTypesNostringCompatibility alias for entryType.

How to Use It

A typical client flow is:

  1. Request the endpoint with a symbol.
  2. Sort the results according to your use case.
  3. Read the top-ranked item or iterate over the returned list.
  4. Use the nested model blocks and performance fields in your UI, automation, or analytics pipeline.

Example Request

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": "pullback_continuation",
        "class": "PullbackContinuation",
        "description": "Trend continuation after a controlled pullback.",
        "params": {}
      },
      "positionManager": {
        "type": "absolute",
        "class": "Absolute",
        "description": "Fixed stop and trailing stop.",
        "params": {},
        "initialStopPips": 20,
        "trailingStopPips": 10,
        "takeProfitPips": 40
      },
      "regimeFilter": {
        "type": "rsi_band",
        "class": "RsiBand",
        "description": "Mean-reversion gate using RSI threshold bands.",
        "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" },
      "analytics": {
        "stability": {
          "score": 72,
          "returnStability": 0.78,
          "walkForward": {
            "enabled": true,
            "sufficient_data": true,
            "fold_count": 3,
            "coverage": 1,
            "consistency": 0.91,
            "train_score": 0.74,
            "test_score": 0.7,
            "multiplier": 0.97,
            "reason": "ok",
            "folds": [
              { "index": 0, "effective_trades": 8, "score": 0.76, "profit_pips": 18.4 },
              { "index": 1, "effective_trades": 7, "score": 0.72, "profit_pips": 15.1 },
              { "index": 2, "effective_trades": 6, "score": 0.7, "profit_pips": 13.3 }
            ]
          }
        }
      }
    }
  ],
  "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"
    }
  }
}

Response Field Reference

FieldTypeDescription
statusstringsuccess when the request succeeds.
symbolstringRequested symbol (e.g., EURUSD).
trading_modelsarrayList of trading model objects.
trading_models[].idstringStable model identifier.
trading_models[].timeframestringModel timeframe.
trading_models[].createdstringHumanized relative creation time label (for example 2h ago).
trading_models[].testedstringHumanized relative backtest time label (for example 15m ago).
trading_models[].fitnessnumberFitness score (higher = better).
trading_models[].stabilityScorenumber | nullDrift-based stability score (0-100).
trading_models[].entryMovePipsnumber | nullSigned pip move since last entry.
trading_models[].entryPricenumber | nullEntry price of last signal.
trading_models[].currentPricenumber | nullCurrent price used for move calculation.
trading_models[].entryLogicobjectStructured entry logic block.
trading_models[].positionManagerobjectStructured position manager block.
trading_models[].regimeFilterobjectStructured regime filter block. Returned models use explicit filter logic rather than an always-on no-op filter.
trading_models[].lastEntryobjectLast entry time and direction.
trading_models[].lastEntry.timestringLast entry timestamp in broker chart time (BROKER_NY_CLOSE).
trading_models[].lastEntry.timeElapsedstringHumanized relative time label (RELATIVE).
trading_models[].totalPipsnumberTotal net pips in test window.
trading_models[].pipsPerTradenumberAverage pips per trade.
trading_models[].tradesWonnumberNumber of winning trades.
trading_models[].tradesLostnumberNumber of losing trades.
trading_models[].pipsWonnumberTotal pips from wins.
trading_models[].pipsLostnumberTotal pips from losses.
trading_models[].maxDrawdownnumberMax drawdown (pips).
trading_models[].expectedValuenumberExpected value (pips).
trading_models[].profitFactornumber | nullGross wins divided by gross losses.
trading_models[].sharpenumber | nullReturn/volatility ratio (trade-return based).
trading_models[].sortinonumber | nullReturn/downside-volatility ratio.
trading_models[].calmarnumber | nullNet return divided by max equity drawdown.
trading_models[].avgDrawdownnumberAverage drawdown (pips).
trading_models[].exposurenumberTime in market ratio (0..1).
trading_models[].returnStabilitynumber | nullSmoothness of equity trend (R^2, 0..1).
trading_models[].testPeriodobjectBacktest window (from/to).
trading_models[].testPeriod.fromstringBacktest window start in broker chart time (BROKER_NY_CLOSE).
trading_models[].testPeriod.tostringBacktest window end in broker chart time (BROKER_NY_CLOSE).
trading_models[].analyticsobjectPersonality + stability analytics.
trading_models[].analytics.stabilityobject | nullStability metrics (stdDev, drift, MI).
trading_models[].analytics.stability.scorenumber | nullStability score (0-100), derived from drift metrics.
trading_models[].analytics.stability.stdDevnumber | nullStandard deviation of trade outcomes (pips).
trading_models[].analytics.stability.driftobject | nullDrift metrics across features.
trading_models[].analytics.stability.drift.profit_pipsobject | nullDrift on profit per trade.
trading_models[].analytics.stability.drift.rrobject | nullDrift on reward-to-risk distribution.
trading_models[].analytics.stability.drift.holding_timeobject | nullDrift on holding time distribution.
trading_models[].analytics.stability.drift.stop_loss_pipsobject | nullDrift on stop-loss sizing.
trading_models[].analytics.stability.drift.*.jsnumber | nullJensen-Shannon divergence.
trading_models[].analytics.stability.drift.*.wassersteinnumber | nullWasserstein distance.
trading_models[].analytics.stability.drift.*.ksnumber | nullKS statistic.
trading_models[].analytics.stability.drift.*.psinumber | nullPopulation Stability Index.
trading_models[].analytics.stability.miobject | nullMutual information metrics.
trading_models[].analytics.stability.mi.winloss_profit_pipsnumber | nullMI between win/loss and profit distribution.
trading_models[].analytics.stability.mi.winloss_holding_timenumber | nullMI between win/loss and holding time.
trading_models[].analytics.stability.mi.winloss_rrnumber | nullMI between win/loss and reward-to-risk.
trading_models[].analytics.stability.mi.winloss_stop_loss_pipsnumber | nullMI between win/loss and stop-loss sizing.
trading_models[].analytics.stability.driftWindowobject | nullDrift window meta.
trading_models[].analytics.stability.driftWindow.splitstring | nullSplit strategy (for example first_half_vs_second_half).
trading_models[].analytics.stability.driftWindow.startstring | nullBacktest start time.
trading_models[].analytics.stability.driftWindow.midstring | nullMidpoint time used for split.
trading_models[].analytics.stability.driftWindow.endstring | nullBacktest end time.
trading_models[].analytics.stability.driftWindow.min_trades_per_halfnumber | nullMinimum trades per half for drift calculation.
trading_models[].analytics.stability.driftWindow.insufficient_tradesboolean | nullTrue if drift could not be computed.
trading_models[].analytics.stability.driftWindow.pre_tradesnumber | nullTrades in first half.
trading_models[].analytics.stability.driftWindow.post_tradesnumber | nullTrades in second half.
trading_models[].analytics.stability.walkForwardobject | nullWalk-forward validation payload for out-of-sample fold consistency.
trading_models[].analytics.stability.walkForward.fold_countnumberNumber of configured folds in the current walk-forward run.
trading_models[].analytics.stability.walkForward.coveragenumber | nullShare of folds that produced usable scores (0..1).
trading_models[].analytics.stability.walkForward.consistencynumber | nullSimilarity of fold scores (0..1), higher is steadier.
trading_models[].analytics.stability.walkForward.train_scorenumber | nullAverage score of the earlier reference folds.
trading_models[].analytics.stability.walkForward.test_scorenumber | nullScore of the latest evaluated fold.
trading_models[].analytics.stability.walkForward.multipliernumber | nullFitness multiplier derived from walk-forward validation.
trading_models[].analytics.stability.walkForward.reasonstring | nullStatus/reason such as ok or insufficient_trades.
trading_models[].analytics.stability.walkForward.foldsarrayPer-fold diagnostics.
trading_models[].analytics.stability.walkForward.folds[].indexnumberZero-based fold index.
trading_models[].analytics.stability.walkForward.folds[].effective_tradesnumber | nullNumber of winning + losing trades in that fold.
trading_models[].analytics.stability.walkForward.folds[].profit_pipsnumber | nullNet pips generated inside that fold.
trading_models[].analytics.stability.walkForward.folds[].scorenumber | nullFold quality score used for train/latest comparison.
timeSemanticsobject | nullOptional timestamp semantics metadata for interpreting timestamp fields.
timeSemantics.versionnumberMetadata version (currently 1).
timeSemantics.fieldBasesobjectMap of field paths to time basis identifiers.
timeSemantics.notesarray | nullOptional human-readable notes about timestamp semantics.

Core Ranking Fields

  • fitness: overall ranking score for recent performance and consistency.
  • stabilityScore: drift-based stability estimate. Higher values indicate more stable behavior.
  • entryMovePips: signed pip move since the last entry, measured at request time.
  • entryPrice and currentPrice: raw price context used for the move calculation.
  • Friendly symbol aliases are normalized before the upstream request, for example DAX -> GDAXI and SPX500 -> SP500.

Timestamp Semantics

  • BROKER_NY_CLOSE means Darwinex/MT4 chart time aligned to New York close, typically UTC+2 in winter and UTC+3 in summer.
  • RELATIVE means a display label such as 5 minutes ago, not an absolute timestamp.
  • If timeSemantics is present, prefer it over hard-coded assumptions in client code.

Stability Metrics

  • stdDev: dispersion of trade outcomes in the backtest window.
  • Drift metrics (js, wasserstein, ks, psi): distribution shift between the first and second half of the test window.
  • Mutual information (mi): how informative certain distributions are about win/loss outcomes.
  • profitFactor, sharpe, sortino, calmar: risk-adjusted performance metrics.
  • avgDrawdown, exposure, returnStability: drawdown pressure, time-in-market, and equity smoothness context.
  • analytics.stability.walkForward: recent out-of-sample validation. Compare train_score vs. test_score and inspect multiplier for fitness drag or confirmation.

Errors

StatusMeaning
400Invalid symbol or query parameter.
401Missing or invalid bearer token.
403Valid token, but no access to the requested symbol or subscription scope.
429Rate limit exceeded.
500Internal or upstream server error.

Repository

Public example code is available here:

https://github.com/darwintIQ/API