Skip to content

Research notes

A crypto backtest can win and lose on the same candle

One candle. Two opposite results. Follow the missing evidence from a simulated fill to the strategy-selection process.

One lime route branches into several muted paths with different endpoints.
Illustration for research notes; examples in this article are educational.

A crypto backtest is credible only within its stated data, execution and selection assumptions. Check when orders became executable, how ambiguous candles were resolved, which costs were deducted and whether evaluation data influenced the chosen strategy. A profitable chart cannot answer those questions by itself. The most useful review begins with one trade you can reconstruct.

Consider a report that shows a winning trade. Its entry, target and stop all look reasonable. Its candle data is accurate. Yet another simulator can use exactly the same candle and report a loss without either program making an arithmetic error.

The difference lives in an event the candle never recorded.

The missing fact inside a perfectly accurate candle

Here is a deliberately small illustration. It is invented for this article, not a historical KLINEO trade or an exchange execution record.

Before the candle begins, a simulated long position holds 10 units at $100 each. Its target is $102 and its stop is $98. Both exit instructions already exist. Assume a full fill at the selected exit price and immediate cancellation of the other instruction. Ignore slippage for this first calculation.

The next candle reports:

OpenHighLowClose
$100$103$97$101

Those four prices do not establish which exit happened first. Both of these paths fit them:

Possible intrabar pathFirst exit reachedGross P&LFees at 0.10% of each fillNet P&L
$100 → $103 → $97 → $101Target at $102+$20.00$2.02+$17.98
$100 → $97 → $103 → $101Stop at $98−$20.00$1.98−$21.98

The target calculation is 10 × (102 − 100) − 0.001 × 10 × (100 + 102) = 17.98. Changing only the first exit produces a $39.96 difference after fees. Nothing about the candle's closing price resolves it.

This is a real modeling issue, although the numbers above are ours. TradingView documents how its broker emulator infers historical price paths from chart bars and how lower-timeframe data can change simulated fills. That documentation describes TradingView's behavior; it does not establish the behavior of every backtest engine. TradingView strategy documentation

Ask the report's author for the rule applied to this collision. “Target first,” “stop first,” “lower-timeframe sequence” and “unresolved” are different answers. A conservative assumption can be useful for sensitivity testing, but it still does not reconstruct the actual sequence.

There is another clock to inspect: when the orders became active. If an entry signal needs the candle's final close, an exit earlier inside that same candle needs an explicit causal explanation. Record the signal timestamp, first permissible submission time and first permissible fill time separately. An attractive marker on a chart is not that explanation.

Replace one confident number with an evidence range

When both exits lie within a candle and finer data is unavailable, retain the uncertainty. Recompute the strategy with each defensible ordering, keeping the strategy settings fixed. Record the count of affected trades and the difference in final equity, drawdown and exits.

If a report turns unprofitable when ambiguous trades use the unfavorable ordering, the practical conclusion is that its profitability depends on unresolved fills. It is not evidence that the unfavorable ordering really occurred. If both versions remain profitable, the exercise has answered only this particular sensitivity question.

Lower-timeframe data can narrow the uncertainty. It cannot, by itself, establish queue position, execution latency or how much of an order would fill. Coinbase's order-management documentation explains that fills can be partial and market orders can execute at a less favorable price than the last trade. A candle touching a limit is weaker evidence than an actual fill record. Coinbase order management

This distinction helps separate a model limitation from a bug. A simulator that clearly discloses its fill convention is making a testable assumption. A report that conceals the convention is withholding evidence needed to interpret the result.

A small gross edge can disappear before funding

Costs deserve their own reconstruction. A line labeled “fees included” leaves too much unstated: which side, which rate, which filled value and which order type?

Take a separate hypothetical trade: buy 10 units at a reference price of $100 and sell at a reference price of $100.25. Both orders are modeled market orders. These are decision-time reference prices, not guaranteed execution prices or limit-order constraints. Assume a fee of 0.10% on each executed notional. Then test 0.05% adverse slippage on each side.

Cost caseBuy execution priceSell execution priceGross P&L after execution pricesTrading feesNet P&L
No fees or slippage$100.00$100.25$2.50$0.00+$2.50
Fees only$100.00$100.25$2.50$2.00250+$0.49750
Fees and adverse slippage$100.0500$100.199875$1.498750$2.002498750−$0.503748750

The last row follows directly from:

  • Buy execution: 100 × 1.0005 = 100.05.
  • Sell execution: 100.25 × 0.9995 = 100.199875.
  • Net P&L: 10 × (100.199875 − 100.05) − 0.001 × 10 × (100.05 + 100.199875).

These chosen rates are modeling inputs, not a quotation of your exchange's current fees or a prediction of actual slippage. The result excludes taxes, subscriptions, borrowing and funding. Slippage is already reflected in the execution prices; subtracting it again as a separate cash charge would double-count it.

