DCA bot out-of-sample testing means freezing the complete deal rules before evaluating a later period that did not guide their selection. Measure the whole account, including unfinished deals, used capital and modeled costs. A test with profitable closed deals can still lose money when an open averaging position is included.
The difficult part is keeping two boundaries honest: the boundary between development and evaluation, and the boundary between closed deals and the positions still on the account. A DCA bot can look convincing when either boundary is blurred.
This guide concerns an unleveraged spot bot that adds purchases according to a predefined ladder. Futures need separate funding, margin and liquidation modeling; the cash example below does not cover those mechanics.
Freeze the whole deal, including its stopping rules
A fixed entry signal does not make a test independent if the researcher changes averaging distances after seeing the test. Save the base order, safety-order sizes and price anchors, maximum additions, take-profit calculation, stop rule, maximum concurrent deals, pair-selection and allocation policy and starting balance. Include any rule governing deal age or exhausted ladders. If the strategy uses trailing take profit, freeze its activation, tracked price and retracement rules too.
Also freeze the experiment: data source and interval, evaluation dates, fill assumptions, fees, treatment of missing candles and end-of-period valuation. Otherwise an unchanged bot can acquire a better-looking result through a revised simulator or a selectively extended date range.
There is fitting even when no machine-learning model exists. Choosing among several ladders using their historical outcomes is a development decision. Preserve those choices in a backtest trial ledger, then reserve later evidence for the chosen version.
Bailey and colleagues explain why an ordinary holdout does not account for the preceding search across investment strategies. An untouched period provides a useful evaluation boundary; it does not, alone, establish a probability that the strategy is robust. The Probability of Backtest Overfitting
Give each date block a written job
Here is an original example protocol, not a historical KLINEO test or a recommended split ratio. All boundaries are UTC. Assume the final period was reserved before its outcomes were examined.
| Block | Illustrative dates | Permitted use |
|---|---|---|
| Development | January 2023–June 2024 | Explore ladders, costs and entry rules; retain the trial record |
| Validation | July–December 2024 | Compare shortlisted versions and finalize the protocol; any influential result makes this development evidence |
| Final evaluation | January–June 2025 | Run the frozen version, report the declared metrics and preserve the result |
Before the final period begins, save a dated configuration and protocol identifier. The final run starts flat with its stated cash balance in this example. Earlier candles may initialize indicators if they were available at that time, but no inherited deal enters the account.
That evaluates a fresh start. An already-running bot needs a different, declared opening state: cash, holdings, pending orders, deal age and remaining ladder commitments. Do not join independently reset accounts and describe them as one continuous portfolio. For scheduled retuning, use a walk-forward protocol that explicitly carries the required account state.
Chronology also applies to indicator inputs. Freqtrade documents how whole-dataframe calculations can accidentally expose future information during backtesting. Freezing parameters does not repair such leakage. Its checks describe Freqtrade's implementation; another engine requires its own audit. Freqtrade lookahead-analysis documentation
If the final result prompts a wider ladder or a different coin list, keep the result and label that period as consulted. The new version needs later, unused evidence. Re-running the revised bot on the same dates is useful development work, but the period has influenced the selection.
Reconcile the unfinished deal before reading the win rate
Consider an entirely hypothetical six-month final evaluation. The account starts with $5,000, receives no deposits or withdrawals and runs the frozen spot rules. Twelve completed deals each contribute $40 after their modeled costs. One deal remains open, with 20 units acquired for a total cash outlay of $2,000, including its purchase costs. The declared terminal valuation price is $71 per unit.
| Account item at the fixed end time | Calculation | Amount |
|---|---|---|
| Net result of completed deals | 12 × $40 | +$480 |
| Cash spent on unfinished deal | Given aggregate outlay | −$2,000 |
| Remaining cash | $5,000 + $480 − $2,000 | $3,480 |
| Market value of unfinished holding | 20 × $71 | $1,420 |
| Marked account equity | $3,480 + $1,420 | $4,900 |
| Account change | $4,900 / $5,000 − 1 | −2.00% |
Reporting only the completed deals suggests $480 / $5,000 = 9.6%. That is a closed-deal contribution, not the account return. The unfinished holding has lost $580 relative to its cash outlay. Its loss exceeds the twelve completed gains.
The $4,900 figure marks the inventory; it does not assume a sale. If the protocol separately models an immediate sale at the same price with a hypothetical 0.10% selling fee and no slippage, the fee is $1.42 and ending cash is $4,898.58. Actual liquidation could differ. Keep marked equity and a modeled close-out result labeled separately.
Terminal handling varies by engine. Freqtrade, for example, documents forced exits at the end of its backtest period and separately identifies those trades in its report. That is an explicit accounting convention, not evidence that the strategy's normal exit occurred. Check the convention used by the report you are reviewing. Freqtrade left-open-trades reporting
Record what the last deal has not revealed
Suppose the unfinished example deal has used every averaging order and has been open for 31 days at the boundary. Its eventual recovery time is unknown. Do not record 31 days as a completed recovery duration, or remove the deal from duration statistics simply because it has not closed.
Report the elapsed age, used ladder orders, inventory value and remaining cash. Record the capital that the rules would require if other permitted deals opened. The DCA capital-requirements worksheet helps distinguish cash already spent from future commitments.
A useful evaluation also retains the marked equity path, peak-to-trough drawdown, peak capital deployed, missed entries caused by insufficient cash, and time spent with an exhausted ladder. State each definition and observation frequency. The terminal −2% alone does not tell us the worst loss suffered along the way.
Do not extend the window until that last deal rebounds and then present the new endpoint as the original test. You can observe later events as a separately dated continuation. Preserve the originally scheduled endpoint and its result. This is particularly relevant to the risk after a DCA bot's last buy.
Use a release card to decide what comes next
Complete this compact record before looking at the final result. Set research acceptance conditions from the question being tested; no universal return, trade-count or drawdown threshold fits every bot.
| Record | Question it must answer |
|---|---|
| Frozen version and access history | What was fixed, when, and which periods had already influenced it? |
| Opening account | Is this a fresh start or a documented continuing state? |
| End-of-period policy | How are unfinished holdings valued, and are modeled exits distinguished? |
| Full result | Do cash, inventory and every modeled cost reconcile? |
| DCA failure conditions | Were cash limits, exhausted ladders and unfinished deal ages retained? |
| Decision and next observation | Which predeclared condition failed or remains untested? |
A favorable result can support further investigation. A handful of short, profitable deals in one market regime supplies limited evidence about prolonged declines or long capital lockups. A later paper-trading comparison can examine whether the same rules make the expected decisions as data arrives, while live fill quality remains a separate uncertainty.
For KLINEO's published historical evidence, start with the stated backtest methodology. Do not infer that a selected preset has passed this article's untouched evaluation protocol without its dated configuration, access history and complete account record.
Method and limits
This article is AI-assisted synthesis of primary research and software documentation, with an original DCA evaluation protocol, account reconciliation and release card. All dates, trades and amounts in the worked example are invented. Arithmetic was recomputed; no market replay, exchange execution, statistical significance test or KLINEO preset validation was performed. The protocol helps identify what evidence supports a claim and what remains uncertain; it cannot remove trading losses.
