At the end of a crypto backtest, keep every open position in the account valuation and declare whether the report marks it at a stated price or simulates a terminal sale. Flag cutoff exits separately from strategy exits. Closed-trade statistics and marked account returns answer different questions; neither should silently discard unfinished exposure.
The last timestamp is a research boundary. Unless the strategy actually requires an exit then, it does not demonstrate that a target, stop or signal closed the position. A report needs to preserve that distinction even when its engine creates closing trades automatically.
Choose what the cutoff measures
There are three separate outputs to consider:
| Output | Treatment of positions still open | Question answered |
|---|---|---|
| Marked account equity | Retain quantity; value it at the declared cutoff reference | What was the whole account worth under that valuation? |
| Modeled terminal liquidation | Simulate selling the remaining quantity with explicit execution costs | What cash would this close-out model produce? |
| Natural-exit trade statistics | Use positions completed by the strategy's exit rules; report unfinished positions separately | How did the observed completed round trips behave? |
The third output cannot replace the first two. Its sample is conditional on having completed before the boundary. If losing positions tend to remain open longer, dropping them can make the completed sample look unusually favorable.
This article uses “terminal liquidation” for a simulated research close-out, not a margin liquidation. It considers unleveraged spot holdings with no external cash flows. Futures require their own contract valuation, funding, collateral and liquidation rules. The realized-versus-unrealized PnL guide explains the broader accounting distinction.
Read the engine's treatment before the headline
Freqtrade's left-open-trades documentation says positions remaining at the end are force-exited. Those trades appear in the main report and again in a separate table. Adding that separate table's PnL to the main total would count the same terminal trades twice.
Backtesting.py's finalization option lets ongoing trades be closed on the last bar so they contribute to computed backtest statistics. Record the option and engine version rather than assuming every exported trade ended through the strategy.
VectorBT's holding example instead keeps its position open and values it using the last price without a hypothetical exit fee. Its trade-record documentation also distinguishes open from closed records. Check the specific metric's filtering: an account-value result and a trade statistic need not use the same inclusion rule.
These describe those engines, not interchangeable settings or KLINEO controls. KLINEO's published backtest methodology asks readers to retain the exact window, modeled costs, engine and ending exposure for the result being reviewed.
Reconcile one cutoff under two policies
All numbers below are hypothetical. Start with 10,000 USDT, no holdings and no deposits or withdrawals. Four naturally completed round trips produce net results of +80, +60, +40 and −80 USDT, including their costs: +100 USDT altogether.
Two independent spot positions remain. Their acquisition outlays already include the stated entry charges. The example has no partial fills, other assets, borrow costs or funding.
| Open position | Quantity | Purchase price | Acquisition outlay with entry charge | Cutoff reference | Marked value | Value minus outlay |
|---|---|---|---|---|---|---|
| A | 10 units | 100 | 1,002 USDT | 80 | 800 USDT | −202 USDT |
| B | 20 units | 100 | 2,004 USDT | 110 | 2,200 USDT | +196 USDT |
| Total | — | — | 3,006 USDT | — | 3,000 USDT | −6 USDT |
Cash is 10,000 + 100 − 3,006 = 7,094 USDT. Marked equity is 7,094 + 3,000 = 10,094 USDT, a 0.94% account return. The completed-trade contribution alone is +1.00% of starting capital. It omits the remaining −6 USDT valuation result.
Now separately model a terminal sale. Assume each sale executes 0.20% below its reference and pays a 0.20% fee on executed gross proceeds. These are invented assumptions, not venue rates. Retain full precision until the final account total.
| Position | Modeled exit price | Gross proceeds | Exit fee | Net proceeds |
|---|---|---|---|---|
| A | 79.84 | 798.4000 | 1.5968 | 796.8032 USDT |
| B | 109.78 | 2,195.6000 | 4.3912 | 2,191.2088 USDT |
| Total | — | 2,994.0000 | 5.9880 | 2,988.0120 USDT |
Modeled ending cash is 7,094 + 2,988.012 = 10,082.012 USDT, or approximately 0.8201% above the start. The difference from marked equity is 11.988 USDT: 6 USDT of execution-price haircut plus 5.988 USDT of sale fees. The entry charges were already paid and must not be deducted again.
The reference valuation remains useful, but it is not executable cash. For a real cost model, the slippage and depth worksheet helps explain why a constant haircut may be inadequate for a larger position.
Keep terminal exits out of natural-exit claims
The example's natural-exit win rate is 3 ÷ 4 = 75%. Under the modeled liquidation, A loses 205.1968 USDT against its acquisition outlay and B gains 187.2088 USDT. Including those two cutoff exits yields 4 ÷ 6, approximately 66.67%.
Both rates can be reported with their definitions. Neither is evidence that the strategy produced six normal exits. Keep an exit-reason field and show natural closes, terminal closes and unresolved positions as separate counts. A win-rate confidence interval cannot repair a sample that has silently changed its completion rule; identify the sample before quantifying uncertainty.
If there are no natural closes, their win rate and average completed duration are unavailable. Zero completed observations do not establish a 0% win rate or a zero-hour holding period.
Duration needs the same care. A position entered 18 hours before the boundary has been observed open for 18 hours. Its eventual natural holding duration is unknown. A forced exit creates a modeled 18-hour trade, but it does not establish how long the original exit rule would have waited.
Write a boundary record before comparing runs
Use this worksheet for every test window:
| Field | Required decision |
|---|---|
| Cutoff clock | Exact timestamp, timezone, final complete bar and inclusion rule |
| Final valuation | Price source, price timestamp and stale-price treatment for each holding |
| End orders | Whether unfilled orders expire in the simulation; confirmed fills remain exposure |
| Terminal policy | Mark only, modeled close-out, or a separately labeled continuation |
| Execution assumptions | Side, quantity, modeled price, fees and any unavailable liquidity |
| Statistics | Which exit reasons enter win rate, average duration and other trade metrics |
| Continuing state | Cash, holdings and pending instructions carried into a subsequent window |
A final-bar entry exposes a common failure. A next-bar execution model cannot fill a new order if the necessary next bar is outside the dataset. Do not invent that fill, or use the final close just because it is convenient. If a final-close execution rule is intended, specify it before examining results and justify its information timing. The equity-timing guide for order sizing addresses which account snapshot was observable when that order was sized.
A missing final price creates another exception. Silently taking the last available price can give different assets different effective cutoff times. Label the stale valuation and apply a declared missing-data policy rather than letting an unavailable price look like a verified terminal sale.
For a continuing strategy, resetting each window to cash changes the experiment. Carry state under the declared protocol, or label each run as a fresh start; the walk-forward testing guide covers that distinction. Extending only an unfavorable endpoint until a position recovers changes the reported window. Preserve the original result and label later observations as a continuation.
Method and limits
This AI-assisted article uses primary engine documentation reviewed on 23 October 2026 and an original hypothetical cutoff reconciliation. Calculations were recomputed; no engine, market replay or live account was run. It examines research endpoints rather than operational DCA inventory reconciliation, tax accounting or available margin. A terminal valuation cannot reveal future natural exits, and a modeled sale cannot establish an actual fill.
