Skip to main content

Backtest

No description

type Backtest implements Node {
aiHistory(
first: Int
): [AIHistoryEntry!]!
runner: BotRunner
effectiveConfig: Map
overrides: [BacktestOverride!]
series: BacktestSeries
summary: BacktestSummary
overfitScore: OverfitScore
digest: BacktestDigest
window: BacktestWindow!
resourceUsage: ResourceUsageAggregation
id: ID!
deletedAt: Time
status: BacktestTaskStatus!
result: Map
errorMessage: String
logs: String
strategyID: ID!
runnerID: ID!
createdAt: Time!
updatedAt: Time!
completedAt: Time
profitTotal: Float
winRate: Float
maxDrawdown: Float
totalTrades: Int
vsHoldingPp: Float
startDate: Time
endDate: Time
config: Map
configFingerprint: String
splitGroupID: ID
splitRole: BacktestSplitRole
splitIndex: Int
kind: BacktestBacktestKind!
biasReport: BiasCheckReport
strategy: Strategy!
simulations(
after: Cursor
first: Int
before: Cursor
last: Int
orderBy: [SimulationOrder!]
where: SimulationWhereInput
): SimulationConnection!
legibleStatus: EntityStatus!
}

Fields​

Backtest.aiHistory ● [AIHistoryEntry!]! non-null object​

What the assistant changed on this backtest, newest first.

Backtest.aiHistory.first ● Int scalar​

Backtest.runner ● BotRunner object​

The runner this backtest executed on, or null when the caller may not read that runner.

NULLABLE by design: a public strategy's backtest can have run on a runner private to the strategy's workspace, which another org's caller may not read. The ENT-generated non-null runner: BotRunner! edge is skipped (see internal/ent/schema/backtest.go) so that denial resolves to null instead of nulling the whole Backtest node. A soft-deleted runner still resolves.

Backtest.effectiveConfig ● Map scalar​

The config the run executed: the strategy version's config with the run's window as its timerange, then this run's config merged over it key by key, as Freqtrade merges successive --config files (#4781). It is built by the same function as the dispatched spec, so hashing it as the config fingerprint does reproduces configFingerprint. Exchange credentials are removed.

A key the strategy declares only in its code (a class attribute) and that neither config sets is absent: the class value governed the run.

