Backtesting and paper trading
/theory tests an idea about price before you believe it. /paper shows
what following one would actually have done.
Almost every idea gets rejected. That is the design, not a fault — and the reasons it gives are more useful than the verdict.
How to state an idea
/theory drop BTC 5% +3% 5d
Read it as: after BTC falls at least 5% in a day, it gains at least 3% within five days.
Eight shapes. The word at the front picks one:
| Shape | Fires when | Example |
|---|---|---|
drop |
it falls at least X in one bar | drop BTC 5% +3% 5d |
rise |
it rises at least X in one bar | rise BTC 5% +3% 5d |
streak |
X lower closes in a row | streak BTC 3 +3% 5d |
weekday |
on a named day | weekday BTC mon +3% 5d |
below |
while X below its own running high | below BTC 20% +10% 30d |
uptrend |
while its recent average is clearly rising | uptrend BTC 50 +5% 30d |
downtrend |
while its recent average is clearly falling | downtrend BTC 50 -5% 30d |
sideways |
while its recent average is going nowhere | sideways BTC 50 +5% 30d |
The ending is always the same: how much it moves, and within how long.
Claiming a fall
The sign is the claim. +3% says the price rises; -3% says it falls.
/theory rise BTC 5% -3% 5d after a 5% pump, it drops 3% within five days
A falling claim is tested exactly like a rising one — same shapes, same floors, same fee bar, same tally. Only which of the two measured rates counts as your claim, and which as its opposite, changes.
This matters because "it broke support, it is going to keep falling" is the belief behind a panic sale, and it deserves the same measurement as the belief behind a purchase. On BTC since 2017 falling claims fare worse than rising ones, because a downward claim is fighting nine years of upward drift — which is itself worth seeing before acting on one.
Trends: up, down and sideways
"It goes up and down, but overall it has been rising for weeks." That is a belief about the average, not about any single day, so that is what Keel measures.
Keel compares the average of the last N closes with the average of the N closes before them:
- uptrend — the recent average is higher, by more than a band
- downtrend — the recent average is lower, by more than the band
- sideways — it is within the band either way
Every moment in history is exactly one of the three.
N is 20, 50 or 100 bars, and nothing in between. If you could pick any number, you could keep picking until one flattered you. On daily bars, 50 means fifty days; on hourly bars, fifty hours.
The band is fixed, and you do not choose it. A longer window moves further by itself, so the band is wider for longer windows and bigger bars:
| Bars | N = 20 | N = 50 | N = 100 |
|---|---|---|---|
| hourly | ±0.9% | ±1.4% | ±2.0% |
| 4-hour | ±1.8% | ±2.9% | ±4.1% |
| daily | ±4.5% | ±7.1% | ±10.0% |
With these bands, BTC since 2017 spent roughly a third of its time in each state.
The ending works as it does for every shape. sideways BTC 50 +5% 30d does
not ask whether it stays flat; it asks whether a flat stretch is followed by a
5% rise — the "breakout is coming" belief.
Expect "too few" on daily bars. A trend lasts weeks, and weeks inside one trend count as one occurrence, not many. Since 2017 BTC has had at most a few dozen separate daily trends, which is not enough to tell a pattern from luck. That is a real answer: the market has not offered enough separate several-week trends to know whether they carry on. Hourly and 4-hour trends have enough history to test.
A trend is only ever seen looking back. The past does not predict the future, and a trend can reverse at any time. Keel tells you how often a trend like this carried on before — nothing more. It will never tell you the market is in a trend; you state that, and Keel tests it.
Hours instead of days
Change d to h and everything is measured on hourly bars:
/theory drop BTC 3% +1% 6h falls 3% in an HOUR, gains 1% within six
/theory 4h drop BTC 5% +2% 24h four-hour bars
This matters because intraday is where the belief that costs people money actually lives. "It crashed, it'll bounce" is an hourly thought.
Narrowing it
/theory drop BTC 5% +3% 5d weekdays Monday to Friday only
/theory drop BTC 5% +3% 5d mon,wed,fri any days you name
/theory drop BTC 5% +3% 5d 2020-2023 one stretch of years
/theory drop BTC 5% +3% 5d 2020- from 2020 to today
A chosen stretch of years is always shown beside the whole-history figure. You can pick the window; you can never see it on its own. If you could, you would keep picking until one flattered you, which is the thing this command exists to argue against.
Narrowing also costs you sample. drop BTC 3% +1% 6h has 390 occurrences over
all history and 95 in 2020–2021 — few enough that Keel refuses to conclude
anything from it.
Why it is written down first
Keel writes your claim to a permanent, append-only log before it reads a single price. That ordering is the whole point.
An idea adjusted after seeing the answer is not a test, it is a story. By recording the claim first, Keel makes it impossible to quietly move the goalposts — including for itself.
Reading the verdict
The first line is the answer:
Not supported — it didn't lean up, it just got jumpier.
Then what happened, in counts out of 100, always beside an ordinary bar:
When this happened, it rose 3% about 55 times in 100.
On an ordinary day: about 45 times in 100.
But it also fell 3% about 49 times in 100 — on an ordinary day, 39.
Both went up. The market got livelier, not kinder.
That last line is the finding people miss. After a big drop, a 3% rise becomes more likely — and so does a 3% fall, by almost exactly as much. The condition did not predict a rise. It predicted movement. A test that looked only upward would have called that skill.
The four reasons it rejects things
| Reason | Means |
|---|---|
| too few | it has not happened enough separate times to tell a pattern from luck |
| no edge | once the matching fall is taken off, it leans almost nowhere |
| one stretch only | it worked in one span of years and not the other — describing those years, not the market |
| costs | the margin it buys is worth less than your own trading fees |
That last one is worth dwelling on. A theory can be entirely true and still lose money, because acting on it means buying and selling and the exchange takes a cut both times. Keel uses your measured fee rate, not a generic one.
The tally
Every idea you register counts, permanently. The more you try, the more likely one looks good by chance — like flipping coins until one lands heads five times in a row. So the bar rises with the count, and the screen tells you what your count is.
This is why there is no way to test an idea without registering it.
The three buttons
Under every verdict:
- Details — the figures the verdict was computed from.
- Does it hold everywhere? — the same idea over four fixed stretches of history, all four always shown. A rule that works in one era is describing that era.
- If you'd followed it — paper trading, below.
They are also reachable later: /theory list shows everything you have
registered, and tapping one reopens it.
Paper trading — /paper
What following the rule would actually have felt like. Nothing is traded and nothing here can overturn the verdict above it.
It exists because statistics hide the part that makes people quit. A 52% hit rate sounds survivable. Sitting through nine losses in a row does not.
Trades 202 Result -2.4%
Won 106 Without trading costs +41.6%
Lost 96 Just holding BTC +1,793.0%
Longest losing run 4
Deepest fall -32.6%
The rules are fixed and stated on the screen: entry at the close of the bar that fired, exit at exactly your gain or the same-sized fall, one position at a time, your own measured costs.
Every shape Keel ships loses to doing nothing, most by more than an order of magnitude. That table is the most persuasive thing this command produces, and none of it is an opinion.
Since you registered it
Below the history sits the same rule over only the bars that arrived after your claim was locked — the one stretch that cannot have been fitted to its answer, because you wrote it down before those bars existed.
It says nothing until there have been at least five trades. A daily idea fires about five times in ninety days, so for most of a watch this is a count and a shrug. That is the honest state, and often the finding: the idea you were confident enough to trade on does not happen often enough to matter.
The ninety-day watch
Registering an idea starts a watch. Each day Keel records whether the condition fired, and when ninety days are up it sends one summary: how many times, how many reached the gain, what following it would have done, and what the history before you registered it had said.
You can stop a watch at any time from /theory list. Stopping is recorded as
its own thing — giving up on an idea early is a behaviour, and the record is
about behaviour.
Four watches at once, maximum. The more you run in parallel, the more likely one looks true by chance, and a tally you cannot hold in your head stops working as a warning.