How It Works
- Compute %K — where the close sits inside the 14-bar high-low range, from 0 at the bottom to 100 at the top — and %D, its 3-bar average.
- Buy when %K crosses above %D while still below 20: price is pinned near the bottom of its recent range but has just started turning up, which is Lane's oversold reversal.
- Sell when %K reaches 80, the top fifth of the range.
Worked example. Over 14 bars the range is 90 to 110. A close at 94 puts %K at 20, and as it ticks up through %D the strategy buys. The recovery carries price to 108, %K prints 90, and the position is closed in the overbought zone.
The Math Behind The Indicators
Everything runs on closing prices of the traded timeframe: P is a close, Pt today's close, and N counts bars — one bar is one candle of that timeframe, so 20 bars on a 1h chart is 20 hours.
- Stochastic Oscillator (%K, %D)
- Where the close sits inside the recent high-low range, as a percentage: 0 means it closed at the very bottom of the last N bars, 100 at the very top. Because it measures position within the range rather than the size of price changes, it reads the bar's high and low directly. %K is that raw reading, smoothed slightly; %D is a 3-bar average of %K used as its signal line.
- %K = 100 · Pt − min(LN)max(HN) − min(LN), %D = SMA3(%K)
- Example: Over the last 14 bars the high was 110 and the low 90. A close at 95 gives %K = 100·(95 − 90)/(110 − 90) = 25 — near the bottom of the range. A close at 108 would give 90, close to the top.
Example Chart
Example Chart
The Metrics
| Metric | Calculation | What it shows |
|---|---|---|
| Price Change % | change = Plast − P0P0 × 100 The traded market's own close against its first close over the same window, as a percentage. | What the market did while the rule was running — the benchmark every other row here is read against. A rule that made 40% in a market that made 120% lost to doing nothing. |
| Trades | N = count(closed positions) How many positions the rule opened and closed over the window. | The sample behind every other figure, and what the fees are charged on. Two rules with the same return are not the same rule if one took nine trades and the other took nine hundred. |
| Win Rate % | W%n = winsnn × 100 Of the first n trades, how many closed above the cash they opened with after fees. Plotted trade by trade, so the line is the rate so far rather than a final figure. | How often the rule is right, which is not how much it makes. A rule can win a third of its trades and still lead, if the third it wins pays for the two it loses. |
| Cumulative P&L % | PnL%n = n∑i=1(fi − 1) × 100 Each trade's percentage result added up, net of fees. A sum rather than a compounding, so a 10% gain and a 10% loss cancel. | What the rule returned per trade, with position size taken out of it. It answers whether the edge is in the trades themselves, where the equity curve answers what the account did with them. |
| Equity | En = E0 n∏i=1fi The account compounded through every trade — the whole balance goes into the next position. Drawn net of fees as a solid line and gross of them as a dotted one. | The account itself, which is the only figure a reader actually ends up with. The gap between the two lines is what the fees took, and it widens with every trade rather than staying a fixed share. |
| Cumulative Fees | Fn = n∑i=1(Ci φ + Xi φ) Fee charged on the way into each position and again on the way out, at rate phi, on the capital actually committed — so the bill grows with the account as well as with the trade count. | The cost of trading, in the account's own units. It is the one line here that only ever rises, and the one a rule cannot trade its way out of. |
| Rolling Sharpe | Sharpet = mean(rdaily)sd(rdaily) × √365 Mean daily return over its deviation, annualized on a 365-day year because crypto has no weekend. Taken on the account marked to market every bar — open positions included, not just closed ones — and read off at each trade's exit. | Return per unit of the swing it took to get it. It is the heaviest weight in the composite score, because an account that doubled calmly and one that doubled violently are not the same result. |