Time-Based Exit Backtest in Crypto: Fees, Slippage and Break-Even Costs
Exiting after a fixed number of bars is simple and testable. It also reveals whether a strategy's edge decays over time.
Short answer
A time-based exit closes each trade after N bars regardless of price (often alongside a stop). Testing several N values on the same entries shows how the average result evolves with holding time — an edge that peaks early and fades suggests short holds. On perps, longer holds add funding. Compute break-even cost per N and plot net average by holding time.
Break-even cost
| Item | Value (illustrative) |
|---|---|
| Trades | 200 |
| Gross avg per trade | +0.36% |
| Fees (2 × 0.05%) | −0.10% |
| Slippage (2 × 0.03%) | −0.05% |
| Net avg per trade | +0.21% |
| Break-even round-trip cost | 0.36% |
Edge by holding time
| Exit after | Net avg (illustrative) | Funding (perp) |
|---|---|---|
| 4 bars | +0.12% | ≈ 0 |
| 12 bars | +0.26% | Small |
| 48 bars | +0.19% | Larger |
Conclusion
Related: Trading-Journal Time-in-Trade: A Worked Crypto Example With Fees Included, Parabolic SAR Stop Backtest in Crypto: Fees, Slippage and Break-Even Costs.
Backtest the time-based exit rule with costs in ChartsPod.
Open the ChartsPod terminalCompute break-even cost per N and plot net average by holding time.
Compare Time-Based Exit Backtest in Crypto across Binance, Bybit, OKX and Hyperliquid markets.
Open markets in ChartsPodQuestions readers ask
Why test time-based exits?
To see how the edge evolves with holding time.
Does funding matter?
Yes, for longer perp holds.
Which N?
Test several on the same entries.
Sources and methodology
Backtest cost logic follows TradingView's Pine Script strategy documentation; indicator definitions are standard. All performance numbers are illustrative examples of the method, not results of real tests.
- TradingView Pine Script: Strategies — simulated fills and assumptions.
- TradingView Pine Script: Repainting — live vs historical calculation.
- ChartsPod documentation — guides for order flow, derivatives, alerts, backtests, journal and workspaces.
This article explains research tools and workflows. It is not financial advice, does not recommend buying or selling any asset and does not predict prices. Crypto derivatives carry a risk of rapid and total loss of margin.
CHARTSPOD EDITORIAL EDITION · RESEARCH AND EDUCATION ONLY · NOT FINANCIAL ADVICE.