Gated like result (it carries the strategy's config, which is gated). Null only when the caller may not read it.

Backtest.overrides ● [BacktestOverride!] list object​

Every setting the run changed from its strategy's own value, sorted by key: stoploss, minimal_roi, timeframe, max_open_trades, trailing_* and stake_amount. Empty for a run that changed none. A platform default written for a key the strategy leaves unset is not an override. Gated like effectiveConfig; null only when the caller may not read it.

Backtest.series ● BacktestSeries object​

The run's time series, built from its result. Null until the run completes, or when the result carries no starting balance. Stored at completion; a run that completed earlier gets it built and stored on its first read.

Gated exactly like result, which it is derived from: whoever may read the run's result may read its series, and nobody else. Nullable, so a denial nulls this field, not the Backtest.

Backtest.summary ● BacktestSummary object​

Typed summary of key backtest metrics extracted from result

Backtest.overfitScore ● OverfitScore object​

Advisory overfit-risk score. Computed by pairing this backtest with its split siblings (in-sample vs out-of-sample) or gathering its consistency-check windows by split_group_id. Null for a standalone backtest, or until every sibling has completed. Advisory only — never gates a run. A curated safe aggregate (like summary); parent-node access already gates reaching it.

Backtest.digest ● BacktestDigest object​

Server-computed digest: total return, drawdown, win rate, trade count, Sharpe/Sortino, worst trade, and a comparison with the strategy's other versions' backtests. The small, safe summary for list selections and the assistant; the raw result stays out of lists. Parent-node access gates it, like summary; comparison peers are limited to what the caller can read.

Backtest.window ● BacktestWindow! non-null object​

What window this run asked for, what window it got, and whether they differ enough that a reader must be told before trusting a metric against the requested range. Always present; the executed half is null until the run has a result.

Backtest.resourceUsage ● ResourceUsageAggregation object​

Total resource usage for this backtest execution Only populated if the backtest ran on a runner with billing enabled

Backtest.id ● ID! non-null scalar​

Backtest.deletedAt ● Time scalar​

Soft-delete timestamp. If set, record is considered deleted.

Backtest.status ● BacktestTaskStatus! non-null enum​

Task status

Backtest.result ● Map scalar​

Backtest result data (metrics, logs, trades, etc.)

Backtest.errorMessage ● String scalar​

Error message if backtest failed

Backtest.logs ● String scalar​

Container logs from backtest execution

Backtest.strategyID ● ID! non-null scalar​

Foreign key to strategy

Backtest.runnerID ● ID! non-null scalar​

Foreign key to runner

Backtest.createdAt ● Time! non-null scalar​

Backtest.updatedAt ● Time! non-null scalar​

Backtest.completedAt ● Time scalar​

Completion timestamp

Backtest.profitTotal ● Float scalar​

Total profit as a fraction of starting balance (freqtrade profit_total: 0.1 = +10%). Null until the run completes with metrics.

Backtest.winRate ● Float scalar​

Share of winning trades (freqtrade winrate: 0.55 = 55%), not a percentage. Null until the run completes with metrics. Unit: fraction 0..1.

Backtest.maxDrawdown ● Float scalar​

Maximum account drawdown (freqtrade max_drawdown_account, falling back to max_drawdown). Null until the run completes with metrics. Unit: fraction 0..1.

Backtest.totalTrades ● Int scalar​

Number of closed trades in the run (freqtrade total_trades). Null until the run completes with metrics.

Backtest.vsHoldingPp ● Float scalar​

Profit against holding the same pairs: (profitTotal - marketChange) x 100. Unit: percentage points, signed (4.2 = +4.2 pp). Null until the run completes, or when the result has no market change.

Backtest.startDate ● Time scalar​

Backtest start date (beginning of time range)

Backtest.endDate ● Time scalar​

Backtest end date (end of time range)

Backtest.config ● Map scalar​

Backtest-specific configuration overrides (exchange, dry_run, etc.)

Backtest.configFingerprint ● String scalar​

Identifies the run by what it executes: the strategy code and the merged freqtrade config (timerange included), minus keys that cannot change the result. Two runs with the same fingerprint are the same run, whichever surface launched them (runconfig.Fingerprint, #2963). Server-managed.

Backtest.splitGroupID ● ID scalar​

Groups backtests created together as a validation set (split pair / consistency-check windows). Nil for a standalone backtest.

Backtest.splitRole ● BacktestSplitRole enum​

Role within the split group: in_sample, out_of_sample, or wf_window. Nil for a standalone backtest.

Backtest.splitIndex ● Int scalar​

Order of this backtest within its consistency-check window set (0-based). Nil unless a consistency-check window.

Backtest.kind ● BacktestBacktestKind! non-null enum​

What the job runs: backtest, or bias_check (lookahead + recursive analysis). A bias check stores biasReport, never a result.

Backtest.biasReport ● BiasCheckReport object​

A bias check's finding (lookahead / recursive analysis). Nil for a backtest and until the check completes. Server-managed.

Backtest.strategy ● Strategy! non-null object​

Backtest.simulations ● SimulationConnection! non-null object​

Backtest.simulations.after ● Cursor scalar​

Returns the elements in the list that come after the specified cursor.

Backtest.simulations.first ● Int scalar​

Returns the first _n_ elements from the list.

Backtest.simulations.before ● Cursor scalar​

Returns the elements in the list that come before the specified cursor.

Backtest.simulations.last ● Int scalar​

Returns the last _n_ elements from the list.

Backtest.simulations.orderBy ● [SimulationOrder!] list input​

Ordering options for Simulations returned from the connection.

Backtest.simulations.where ● SimulationWhereInput input​

Filtering options for Simulations returned from the connection.

Backtest.legibleStatus ● EntityStatus! non-null object​

Interfaces​

Node interface​

An object with an ID. Follows the Relay Global Object Identification Specification

Returned By​

backtestChanged subscription ● backtestProgress subscription ● orgBacktestChanged subscription ● replayTradeExplanation mutation ● rerunBacktest mutation ● runBacktest mutation ● runBacktestWithSplit mutation ● runShadowBacktest mutation ● runWalkForward mutation ● stopBacktest mutation

Member Of​

BacktestComparison object ● BacktestEdge object ● Simulation object ● Strategy object