// HOW THE BACKTESTER WORKS
The parts of a backtest that decide whether its number means anything
Any engine can replay candles and print a percentage. What separates a useful backtest from a flattering one is what it charges you, what it refuses to assume, and whether the data behind it was complete.
It charges each exchange's published maker and taker rates
Fees are applied per fill at the rate the exchange publishes, looked up from the pair's own quote currency where that matters. Bitkub is where it does: 0.25% on THB-quoted pairs and 0.10% on USDT-quoted ones, on the same exchange.
The result reports total fees paid on its own line, beside the return. A strategy that trades often can spend its entire edge on costs, and a backtest that hides the cost of trading inside a single net figure is the easiest way there is to be misled by your own tool.
Gaps in exchange history are detected, not papered over
History is downloaded a window at a time. On some exchanges a window that comes back with fewer candles than asked for means you have reached the start of that market. On others it means only that the window itself had holes in it. Reading the first meaning everywhere once turned a request for a year of Bitkub data into 104 days, and the short result was saved as though it were the full year, so the difference never showed again.
Each exchange is now marked as one kind or the other. The download continues from the start of the window it has just read, puts up with a limited run of empty windows, and refuses to save a download that ended on them. A backtest over a period the exchange cannot fully supply is worth knowing about rather than smoothing over.
Every bot type, with the same code the paper bot runs
Grid, DCA, dip-buy, signal and the Strategy Router all backtest, and each replays through the same decision logic as the paper bot you can start from the dashboard, rather than a simplified model of it.
That is why the router's direction gate, for example, exists in both in the same form: a backtest whose rules differ from the bot's is measuring a bot you cannot actually run. It also means the limits carry over honestly. A signal bot's volatility sizing is worked out from how widely prices are spread rather than from a candle-based ATR, in the backtest exactly as in the running bot.
What the result reports, and how sure it can be
A run returns starting and final equity, total return in currency and percent, maximum drawdown, the full trade list, the equity curve, and the fees paid. Beside them sits a Chance of Loss figure: the run's own closed trades are resampled many times, and it reports how often the total came out below zero.
That figure measures luck within the trades you got, nothing more. It cannot see a setup tuned too closely to one stretch of history, and the result card says so. A result from a past period describes that period. Nothing here presents one as a forecast.