Training

Submit a training job (non-blocking, returns job_id for polling)

post/api/v1/train

Request

  • Base URL: https://api.quantifyme.ai
  • URL: https://api.quantifyme.ai/api/v1/train
  • Auth: API key in header X-API-Key

Request body

capitalnumber

Account balance in USD. Drives the $ P&L and return-on-equity (P&L % = $ P&L / balance).

claude_modelstring
codestring required

Full Python strategy code (typically from /api/v1/generate).

commissionnumber
confidence_thresholdnumber

Signal strictness: the raw predict_proba cutoff a bar must clear to fire, as a percent (55 = a score of 0.55). NOT a calibrated probability — a 55 setting was measured delivering a 50.0% hit rate. Overrides the value in strategy_config(). Classification-only (#432) - a regression strategy (task='regression') refuses this with 400; use signal_rules instead (return/spread units).

end_datestring date
indicatorsIndicators

Flat indicator config. See GET /api/v1/indicator-schema for full param list.

leveragenumber

Margin only — sets required margin (notional / leverage); does NOT multiply P&L. Stored for future margin/liquidation modeling.

lot_sizenumber

Position size in standard lots (1.0 = 100,000 units). This is the P&L driver: $ P&L = units × (exit−entry) / FX_conv − commission/swap.

model_namestring

Optional. Auto-named Model N+1 if omitted.

risk_unit'pips' | 'usd' | 'pct'

How stop_loss/take_profit are interpreted. 'pips' = pip distance; 'usd' = $ risk at this lot; 'pct' = legacy fraction of price. The engine back-solves the price level per pair (pip_size + FX conversion).

start_datestring date
stop_lossnumber

Stop-loss magnitude in risk_unit (e.g. 25 pips, or $250 when risk_unit='usd'). Omit/null to disable. Overrides the value in strategy_config().

swap_longnumber
swap_shortnumber
symbol'EURUSD' | 'GBPUSD' | 'USDJPY' | 'USDCHF' | 'AUDUSD' | 'NZDUSD' | 'USDCAD' | 'BTCUSD'

Must match the symbol the code was generated for.

take_profitnumber

Take-profit magnitude in risk_unit (e.g. 50 pips). Omit/null to disable. Overrides the value in strategy_config().

timeframe'1min' | '5min' | '15min' | '1h'
train_splitnumber

Example request

{
  "aux_feeds": [
    {
      "symbol": "USDCHF",
      "timeframe": "15min"
    }
  ],
  "capital": 10000,
  "commission": 6,
  "confidence_threshold": 55,
  "indicators": {
    "macd_enabled": true,
    "macd_fast": 12,
    "macd_signal": 9,
    "macd_slow": 26,
    "rsi_enabled": true,
    "rsi_period": 14
  },
  "leverage": 30,
  "lot_size": 1,
  "model_name": "Model 1",
  "stop_loss": 25,
  "take_profit": 50,
  "train_split": 0.7
}

Response

Successful response

job_idinteger
model_namestring
model_stemstring

PKL filename stem: <user_id><SYMBOL><timeframe>_<model_name>

statusstring

Example response

{
  "status": "queued"
}

Changes

No recorded changes to this operation across all 1 revision of this API.