For perpetual futures, add funding from the applicable contract's settlement history. Bybit documents funding as position value multiplied by the funding rate at settlement, with payment direction dependent on the rate's sign. Intervals vary by pair. A perpetual position may pay or receive funding; a spot backtest does not become a perpetual backtest merely by adding leverage to its displayed return. Bybit funding-fee calculation

For scale, an invented constant $1,000 position value charged a positive 0.01% at three settlements would cost a long position $1,000 × 0.0001 × 3 = $0.30. Real reconstruction uses each settlement's position value, signed rate and exposure. This calculation is separate from both trades above; neither supplies a funding schedule.

The strategy's history includes its rejected versions

A report can describe every fill correctly and still exaggerate the evidence for a strategy. The missing history may be the research process.

Suppose an analyst tries five lookback lengths, four entry thresholds, three stop distances and three exit rules. The grid contains 5 × 4 × 3 × 3 = 180 configurations before changing coins, dates or timeframes. Showing only the winner discards the context in which it was selected. Those 180 configurations are related; do not treat them as 180 independent experiments or calculate a false-discovery probability from the count alone.

Bailey, Borwein, López de Prado and Zhu examine this selection problem in The Probability of Backtest Overfitting. Their framework asks how strategies selected for strong in-sample performance behave out of sample. They also explain why a single holdout does not account for the number of trials already attempted. A clean-looking final chart is therefore insufficient to estimate the probability of overfitting. Read the research paper

An untouched evaluation period has a specific meaning: its results did not guide the final configuration. If disappointing results prompt a parameter change, keep that result and describe the period as having influenced development. Renaming a repeatedly consulted period “out of sample” does not restore its independence.

A practical review request is a dated configuration freeze, a list of attempted variants and a chronological evaluation record. Include unfavorable periods and report changes after each evaluation. Where rolling development is appropriate, keep a sequence of past-only fitting decisions followed by later tests. Do not repeatedly select the prettiest window. These are evidence requests, not a claim that a particular split guarantees robustness.

A worksheet that ends with a decision

Copy this table into the review record. “Not supplied” is a valid finding. Do not replace a missing measurement with a nearby number from a different run.

Review questionEvidence to attachDecision if it is missing or unfavorable
Which exact strategy was tested?Saved parameters, rule/version identifier, instrument, venue and datesReturn cannot be attributed to a reproducible configuration
Could the trade exist at that time?Signal availability, submission and fill timestampsInvestigate potential use of information before it was available
What happened when stop and target shared a candle?Collision count, ordering policy, available finer data and alternate-ordering resultsKeep profitability dependent on these fills unresolved
What was deducted?Per-fill execution prices, fee rates, fee assets and applicable funding ledgerTreat the advertised net result as unverified
What influenced strategy selection?Trial log, rejected variants and dated evaluation protocolDo not interpret the displayed winner as an isolated successful test
How much did the position lose while open?Marked equity series and peak-to-trough drawdownClosed-trade profit alone cannot describe the path of losses
What survives a reasonable assumption change?Same settings rerun under the declared stress casesInvestigate a result that depends on one favorable convention

Finish with one sentence that names the outstanding dependency: “The reported profit remains dependent on target-first fills in 12 unresolved candles,” for example. That number is illustrative, not a finding about KLINEO. A sentence this specific makes the next action obvious: obtain sequence evidence or run the declared alternative. “Looks robust” does neither.

Where KLINEO's published evidence fits

KLINEO's DCA modeled-cost and candle-quality research publishes an extraction from stored, fitted historical simulations. It is not a fresh independent market replay. The release includes selected presets; it does not reveal every strategy trial that may have preceded selection. Its published limitations explicitly leave intrabar uncertainty and live execution effects unresolved, and funding and liquidation are outside that spot study.

Use its downloadable source records to inspect the stated evidence, then use this worksheet to identify what remains unanswered. For the precise recorded fee model, data window and distinction between drawdown measures, read KLINEO's backtest methodology guide. A source checksum identifies an input; it does not validate the assumptions applied to it.

Moving from a historical report to a product run raises a separate question: what mode and engine will execute the saved rules? Check Virtual, testnet and Live modes and the workflow review and activation guidance before treating any run as comparable evidence. A different engine or saved graph needs its own verification. Trading can still produce losses after these checks; the risk disclosure describes risks a historical chart cannot remove.

Method and limits

This article is AI-assisted editorial synthesis of the linked primary documentation, research paper and KLINEO's published source material. The trade paths, costs, configuration grid and worksheet are original educational illustrations. Arithmetic was checked using decimal calculations. No historical market replay, exchange-order experiment or statistical overfitting estimate was performed for this article. The worksheet supports evidence review; it does not certify a strategy or recommend taking a trade.

Keep the context with the example.

Prepared with AI assistance by KLINEO Editorial. Each worked example is illustrative, with its sources and assumptions in the article. Read our editorial standards for authorship, verification and corrections.