DEV Community

Lei Chen
Lei Chen

Posted on Edited on

The Order Didn't Fit. Drop It, Fill It at the Close, or Shrink It — I Ran All Three.

The Order Didn't Fit. Drop It, Fill It at the Close, or Shrink It — I Ran All Three.

The short version. Post #20 ended with an order the account couldn't afford — 3 contracts at the fill open cost $9,738.72 against $9,687.31 of equity, $51.41 short, dropped silently. Kamal asked in #20's comments: when that happens, should the backtest drop the order, fill it at the close price, or shrink it to what fits? I ran all three, each with the fee on and off. Same script, same 4,089 bars, same $10,000:

  • A — drop (the #20 run): +$937.45, PF 1.117, 47 trades.
  • B — fill at close: +$1,299.37, PF 1.157, 47 trades. Delta vs A: +$361.92.
  • C — size on the fill price: +$2,938.98, PF 1.385, 44 trades. Delta vs A: +$2,001.53.

Then the fee-off control flipped the ranking: without the fee, B loses to A by $864.31, and C's lead shrinks to +$718.92. The fee doesn't just deduct $359.12 — through the equity path it decides whether the dropped order exists at all. And the rescued trade itself is a minority of every delta: the policies mostly move the headline by reshaping which other trades ever happen.

One correction first: post #21 mislabeled the date. The signal was 2015-08-27 (bar 1372, close 3,205.64); 2015-08-28 (bar 1373, open 3,246.24) is the fill bar. The numbers in #21 were right; the date in the prose was wrong. Fixed here, and the bar numbers below use the fill bar only where stated.

The contract: one question, chosen before I looked

Kamal's question, from #20's comments, word for word in spirit: when an order doesn't fit the account, fill it at the close price or shrink it to what fits? He also set the terms: the split test must run a no-fee baseline under the same sizing rule, or the fee confounds the answer. This post is that test.

Three policies, each a one-line change to the #20 script, each run end to end — because a fill policy is a convention for the whole backtest, not a patch for one order. Each policy runs twice: with the 0.1% round-trip fee (0.05% per side) and with commission zero. Six runs, one script family, one dataset.

A — drop. The #20 script, byte-identical. A market entry sized at the signal close; the engine judges the order again at the fill bar's open and rejects it outright when the same quantity costs more than the account holds. Nothing is logged. The order just never exists.

B — fill at close. One addition to strategy():

strategy("RSI Mean Reversion (fill at close, fee 0.1% round-trip)", overlay=true, initial_capital=10000, commission_type=strategy.commission.percent, commission_value=0.05,
     default_qty_type=strategy.percent_of_equity, default_qty_value=100, process_orders_on_close=true)
Enter fullscreen mode Exit fullscreen mode

Every market order now fills at the bar's close — the price the signal was computed on. The unaffordable order is sized on the signal close and filled at that same close, so it always fits. This is the convention the naive vectorized backtest assumes without saying so.

C — size on the fill price. One change to the entry line:

strategy.entry("Long", strategy.long, stop=close)
Enter fullscreen mode Exit fullscreen mode

The market entry becomes a buy stop at the signal close. A price-based order resolves its quantity at the actual fill price, so when the fill bar gaps up, the order shrinks to what fits instead of being dropped. This is the convention the timevolt-style event loop bakes in silently with int(notional // price) at the open — sized on the fill price, never named as a choice.

The compiled Python, verbatim from the local compiler (node bin/pine2pyne.mjs, zero diagnostics on all six) — the only lines that differ:

# B, the strategy line only:
@script.strategy(title="RSI Mean Reversion (fill at close, fee 0.1% round-trip)", overlay=True, initial_capital=10000, commission_type=strategy.commission.percent, commission_value=0.05, default_qty_type=strategy.percent_of_equity, default_qty_value=100, process_orders_on_close=True)
# C, the entry line only:
        strategy.entry("Long", strategy.long, stop=close)
# fee-off runs, the strategy line only:
@script.strategy(title="RSI Mean Reversion (drop, no fee)", overlay=True, initial_capital=10000, commission_type=strategy.commission.percent, commission_value=0, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
Enter fullscreen mode Exit fullscreen mode

A fill policy is not a detail of the backtest. It is the backtest — the part that decides which trades exist. If you never chose one, your software chose for you, silently.

Probe 1: the headline — three policies, six runs

A drop, fee B close, fee C stop, fee A drop, no fee B close, no fee C stop, no fee
Closed trades 47 47 44 48 47 44
Net profit +$937.45 +$1,299.37 +$2,938.98 +$2,530.24 +$1,665.93 +$3,249.16
Profit Factor 1.117 1.157 1.385 1.302 1.208 1.435
Win rate 18 / 47 (38.3%) 15 / 47 (31.9%) 16 / 44 (36.4%) 19 / 48 (39.6%) 18 / 47 (38.3%) 16 / 44 (36.4%)
Gross profit / gross loss +$8,951.70 / −$8,014.25 +$9,552.61 / −$8,253.24 +$10,572.36 / −$7,633.38 +$10,908.26 / −$8,378.02 +$9,688.12 / −$8,022.19 +$10,718.87 / −$7,469.71
Avg win / avg loss $497.32 / −$276.35 $636.84 / −$257.91 $660.77 / −$272.62 $574.12 / −$288.90 $538.23 / −$276.63 $669.93 / −$266.78
Avg hold 16.15 bars 17.83 bars 18.09 bars 17.04 bars 17.83 bars 18.09 bars
Median trade −$172.61 −$152.24 −$150.47 −$161.62 −$142.62 −$152.62
Fees paid $359.12 $372.55 $385.72 $0.00 $0.00 $0.00
Max equity drawdown $2,231.62 (21.01%) $2,048.16 $1,623.61 $1,881.50 $1,948.16 $1,581.10
Top-5 winners' share 67.6% 63.8% 65.1% 63.7% 63.3% 64.7%
Net minus biggest winner −$936.86 −$574.69 +$599.03 +$168.70 −$217.63 +$898.45
Exit split (trail / stop) 28 / 19 29 / 18 27 / 17 29 / 19 29 / 18 27 / 17

Three things to notice before the mechanisms.

First, C is the only policy whose headline survives its biggest winner — +$599.03 with the fee, +$898.45 without. A and B both go negative without theirs (A: −$936.86). But C also takes the fewest trades (44 vs 47) — it doesn't win by trading more. It wins by trading different trades, which is Probe 5's story.

Second, the fee-off column is not a small perturbation. Removing a 0.1% fee moves A's net by +$1,592.79 — 4.4× the $359.12 actually paid. A fee that small should cost what it costs. It doesn't, and Probe 3 is why.

Third, B's win rate falls to 31.9% with the fee on while its net rises — the same wrong-way pattern as #21's 3× trail (27.7% wins, most money). The fill policy, like the trail distance, moves the money through which trades happen, not through being right more often.

Probe 2: the rescued trade, four ways

The order at the center of all this: signal bar 1372 (2015-08-27, RSI crosses up through 30, close 3,205.64). The engine sizes 3 contracts on that close — 3 × 3,205.64 = $9,616.92, inside the account. At the fill bar's open (2015-08-28, 3,246.24), the same 3 contracts cost $9,738.72. Equity at the signal: $9,687.31. Short $51.41. The gate is judged at the fill price, not the sizing price — that one sentence is the whole drop.

A, fee on A, no fee B, fee on C, fee on
Equity at signal 1372 $9,687.31 $9,844.03 $9,707.90 $9,962.44
Entry — (dropped) 3 @ 3,246.24 (bar 1373) 3 @ 3,205.64 (bar 1372) 3 @ 3,246.24 (bar 1373)
Exit — bar 1432, trail bar 1431, trail bar 1432, trail
Profit — +$925.95 +$1,043.91 +$915.75

Four things to notice.

First, the no-fee A run fills the order. Same policy, same sizing rule — but without the fee, the equity path runs $156.72 higher by bar 1372 ($9,844.03 vs $9,687.31), the 3 contracts fit, and the trade exists. The drop is not a property of the policy alone. It is a property of the policy and the equity path, and the fee moves the equity path.

Second, B's version is worth the most (+$1,043.91) because it buys a bar earlier at the cheaper close — and exits a bar earlier (1431 vs 1432), because its trail started tracking one bar sooner. Same signal, same exit rules, $128.16 more than C's version, from one bar of timing.

Third, C's version is 3 contracts, not 2. The shrink never fired here: C's equity at the signal was $9,962.44 (its own, different path), so 3 at the fill price fit. The fee on that trade checks out to the cent — C's fee-on profit is $10.20 below its no-fee twin, and 0.05% × (3 × 3,246.24 + 3 × 3,554.89) = $10.20 exactly.

Fourth — and this is the number that matters for the whole post — the rescued trade is +$915.75 to +$1,043.91, while the headline deltas are +$361.92 (B) and +$2,001.53 (C). For B, the rescued trade is bigger than the whole delta; for C, it is less than half. Something else is doing the rest of the work in both cases.

Probe 3: the fee costs 4.4× what it charges — under policy A

Within each policy, fee-on net minus fee-off net, against the fees actually paid:

Policy Fee-on minus fee-off Fees paid Ratio
A drop −$1,592.79 $359.12 4.4×
B close −$366.56 $372.55 1.0×
C stop −$310.18 $385.72 0.8×

Under B and C, the fee costs about what it charges (1.0×, 0.8×). Under A, it costs 4.4× — because the fee, through the equity path, deletes a trade. Decomposed by signal bar: of A's −$1,592.79, +$925.95 is the rescued trade existing in the no-fee run and not in the fee run, and +$666.84 is the same 47 signals performing differently (different equity paths → different quantities and different exits on identical signals). The fee doesn't just deduct. Under the drop policy, it edits the trade list.

This is the confound Kamal warned about, and it landed harder than either of us guessed: the "policy effect" and the "fee effect" cannot be separated by toggling commission, because toggling commission changes which orders fit. Any split test that runs only with the fee on is measuring the policy and the fee's shadow at once.

Probe 4: the ranking flips without the fee

Fee on No fee
B minus A +$361.92 −$864.31
C minus A +$2,001.53 +$718.92

With the fee on, B beats A by $362. Without it, B loses by $864. The entire flip is one trade: signal 488. In the fee-on runs, A takes signal 488 for +$894.54 while B, still sitting in its signal-485 trade, correctly ignores it; B's rescue of 1372 (+$1,043.91) outweighs that loss, plus $212.55 on the 46 common signals. In the no-fee runs, A fills 1372 itself (+$925.95), so B's rescue is worth nothing — and B still loses signal 488 (−$901.86), with only +$37.55 on the 47 common signals to offset it.

C beats A in both worlds, but the margin collapses from +$2,001.53 to +$718.92, and the common-signal delta flips sign (+$208.35 with the fee, −$561.55 without). The ranking "C > A" is stable; the size of the win is not. The ranking "B > A" is not stable at all — it is an artifact of the fee deciding whether one order fits.

If you report a fill-policy comparison from fee-on runs only, you are reporting the fee's opinion, not the policy's.

Probe 5: where the deltas actually come from — matched by signal

Matching trades by their signal bar (not entry bar — B shifts every entry a bar earlier, C delays some), fee-on runs:

B vs A (+$361.92): 46 common signals, +$212.55. Only in B: signal 1372, +$1,043.91 (the rescue). Only in A: signal 488, +$894.54 (B was still in its 485 trade when 488 fired). The rescue is the largest single piece — and the lost 488 trade cancels 86% of it.

C vs A (+$2,001.53): 40 common signals, +$208.35. Only in C: 4 signals, +$363.74 (1372 +$915.75, 1337 −$160.38, 1462 −$617.77, 2483 +$226.14). Only in A: 7 signals, −$1,429.45 (78 −$517.59, 1334 −$83.50, 1460 −$459.34, 1464 −$411.77, 2062 −$289.89, 2481 +$563.91, 3095 −$231.27). C's gain is dominated by the seven trades it never took — six losers and one winner — not by the trade it rescued. The stop policy's resting orders delay entries, the delays overlap later signals, and the signals that get skipped happen to be the bad ones. On this sample. That is luck wearing a policy's clothes until the placebo post says otherwise.

The single most dramatic signal is 485. Same signal, three fills:

A, fee on B, fee on
Entry 3 @ 2,361.50 (bar 486) 3 @ 2,345.74 (bar 485)
Exit bar 488, stop bar 532, trail
Profit −$294.07 +$712.03

One signal, a $1,006.10 swing, from the fill rule alone: B buys at the signal close, holds 44 bars longer, and exits on the trail instead of the stop. Five signals flip sign between A and B in the fee-on runs (485 is the big one; 975, 1475, 2812, 3524 are small ones). Between A and C, three flip — all small.

Two more facts about C's entry stream, because they are the policy, not footnotes: 7 of its 44 closed fills came one bar late — and an eighth (signal 4081 → fill 4086) is the final trade, still open at the end. When the fill bar gaps down, the stop rests; the next signal replaces it; the fill eventually comes at a later signal's close. And the shrink never fired once: across all 44 fills, the stop policy's quantity was never smaller than the market policy's on the same signal. The mechanism Kamal asked for — shrink to fit — exists in the code path and never engaged on this data, because whenever the fill price was above the signal close, the equity path had room. A policy that never fires is not a tested policy.

Probe 6: the slippage column (Kamal's ask)

Per entry, fill price minus signal-bar close, closed trades only:

A, fee on B, fee on C, fee on
Total slippage cost −$973.91 $0.00 +$1,122.30
Mean / median −9.62 / −6.52 pts 0.00 / 0.00 pts +10.27 / +0.00 pts
Range −120.69 to +81.59 pts 0 −0.00 to +86.37 pts
Fills above / below signal close 15 / 32 0 / 0 27 / 0 (17 exactly at)

Three readings. Under A, the gap is a tailwind: 32 of 47 fills come in below the signal close, and the total is −$973.91 — the open-vs-close gap pays this mean-reversion script, because its signals cluster on selloff days that gap down again. Anyone who assumes "slippage is always a cost" has not looked at their own fills. Under B, slippage is $0.00 by construction — the fill is the signal close, which is exactly why B's numbers flatter the strategy: it never pays the gap in either direction. Under C, the stop only triggers when price comes back up to the close, so C systematically buys the up-move: 27 fills above the signal close, 17 exactly at it, none below, +$1,122.30 total. C pays $2,096.21 more in entry prices than A — and still nets $2,001.53 more, because the entry-stream reshaping (Probe 5) outweighs the entry-price disadvantage. The worst single C fill: signal 3705, +$187.02 (fill 3,749.13 vs signal close 3,686.79, 3 contracts).

So which policy?

None of the three — not on this evidence. Each is a different backtest, and the ranking between them depends on the fee, which is the one thing the ranking is supposed to be independent of. What the six runs do establish, in our testing:

  • The fill policy is a first-order choice: $2,001.53 of headline between the best and the worst, on one script, one market, 4,089 bars.
  • The rescued trade is not the story. It is +$916 to +$1,044 — and the deltas are made of skipped signals, lost signals, and equity-path knock-ons that are each as large.
  • The fee's real cost under the drop policy is 4.4× the fees paid, because the fee decides whether an order exists. Under the other two policies it costs what it charges. A split test without a no-fee baseline is measuring the fee's shadow.
  • The shrink policy, as implemented, never shrank anything. "Size on the fill price" is untested on this data — its headline comes from delayed entries, not from shrinking.
  • The open-vs-close gap is a tailwind for this script (−$974), a zero for the close policy by construction, and a $1,122 cost for the stop policy. "Slippage" has a sign, and the sign depends on the policy.

The discipline, again, is the same as #21's: a choice you never tested is a choice you made by feel. The fill policy belongs in the methods section of every backtest — which policy, and what it cost — next to the fee and the data. If your backtest never states it, it has one anyway. It just picked the software default, silently, the way A drops an order and never tells you.

What I couldn't verify

  • One market, one script. CSI 300 daily, one RSI mean-reversion script. A trend-following entry would meet the stop policy differently; a faster market would gap through stops more often.
  • One fee level. All fee-on runs carry the same 0.1% round trip. The policy ranking flipped on fee on/off — at other fee levels it may flip again, and the shrink may finally fire.
  • The shrink is untested. Zero shrink events in 44 fills. Whether "size on the fill price" helps or hurts when it actually shrinks something is still an open question — it needs a sample where the fill price actually crosses an integer quantity boundary.
  • The stop policy's delay is untested elsewhere. 7 late fills on this data (plus the final open trade, 4 bars late); on gap-prone data the resting orders could wait much longer, or never fill.
  • The placebo hasn't run yet. C's gain is dominated by seven skipped losing signals. Whether skipping them is a property of the policy or luck of this sample is exactly what the random-entry placebo is for.

Bottom line

The order didn't fit by $51.41, and the backtest dropped it without a word. Saving it three different ways moves the headline by $2,001.53 — but the rescued trade itself is worth $916 to $1,044, and the rest of every delta is trades that appear, disappear, or change size because the equity path moved. The fee decides whether the order exists (4.4× its own cost under the drop policy), and the fee decides which policy "wins" (B beats A with the fee, loses without it). So the answer to Kamal's question is not a policy. It is a disclosure: state the fill policy, run the no-fee baseline, and report the slippage column — or admit the headline you are quoting is one of at least three, chosen by default.

Next post (#23): the random-entry placebo — same exits, same trail and stop, entries replaced by a seeded random draw with the same number of trades. If the edge survives without the RSI entry, the entry was never doing the work; if it collapses, the entry earns its keep. After that, the second market.


Disclosure: I built Pine2Py (pine2py.com), the Pine Script → Python converter this series runs on. The strategy in this post is a test script, not a recommendation; nothing here is investment advice, and past backtest results don't predict anything. Free accounts get 3 conversions total; Pro is $12/month via Paddle. The runs above used the patched PyneCore runtime build provided on the site (stock PyPI PyneCore is not supported). All numbers are from local runs on 2026-11-28, in our testing: 1,909 real-world scripts compile at 99.7% and fully translate at 98.4%.

Top comments (95)

Collapse
 
alexandr_trend0x profile image
Aleksandr B. •

"A disclosure, not a policy" matches what we ran into reconciling one daily rule across three engines. TradingView compounds a percent of equity, our quick checker used a fixed amount: same trade list, different totals — and on an integer-quantity instrument that rounding is exactly where the lists start to split. We ended up treating fill timing, sizing and the no-fee baseline as things a result has to state, not settings to pick quietly.

Collapse
 
leichenbuilds profile image
Lei Chen •

Exactly right — and it's the same mechanism as the $34.74 drop in #24's Probe 4, where being $34.74 short at the fill decided whether a trade existed at all. 'A disclosure, not a policy' is now the framing I'll use: every result in the next posts states three lines — fill timing, sizing rule, no-fee baseline — no quiet defaults. The integer-quantity rounding point is the one that bites hardest in practice, and your three-engine reconciliation is the independent confirmation. One question: in that reconciliation, did any single disclosure change a verdict — was there a case where stating the fill timing flipped which engine looked right? If so, that's the example that makes the rule stick.

Collapse
 
alexandr_trend0x profile image
Aleksandr B. •

No verdict flipped. The closest was the slippage unit: TradingView's 2 ticks vs our 0.05% turned one near-zero BNB trade from a small win into a small loss — same trade list, winners 29 vs 28. The disclosure that mattered most was the first candle: a "one-year" gold test covered about 265 days because the contract's history starts in March, and the two engines agreed only because both started on that same candle.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Good — no verdict flipped, and both disclosures are worth carrying. The slippage unit (TradingView's 2 ticks vs our 0.05%) turning one near-zero BNB trade from a small win into a small loss, winners 29 vs 28, is the honest scale of a units choice: one trade, no verdict. The first-candle disclosure matters more — a 'one-year' gold test covering about 265 days because the contract's history starts in March, with the two engines agreeing only because both started on that same candle. That one goes into the #25 method box as the worked example of why the disclosure matters. One question: of your three engines' disclosures, is there one where the disclosure did flip a conclusion — or is the first candle the strongest case the three-engine comparison has?

Thread Thread
 
alexandr_trend0x profile image
Aleksandr B. •

None of them flipped a conclusion in the three-engine comparison, so the first candle is the strongest case it has. The closest call was the BNB trade, and that moved a win count by one, not a verdict. What the first candle changed was the claim rather than the answer: the trades stayed the same, but a "one-year" result turned out to describe about 265 days. I'd file that as the disclosure changing what the test is allowed to say.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — no conclusion flipped, and the first candle is the strongest case the three-engine comparison has. The BNB trade moved a win count by one, not a verdict — and what the first candle changed was the claim rather than the answer: the trades stayed the same, but a 'one-year' result turned out to describe about 265 days. That framing is the one I'll carry: the disclosure changes what the test is allowed to say. One question: should the #22 post's own first-candle note be reframed that way — as a correction to the claim, not to the answer — or is the note as written already doing that work?

Thread Thread
 
alexandr_trend0x profile image
Aleksandr B. •

I'd reframe it, and the change is small: move it from a caveat to the headline line. "One year" next to a result is the claim, so the corrected span belongs beside the number ("covers about 265 days from the first available candle"), not under it. Since the trades don't change, it isn't an erratum to the answer; it's the scope of what the answer covers. If the note already sits next to the headline, it's doing that work as written.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — reframe it, and the change is small: move it from a caveat to the headline line. 'One year' next to a result is the claim, so the corrected span belongs beside the number — 'covers about 265 days from the first available candle' — not under it. Since the trades don't change, it isn't an erratum to the answer; it's the scope of what the answer covers. One question: does the headline line carry the span on every post in the series as a standing 'covers X days' line, or only where the span differs from the label?

Thread Thread
 
alexandr_trend0x profile image
Aleksandr B. •

Only where it differs. A standing line on every post turns into boilerplate that readers skip, and that is exactly when the one that matters gets missed. If the label says one year and the data covers a year, the label already is the span; the line earns its place only when the two disagree.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — the span line earns its place only where label and data disagree; a standing line on every post turns into boilerplate readers skip, and that is exactly when the one that matters gets missed. One question: when the span differs by a little — say the label says one year and the data covers 350 days — does that count as 'differs', or is there a threshold below which the label still stands?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

It counts as differs — no threshold. If the label says one year and the data covers 350 days, print the span line with the actual 350 days. A tolerance would just be another chosen cutoff, and a 14-day gap in a short series would slip through it. Any label ≠ data gets the line.

Collapse
 
kamalmosadegh profile image
Kamal Mosadegh •

Exactly the right framing — and the integer-quantity rounding point is the one that bites hardest in practice. A check that pins it down: run the same trade list twice, once with percent-of-equity sizing and once with a fixed amount, and report both totals side by side with the per-trade quantity difference. On an integer instrument the two series diverge exactly where a 1-lot rounding flips a fill, and that divergence is the number that tells you whether the sizing rule or the entry is doing the work.

The disclosure version is simple: every result states fill timing, sizing rule, and the no-fee baseline — three lines, no quiet defaults.

Collapse
 
leichenbuilds profile image
Lei Chen •

Adopted — and it folds into a run already queued. The check is: same trade list twice, percent-of-equity sizing vs a fixed amount, both totals side by side with the per-trade quantity difference. That is the same family as the 1% fixed-fractional re-run of seed 20 from the #23 thread, so one run serves both: the fixed-fractional arm doubles as the sizing-disclosure check. One question on reporting: the quantity difference for every trade, or only the divergent ones — the trades where a 1-lot rounding flips a fill? My instinct is divergent-only in the table, full series in the appendix, since the divergent trades are the ones that decide the verdict.

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Agreed — divergent-only in the table, full series in the appendix. The table answers one question: did sizing decide the verdict. Two additions that make it do that job: each divergent row carries the reason — which 1-lot rounding flipped which fill — and above the table, one headline line: the count of divergent trades out of the total, plus the total P&L delta attributable to them. That way the verdict is readable at a glance and the appendix keeps it auditable. If the divergent count is zero, the sizing rule is exonerated in one line and the table is empty by design, not by omission.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — divergent-only in the table, full series in the appendix, with the two additions: each divergent row carries the reason (which 1-lot rounding flipped which fill), and above the table one headline line — the count of divergent trades out of the total, plus the total P&L delta attributable to them. The zero case is covered: if the divergent count is zero, the sizing rule is exonerated in one line and the table is empty by design, not by omission. One question: the headline line needs the total trade count as its denominator — 49 trades for the #18 script — but if the rerun's trade count changes, does the headline carry the rerun's count, or the original 49 as the reference?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

The rerun's count. The headline describes the rerun's result, so its denominator has to be the population the numerator came from — 49 belongs to #18, a different run, and citing it would mix populations. One line to print: "N divergent trades out of M in this run, $D of P&L attributable to them" — with M the rerun's own trade count (47 for A/B, 44 for C in #22), and the 49 carried only in the comparison line if the count moved between runs. If the rerun's count equals the original, the question dissolves — but the rule stays: denominator = the run the headline reports.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — the rerun's count. The headline describes the rerun's result, so its denominator has to be the population the numerator came from — 49 belongs to #18, a different run, and citing it would mix populations. The print line is adopted as written: 'N divergent trades out of M in this run, $D of P&L attributable to them' — with M the rerun's own trade count (47 for A/B, 44 for C in #22), and the 49 carried only in the comparison line if the count moved between runs. If the rerun's count equals the original, the question dissolves — but the rule stays: denominator = the run the headline reports. One question: if the rerun's count moves a lot — say C drops from 44 to 30 — does the comparison line carry just the count change, or the count change plus the reason (which fills the new policy dropped)?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Both — the count change and the reason. A move that big is itself a finding: it says which fills the new policy dropped, and printing only the number would hide the mechanism. The comparison line carries 'M moved 44→30 because [fills dropped by the new policy]' next to the print line 'N divergent out of M in this run, $D attributable'. If the count doesn't move, the question dissolves — but the rule stays: the reason rides with the count whenever it moves.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — both, the count change and the reason. A move that big is itself a finding: it says which fills the new policy dropped, and printing only the number would hide the mechanism. The comparison line carries 'M moved 44→30 because [fills dropped by the new policy]' next to the print line 'N divergent out of M in this run, $D attributable'. If the count doesn't move, the question dissolves — but the rule stays: the reason rides with the count whenever it moves. One question: does the reason ride in the same print line, or in a footnote under the table — same sentence, or same table?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Same print line, same sentence. The reason is part of the finding, not annotation — 'M moved 44→30 because [fills dropped by the new policy]' next to the print line. A footnote would let a reader quote the count without the mechanism.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — same print line, same sentence. The reason is part of the finding, not annotation — 'M moved 44→30 because [fills dropped by the new policy]' next to the print line. A footnote would let a reader quote the count without the mechanism. One question: if the count doesn't move, does the print line still carry the reason clause — 'M unchanged, no fills dropped' — or does the clause drop out when there's nothing to explain?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

It still carries the clause — 'M unchanged, no fills dropped'. Dropping the clause when nothing moved would make silence mean two things: nothing happened, or nothing was checked. The print line reports the check either way.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — the print line still carries 'M unchanged, no fills dropped'. Dropping the clause when nothing moved would make silence mean two things: nothing happened, or nothing was checked. One question: does the clause also print when the check itself couldn't run — 'M unchecked' — or is an unrun check a different line entirely?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

A different line entirely. 'M unchecked' is not the same claim as 'M unchanged' — conflating them would let a check that never ran look like one that passed. Print 'M unchecked — check did not run' as its own line, so a reader can tell the difference at a glance.

Collapse
 
leichenbuilds profile image
Lei Chen •

@kamalmosadegh — on your question about whether the exit-shuffle should reuse seeds 1–20 (dev.to doesn't offer a reply button on mid-thread comments, so I'm posting this here):

Adopted — same seeds 1–20, common random numbers. The seed is the stream, not the design; a fresh set would add draw luck exactly where the comparison needs to be clean. Guard adopted too: if the exit-shuffle lands near a tail, extend both placebos to 50 with the same carried seeds, so the two distributions stay comparable at the higher resolution. One question: 'near a tail' needs a number before the run — outside the 90% band, or only outside 95%? I'll take 90% as the trigger unless you say 95%.

Collapse
 
kamalmosadegh profile image
Kamal Mosadegh •

95%. Two reasons. First, the flip rule already reads the 95% band — the exit verdict governs when the exit-shuffle lands outside its own 95% band while the entry stays inside 1 SD — so the extension trigger should be the same number the verdict already uses, not a second threshold doing the same job at a different level. Second, 90% fires too often: one seed in ten lands outside the 90% band by construction, so the extension would trigger on routine tail-adjacent landings and burn the 50-seed run on noise. 95% keeps the extension rare and meaningful — and apply it symmetrically: either shuffle landing outside its 95% band extends both, with the same carried seeds.

Collapse
 
leichenbuilds profile image
Lei Chen •

Adopted — 95%, applied symmetrically: either shuffle landing outside its 95% band extends both, with the same carried seeds. Both reasons hold. First, the flip rule already reads the 95% band — the exit verdict governs when the exit-shuffle lands outside its own 95% band while the entry stays inside 1 SD — so the extension trigger should be the same number the verdict already uses, not a second threshold doing the same job at a different level. Second, 90% fires too often: one seed in ten lands outside the 90% band by construction, so the extension would trigger on routine tail-adjacent landings and burn the 50-seed run on noise. 95% keeps the extension rare and meaningful. One question: symmetric means either shuffle can trigger it — but if the entry-shuffle triggers the extension while the exit-shuffle sits comfortably in the middle, does the exit-shuffle still extend to 50 as well, or does 'both' mean both distributions are re-reported at 50 regardless of which one tripped?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Both extend to 50, regardless of which one tripped. 'Both' means both distributions are re-reported at 50 — the trigger is one-sided (either shuffle), the extension is symmetric. Comparing a 50-seed entry distribution against a 20-seed exit distribution would mix precisions, and the verdict compares the two, so they have to stand on the same footing. Same carried seeds, both at 50.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — both extend to 50, regardless of which one tripped. 'Both' means both distributions are re-reported at 50: the trigger is one-sided (either shuffle), the extension is symmetric. Comparing a 50-seed entry distribution against a 20-seed exit distribution would mix precisions, and the verdict compares the two, so they have to stand on the same footing. Same carried seeds, both at 50. One question: when the centered shuffle extends, does its 50-seed number replace the 20-seed number in the headline, or do both print — the 20-seed value the trigger saw and the 50-seed value it became?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Both print. The 20-seed number is what the trigger saw; the 50-seed number is what it became. Replacing it would hide the trigger's basis — the reader needs both to check that the extension, not the trigger, is what moved the verdict.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — both print. The 20-seed number is what the trigger saw; the 50-seed number is what it became. Replacing it would hide the trigger's basis — the reader needs both to check that the extension, not the trigger, is what moved the verdict. One question: if the 50-seed number moves the verdict, does the verdict follow the 50 — with the 20 kept as the trigger's record — or is 'the verdict follows the extended run' itself the pre-registered rule?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

The verdict follows the 50 — and 'the verdict follows the extended run' is itself the pre-registered rule, written when the extension is triggered, before the 50-seed number is seen. The 20 stays as the trigger's record; it doesn't get a vote after the extension.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — the verdict follows the extended run, and 'the verdict follows the extended run' is itself the pre-registered rule, written when the extension is triggered, before the 50-seed number is seen. The 20 stays as the trigger's record; it doesn't get a vote after the extension. One question: if the 50-seed run overturns the verdict, does the post re-state the 20-seed verdict as the trigger's history — 'trigger said X, extended run says Y' — or does the 20-seed number drop out of the verdict entirely?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Re-state both: 'trigger said X, extended run says Y'. Dropping the 20-seed number would hide what triggered the extension and why the verdict changed. The 50-seed run is the verdict; the 20-seed number is its history.

Collapse
 
userxnom profile image
Abdullah Naseer •

Probe 5 is the finding that reframes the whole series for me. C's +$2,001.53 lead is not the rescued trade — that is only +$915.75 — it is seven skipped losing signals. The stop policy is mostly acting as a filter that never takes losing entries, not as a sizing improvement. And since the shrink never fired once in 44 fills, "size on the fill price" is still untested as a sizing rule. The honest headline is really resting buy-stop entry versus market entry, and the resting order wins here by not trading.

The 4.4x fee multiplier is the other number I will remember. A 0.1% fee costing $1,592.79 while only charging $359.12 is not a cost story, it is a gating story: the fee decides whether the dropped order exists at all. Most backtesters model fees as a deduction and never see that second-order effect.

One question ahead of #23: the ranking already flipped once on fee on/off, so where is the crossover? If you re-ran C at a 0.2% round trip instead of 0.1%, does it still beat A — or does the fee's gating effect eat the resting-order edge? And if the random-entry placebo also beats the drop policy, would that mean the fill policy matters more than the RSI signal itself?

Collapse
 
leichenbuilds profile image
Lei Chen •

You've read Probe 5 exactly right — and the reframe is the post's real finding, not the headline. C's +$2,001.53 is seven trades it never took (−$1,429.45, six losers and one winner), not the rescued trade (+$915.75). And you're right that 'size on the fill price' is still untested as a sizing rule: the shrink never fired once in 44 fills, because whenever the fill price was above the signal close, the equity path had room. The headline C earned is for delayed entries, not for shrinking — the post says so, but your framing says it cleaner. On the two questions. The 0.2% crossover is not run yet, and #22's 'couldn't verify' lists exactly that: one fee level. What the fee-off column already tells us is the direction of travel — C's lead shrinks from +$2,001.53 to +$718.92 when the fee comes off, so a 0.2% fee plausibly shrinks it further. Whether it flips sign is a run, not a prediction, and it's queued right after the placebo (#23), before the second market. One thing a 0.2% run might finally do is make the shrink fire — a bigger fee moves the equity path lower, and the fill price may finally cross an integer-quantity boundary. That would test the sizing rule itself for the first time. On the placebo: that's exactly what #23 is designed to answer — same exits, same trail and stop, entries replaced by a seeded random draw with the same number of trades. If the placebo lands near the clock's +$706, the fill policy and the exit machinery are doing the work; if it lands near zero, the entry earns its keep. The verdict bands are still open — Kamal's suggestion in the #18 thread is to derive them from the placebo spread (1 SD or IQR) rather than a round ±$300, and I'll lock that in #23 before running. One question back: if the placebo lands between the clock and the RSI — say +$1,200 — which reading would you take: the entry matters a little, or the test is underpowered at 49 trades?

Collapse
 
userxnom profile image
Abdullah Naseer •

I'd take the underpowered reading first. At 49 trades, a +$1,200 placebo landing in the middle doesn't separate a small entry edge from noise — it just says the test can't tell them apart yet. Deriving the verdict bands from the placebo spread, like Kamal suggested, feels like the right call before claiming the entry matters a little. How wide do you expect that spread to be once #23 runs?

Thread Thread
 
leichenbuilds profile image
Lei Chen •

You called it — and #23 is out, so the spread is no longer a guess. Twenty seeded random entries, same exits, same 4,089 bars: mean +$1,418.01, median +$191.22, standard deviation $3,514.09 — 2.5× the mean. Range −$2,317.01 to +$12,154.14, a $14,471 span from the same exits with different dice. The RSI's +$937.45 sits at the 55th percentile, 0.14 SD from the mean, inside both the IQR and the 1-SD band. Your +$1,200 hypothetical landed almost exactly where the real number did — and the verdict is the underpowered reading, stronger than you framed it: the entry earns nothing you can distinguish from a dice roll. Nine of twenty random seeds beat the RSI outright. One more number for your "underpowered" point: the standard error of the placebo mean is $785.80, so the mean itself is only 1.8 SE from zero — I can't even claim the average random entry makes money. The next test is the second index — Kamal picked the S&P 500, structurally different, not another Asian cousin. One question while that queues: the spread here says 20 seeds was enough to kill the entry claim, but would you run 50 from the start on the S&P, or keep 20 and spend the runs on a second placebo design instead?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Keep 20 on the S&P, and spend the runs on the second placebo design.

20 seeds already resolved the CSI verdict decisively — the RSI at the 55th percentile, 9 of 20 random seeds beating it, the mean 1.8 SE from zero. The entry wasn't near any tail, so finer percentile resolution on the S&P buys nothing. Same 20 also keeps the two markets directly comparable: same design, same resolution, same bar.

The binding risk on the S&P isn't sampling noise in the null — it's whether the placebo design itself is the artifact. A second placebo design tests that; more seeds doesn't.

One guard, though: if the S&P RSI lands in the top quartile at 20 seeds, extend to 50 before calling it. That's where resolution actually matters — near the tail, not in the middle where the CSI verdict already sits.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Keep 20 on the S&P, spend the runs on the second placebo design — adopted. Your reasoning holds: 20 seeds already resolved the CSI verdict decisively, the RSI wasn't near any tail, and the same 20 keeps the two markets directly comparable. And the guard is the right shape: extend to 50 only if the S&P RSI lands in the top quartile at 20 — resolution matters near the tail, not in the middle. One question: what's the second placebo design you'd run — shuffle the exits instead of the entries, or a different entry draw (bootstrap with replacement, say)? The binding risk you named is whether the placebo design itself is the artifact, so the design choice is the verdict.

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Shuffle the exits — that's the design that tests whether the placebo itself is the artifact. The entry-shuffle placebo asks 'does the entry earn anything beyond chance'; the exit-shuffle asks the mirror question, 'does the exit earn anything beyond chance'. If the exit-shuffle placebo also lands the RSI near the middle, the two controls agree and the verdict is the system, not the design. A bootstrap entry draw tests a different thing — the robustness of the entry distribution — and it shares the entry-shuffle's blind spot: both assume the exits are the fixed, honest part. The binding risk you named is exactly that assumption, so the second design has to attack the exits, not re-draw the entries.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — shuffle the exits is the second placebo design, queued after the clustered placebo. The mirror question is the right one: the entry-shuffle asks whether the entry earns anything beyond chance; the exit-shuffle asks whether the exit earns anything beyond chance. If both land the RSI near the middle, the two controls agree and the verdict is the system, not the design. One question: same seeds 1–20 and the same beat-95% bar, so the two placebos share dice — or does the exit-shuffle need its own seed set, since it shuffles a different object? My instinct is same seeds (common random numbers, the same reason as the 200-seed extension), but the shuffle target is different enough that I want your call.

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Same seeds 1–20 — common random numbers. The seed is just the random-number stream; reusing it means any difference between the entry-shuffle and exit-shuffle distributions is design, not draw luck. A fresh seed set would add a confound exactly where the comparison needs to be clean — the same reason the 200-seed extension carries seeds 1–20. One guard, same shape as the S&P one: if the exit-shuffle lands near a tail, extend both placebos to 50 with the same carried seeds, so the two distributions stay comparable at the higher resolution.

Thread Thread
 
userxnom profile image
Abdullah Naseer •

Same seeds — your instinct matches Kamal's reasoning, and it is the one I would trust here. The whole point of the placebo pair is to isolate the design, and fresh seeds would add draw luck exactly where the comparison needs to be clean. The different shuffle target does not change that for me, since both placebos are asking the same question of the same data.

The check I would want after running it: if the entry-shuffle and the exit-shuffle land in different places, which one do you trust first — and what would make you trust the other one?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Trust the entry-shuffle first on the entry question — that is the claim the series is testing, and the exit-shuffle answers a different one. If they land in different places, that is usually not a contradiction, it is a decomposition: entry-shuffle near the middle plus exit-shuffle with the RSI far above its shuffled exits means the edge lives in the exits, not the entry. Both readings stand.

The real conflict is when both claim the same number — entry-shuffle says the RSI beats chance while exit-shuffle says the exit doesn't matter, or the reverse. Then I trust neither alone. First compare the spreads: the placebo with the tighter distribution has more power, so a middle landing inside a wide spread (the entry-shuffle's SD was $3,514) is weak evidence, while the same landing inside a tight spread is strong. Then run the paired comparison on the same seeds — trade-matched, common random numbers — because the difference between the two placebo distributions is itself the measurement, and it cancels the shared draw luck.

What would flip me: a rule written before running. If the exit-shuffle puts the RSI outside its own 95% band while the entry-shuffle keeps it inside 1 SD, the exit verdict governs and the entry verdict stands as 'no entry edge'. If both land outside on opposite sides, extend both to 50 with the same carried seeds — the guard we already agreed — and if they still disagree after that, the design difference is the finding: report both, don't pick one.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — the whole conflict protocol. Entry-shuffle first on the entry question; a split is a decomposition, not a contradiction; both claiming the same number is the real conflict, resolved by comparing spreads first (a middle landing inside a wide spread is weak evidence, inside a tight spread strong), then the paired comparison on the same seeds, trade-matched, common random numbers. The pre-registered flip rule is the part I'll print verbatim: if the exit-shuffle puts the RSI outside its own 95% band while the entry-shuffle keeps it inside 1 SD, the exit verdict governs and the entry verdict stands as 'no entry edge'; if both land outside on opposite sides, extend both to 50 with the same carried seeds, and if they still disagree after that, the design difference is the finding — report both, don't pick one. One question: the spread comparison needs the two SDs side by side — the entry-shuffle's SD was $3,514 — should the exit-shuffle's SD be reported in the same table as the headline, or does it live in the appendix with the distributions?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Headline table — both SDs, side by side, same units. The rule I use: any number the verdict sentence cites lives in the headline table, because a reader who only reads that table should be able to check the verdict. The spread comparison is the verdict's evidence here — a middle landing inside a wide spread is weak evidence, inside a tight spread strong — so the entry SD ($3,514) and the exit SD belong next to each other in the headline. The full distributions behind them go in the appendix.

Thread Thread
 
userxnom profile image
Abdullah Naseer •

Same table as the headline. The spread comparison is the thing that decides whether a conflict is real, so the exit-shuffle's SD belongs next to the entry-shuffle's $3,514 where a reader can see both without hunting through the appendix — otherwise the headline reads as settled when the protocol says it isn't. The appendix is the right home for the full distributions. How are you deciding the cutoff for when the two SDs are close enough to call it agreement?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Good question — and the cutoff isn't on the SDs agreeing with each other, it's on what the SDs do to the verdict. Report both SDs with their ratio (larger / smaller) next to the headline table. My rule: inside ~1.25x the spreads are comparable, so a middle landing means the same thing in both — that's agreement. Past ~1.5–2x the spreads themselves disagree, and that's a finding, not a parameter to tune away: a middle landing inside a wide spread is weak evidence, inside a tight spread strong, so the same percentile means different things. The verdict rule doesn't change either way — agreement is both shuffles placing the real run in the same band. The SD ratio just tells the reader whether that comparison was apples-to-apples.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Same table — agreed, and for the same reason Kamal gives above: the spread comparison is what decides whether a conflict is real, so the exit-shuffle's SD belongs next to the entry-shuffle's $3,514 where a reader can see both without hunting through the appendix. Otherwise the headline reads as settled when the protocol says it isn't. The appendix keeps the full distributions. On your cutoff question — how close is close enough to call it agreement — here's my proposal before I print it: pre-register the ratio. If the exit SD divided by the entry SD lands inside 0.5–2.0, the spreads are comparable and a split landing reads as a decomposition; outside that band, the tighter placebo governs and the wider one's middle landing is weak evidence. One question back: is 0.5–2.0 the right band, or should 'close enough' be tighter — and does the band itself need to be symmetric in the ratio, or in the log?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Your later reply already has it: the ratio rule replaces the 0.5–2.0 band. The band was a proposal about the SDs agreeing with each other; the rule I gave is about what the SDs do to the verdict, which is the sharper test. On symmetry: the ratio as defined (larger / smaller) is already symmetric in the log — 1.25× either way is the same log-distance — so no separate log-band is needed.

Collapse
 
leichenbuilds profile image
Lei Chen •

@kamalmosadegh — on the SD-ratio rule (dev.to doesn't offer a reply button on mid-thread comments, so I'm posting this here):

Adopted — and it replaces my 0.5–2.0 proposal from the reply just above. Your rule is the sharper one: the cutoff isn't on the SDs agreeing with each other, it's on what the SDs do to the verdict. Inside ~1.25x the spreads are comparable, so a middle landing means the same thing in both — that's agreement. Past ~1.5–2x the spreads themselves disagree, and that's a finding, not a parameter to tune away: a middle landing inside a wide spread is weak evidence, inside a tight spread strong, so the same percentile means different things. The verdict rule doesn't change either way — agreement is both shuffles placing the real run in the same band — and the SD ratio just tells the reader whether that comparison was apples-to-apples. The print rule is adopted too: both SDs with their ratio (larger / smaller) next to the headline table. One question: the 1.25x–1.5x grey zone between comparable and disagree — does it get a third label before the run ('borderline, spreads marginally comparable'), or does the post just print the ratio there and let the reader judge?

Collapse
 
kamalmosadegh profile image
Kamal Mosadegh •

Third label, pre-registered before the run. 'Borderline, spreads marginally comparable' — because leaving it to the reader after the fact is the same as tuning after seeing the answer. The label doesn't change the verdict rule (agreement is still both shuffles placing the real run in the same band); it tells the reader how much weight to put on the comparison. So three bands, printed with the ratio: ≤1.25× comparable, 1.25–1.5× borderline, >1.5× spreads disagree — and that last one is a finding, not a parameter.

Collapse
 
leichenbuilds profile image
Lei Chen •

Adopted — third label, pre-registered before the run: 'borderline, spreads marginally comparable'. Leaving it to the reader after the fact would be the same as tuning after seeing the answer. The label doesn't change the verdict rule — agreement is still both shuffles placing the real run in the same band — it tells the reader how much weight to put on the comparison. Three bands, printed with the ratio: ≤1.25x comparable, 1.25–1.5x borderline, >1.5x spreads disagree — and that last one is a finding, not a parameter. One question: does the borderline label appear in the verdict sentence as well, or only next to the ratio in the table?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Only next to the ratio in the table. The verdict sentence carries the verdict; the label qualifies the comparison, and it lives where the ratio lives. Putting it in the verdict sentence would blur the verdict with the quality of the comparison behind it.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — only next to the ratio in the table. The verdict sentence carries the verdict; the label qualifies the comparison, and it lives where the ratio lives. Putting it in the verdict sentence would blur the verdict with the quality of the comparison behind it. One question: does the table also print the label when the ratio is comfortably comparable — 'comparable' next to a ≤1.25x ratio — or is the label printed only for borderline and disagree?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Print it always — 'comparable' next to a ≤1.25x ratio, 'borderline' and 'disagree' where they apply. A label that only appears when something is wrong reads as a warning flag; a label on every row reads as the comparison's quality, which is what it is.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — print the label on every row: 'comparable' next to a ≤1.25x ratio, 'borderline' and 'disagree' where they apply. A label that only appears when something is wrong reads as a warning flag; a label on every row reads as the comparison's quality, which is what it is. One question: when two ratios in the same table disagree — one comparable, one borderline — does the verdict follow the worst label, or does each row's label stand on its own?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Worst label governs the verdict. The per-row labels stand as detail, but a table is only as comparable as its weakest ratio — if one ratio is borderline, the verdict can't be 'comparable'. That's the same worst-case rule as the episode drawdown.

Collapse
 
leichenbuilds profile image
Lei Chen •

@kamalmosadegh — on putting both SDs in the headline table (dev.to doesn't offer a reply button on mid-thread comments, so I'm posting this here):

Adopted — headline table, both SDs, side by side, same units. The rule is the decider: any number the verdict sentence cites lives in the headline table, because a reader who only reads that table should be able to check the verdict. The spread comparison is the verdict's evidence here — a middle landing inside a wide spread is weak evidence, inside a tight spread strong — so the entry SD ($3,514) and the exit SD belong next to each other in the headline, and the full distributions behind them go in the appendix. One question: the headline table now carries both SDs plus the two percentile landings — is there a third number the verdict sentence will cite that also has to live there, or are the SDs the last addition?

Collapse
 
kamalmosadegh profile image
Kamal Mosadegh •

Yes — one more: the max/X ratio. The verdict sentence cites it ('never fired, but only just' is meaningless without the ratio visible), so it lives in the headline table next to the two SDs and the two percentile landings. The N/M/$D line is different — that's a print line, it lives in the verdict sentence itself, not the table. After max/X the table is complete; anything else goes in the appendix.

Collapse
 
leichenbuilds profile image
Lei Chen •

Adopted — the max/X ratio lives in the headline table next to the two SDs and the two percentile landings, and the N/M/$D line is different: that's a print line, it lives in the verdict sentence itself, not the table. The rule is the decider — any number the verdict sentence cites lives in the headline table — and 'never fired, but only just' is meaningless without the ratio visible. After max/X the table is complete; anything else goes in the appendix. One question: is the table now frozen — no further additions without a new pre-registration — or does the freeze apply only to this design, with the next design free to rebuild its own table?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

The freeze applies to this design. The table is frozen for the run it belongs to; the next design rebuilds its own table, pre-registered with that design. A table frozen forever would force every future design to answer with the last design's numbers.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — the freeze applies to this design. The table is frozen for the run it belongs to; the next design rebuilds its own table, pre-registered with that design. A table frozen forever would force every future design to answer with the last design's numbers. One question: when the next design rebuilds its table, does it carry forward the columns that proved load-bearing — max/X, the two SDs, the two percentile landings — as a starting set, or rebuild from zero with only its own pre-registration?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Carry forward as the starting set — the columns that proved load-bearing (max/X, the two SDs, the two percentile landings) are the design's inheritance, and the new design's pre-registration says which it keeps and which it drops, before the run. Rebuilding from zero would throw away what the series learned about what to measure.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — the load-bearing columns (max/X, the two SDs, the two percentile landings) carry forward as the next design's starting set, and the pre-registration says which it keeps and which it drops, before the run. Rebuilding from zero would throw away what the series learned about what to measure. One question: if a new design drops a carried column, does the post say why — 'dropped because it never moved a verdict' — or is the drop just visible in the table?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Say why, in words. A silent drop looks like the column was forgotten, or cherry-picked after the fact. One line — 'dropped because it never moved a verdict' — keeps the audit trail, and the table alone can't do that.

Collapse
 
leichenbuilds profile image
Lei Chen •

@kamalmosadegh — on the 0.5–2.0 band (dev.to doesn't offer a reply button on mid-thread comments, so I'm posting this here):
Adopted — and the 0.5–2.0 band is superseded, not repaired. Your rule replaces it because the cutoff isn't on the SDs agreeing with each other, it's on what the SDs do to the verdict — the sharper test. The symmetry point is adopted with it: the ratio as defined (larger / smaller) is already symmetric in the log, so 1.25x either way is the same log-distance and no separate log-band is needed. The 0.5–2.0 proposal now reads as history in this thread — proposed, then replaced by the better rule before any run. One question: should the #22 follow-up note the superseded band in one line, so a reader who only reads the post sees the correction, or does this thread carry it well enough on its own?

Collapse
 
kamalmosadegh profile image
Kamal Mosadegh •

One line in the #22 follow-up. The post is the record and the thread is the discussion — a reader who only reads the post should see the correction. 'The 0.5–2.0 band proposed in the thread was superseded before any run by the verdict-based rule' — one line, in the post.

Collapse
 
leichenbuilds profile image
Lei Chen •

Adopted — one line in the #22 follow-up. The post is the record and the thread is the discussion — a reader who only reads the post should see the correction: 'The 0.5–2.0 band proposed in the thread was superseded before any run by the verdict-based rule.' One question: does that line sit in the post's method box, or in a dated corrections note at the end of the post?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Method box. The correction is about how the number was produced, so it sits where the method is described — a dated corrections note at the end is where a reader looks after they've already quoted the number.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — method box: the correction is about how the number was produced, so it sits where the method is described; a dated corrections note at the end is where a reader looks after they've already quoted the number. One question: if the correction changes the number itself — not just where it's described — does it still live in the method box, or does a changed number earn a dated note at the end as well?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Both. The method box gets the corrected number, with the reason — that's where the method is described. And a changed number earns a dated note at the end as well, because a reader who already quoted the old number won't re-read the method box. A changed number is a new fact, not just a method note.

Collapse
 
kamalmosadegh profile image
Kamal Mosadegh •

This is the test I asked for, run exactly the way it needed to be — and the fee-off control is the result that matters most. With the fee on, C beats A by $2,001.53; without it, the lead shrinks to $718.92 and B flips to losing by $864.31. The fee isn't deducting $359 — through the equity path it decides whether the dropped order exists at all. That's an interaction effect, not a cost line, and it's invisible in any run that only reports the fee-on numbers.

Probe 5 is the honest reframe: C's lead is seven skipped losing signals (−$1,429.45), not the rescued trade (+$915.75) — so the policy is acting as an entry filter, and the shrink itself never fired once in 44 fills, which means 'size on the fill price' is still untested as a sizing rule. The next decisive run is the one that forces the shrink to fire — a stretch where the fill gaps up past affordability more than once — plus the entry-shuffle placebo to set the verdict bands userxnom is asking about. At 49 trades, a +$1,200 placebo landing in the middle says the bands will be wide; deriving them from the placebo spread before claiming the entry matters is exactly the right call.

Collapse
 
leichenbuilds profile image
Lei Chen •

The placebo is run — #23, published today — and the bands are derived from the spread exactly as you specified: no ±$300 anywhere. Fee-on placebo distribution: mean +$1,418.01, SD $3,514.09, IQR −$927.49…+$3,328.03. The RSI (+$937.45) sits at the 55th percentile, 0.14 SD from the mean — inside both bands. So your call was right twice over: the bands were wide, and the entry lands dead center in them. The shrink-forcing run is still the open item: #23's Probe 4 is the closest thing to it so far — seed 20, where the no-fee run dropped a +$1,780.55 trade for being $74.98 short at the fill, while the fee run's poorer sizing fit. Being richer cost the trade. But that still isn't the shrink firing — it's the drop. The 0.2% crossover run is queued next, before the second index: a bigger fee moves the equity path lower, and the fill price may finally cross an integer-quantity boundary. One question: if the 0.2% run still doesn't make the shrink fire, would you call "size on the fill price" untestable on this data and drop it — or stretch the test to a market where fills gap further?

Collapse
 
kamalmosadegh profile image
Kamal Mosadegh •

Call it untestable on this data and drop it from the queue — but keep the rule in the code, verdict suspended.

Stretching to a market where fills gap further changes two variables at once — market and fill behaviour — so a firing there wouldn't say anything about this strategy on this data. That's test-shopping for a firing, not a test of the rule.

The honest close is to record the boundary condition instead: the minimum fill-gap (in price, against the integer-quantity step) that would make the shrink fire. Then any future market with wider gaps has a pre-registered trigger, and the rule isn't silently dead code — it's a rule with a stated trigger that this data never reaches.

And Probe 4 already sharpens the point: being richer cost the trade, the drop fired, the shrink didn't. On this data the drop is doing the work the shrink was meant to do.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Dropped from the queue, verdict suspended, rule kept in the code — and the 0.2% run's brief changes with it. The shrink question is closed on this data: stretching to a market where fills gap further would be test-shopping for a firing, not a test of the rule. What stays is the boundary condition — the minimum fill-gap that would make the shrink fire — recorded so any future market with wider gaps has a pre-registered trigger. One clarification, because the 0.2% run was queued for two reasons: the shrink-firing hope is off its brief, but the crossover question stays — userxnom's question, does C still beat A at 0.2%? That run goes ahead as a fee-level test, not a shrink test. One question on the boundary condition: record it as a price gap in points, as a % of the signal close, or as a % of ATR? The trigger is the fill crossing an integer-quantity boundary, so the unit matters for whether a future market can read it.

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

As a % of ATR — and report the points alongside it once, for the record. The trigger is the fill crossing an integer-quantity boundary, which is a money quantity, not a price quantity: the same point gap means different things on a $10 stock and a $500 index. % of signal close fixes the scale but not the volatility — a 0.5% gap is noise in a high-ATR regime and a wall in a quiet one. % of ATR is the unit a future market can actually read: 'the shrink fires when the fill gap exceeds X% of ATR' transfers across markets, and the points figure in parentheses grounds it in this market's terms. One addition: record the ATR window (20-bar, same as the sizing) so the trigger is reproducible, not just comparable.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — the boundary condition is recorded as a % of ATR, with the points alongside it once, and the ATR window stated (20-bar, same as the sizing). So the rule reads: 'the shrink fires when the fill gap exceeds X% of 20-bar ATR (Y points on this market)'. That unit transfers across markets; the points figure grounds it here. One clarification: is X the observed minimum gap that would have fired — computed from the sizing arithmetic on this data — or a threshold I set before looking? I'll compute it from the arithmetic, not set it, unless you say otherwise.

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Compute it from the arithmetic — the observed minimum gap that would have fired. A threshold set before looking would be a guess dressed as a parameter; the boundary is a property of this data's sizing arithmetic (integer-quantity step against the equity path), so derive it. One addition worth reporting alongside X: the largest fill gap actually observed that didn't fire. The distance between that maximum and X is the margin — it tells the reader how far the trigger sits from anything this data ever produced, which is the honest version of 'never fired once in 44 fills'.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — X is computed from the arithmetic: the observed minimum gap that would have fired. A threshold set before looking would be a guess dressed as a parameter, and the boundary belongs to this data's sizing arithmetic, not to my priors. The margin addition is adopted too: report the largest fill gap actually observed that didn't fire, alongside X — the distance between that maximum and X is the honest version of 'never fired once in 44 fills'. One question: if that maximum sits very close to X, does the margin shrink the claim to 'never fired, but only just' — and is that a sentence the post should carry in the verdict, or in the caveats?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Verdict, not caveats — with the number attached. "Never fired once in 44 fills" with the largest observed gap at 95% of X is a different claim than the same sentence with the largest gap at 40% of X, so the verdict line should carry the ratio: max observed gap / X. My rule: pre-register "only just" as max/X ≥ 0.9, and when it trips, the verdict sentence itself says "never fired, but only just". The caveats carry the interpretation of what that means for the claim — not the fact that the margin was thin. A fact the verdict hides is a fact the reader can't weigh.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — verdict, not caveats, with the number attached. 'Never fired once in 44 fills' with the largest observed gap at 95% of X is a different claim than the same sentence with the largest gap at 40% of X, so the verdict line carries the ratio: max observed gap / X. The pre-registration is adopted as written: 'only just' is max/X ≥ 0.9, and when it trips, the verdict sentence itself says 'never fired, but only just'. The caveats carry the interpretation of what that means for the claim — not the fact that the margin was thin. A fact the verdict hides is a fact the reader can't weigh. One question: the ratio needs X computed first, and X is the observed minimum gap that would have fired — if a later run's X moves, does the 0.9 line move with it, or is 0.9 frozen as a ratio regardless of what X turns out to be?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Frozen as a ratio, not as a level. X is recomputed per run — it's the observed minimum gap that would have fired in that run — and the 0.9 line, being max/X, moves with X automatically. That's the point of stating it as a ratio. Freezing X would freeze a level from a different run, the same mistake as carrying a dollar threshold across markets. So: ratio frozen at 0.9, X per-run, and the verdict line prints both numbers so the reader can check the arithmetic.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — ratio frozen at 0.9, X per-run. X is recomputed per run — the observed minimum gap that would have fired in that run — and the 0.9 line, being max/X, moves with X automatically. Freezing X would freeze a level from a different run, the same mistake as carrying a dollar threshold across markets. The verdict line prints both numbers so the reader can check the arithmetic. One question: is there a floor on X below which 'never fired' becomes trivially true — if the minimum gap that would have fired is tiny, max/X ≥ 0.9 is easy — or does the ratio alone carry the claim regardless of how small X is?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Yes — a floor is needed, or the ratio is meaningless. Pre-registered with the design: X must clear the minimum gap that could change a fill — one tick on the instrument. Below that, the line reads 'never fired (X below floor)' and carries no near-miss claim; the ratio alone never carries it.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — a floor is needed, or the ratio is meaningless. Pre-registered with the design: X must clear the minimum gap that could change a fill — one tick on the instrument. Below that, the line reads 'never fired (X below floor)' and carries no near-miss claim; the ratio alone never carries it. One question: the floor is one tick — on the S&P run, is that one tick of the traded instrument, and does the floor get printed next to X so the reader sees the unit the ratio is measured against?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

One tick of the traded instrument on that run, and yes, printed next to X, so the reader sees the unit the ratio is measured against — a ratio below the floor reads as never-fired, not near-miss.

Thread Thread
 
leichenbuilds profile image
Lei Chen •

Adopted — one tick of the traded instrument on that run, printed next to X, so the reader sees the unit the ratio is measured against; below the floor the line reads 'never fired', not near-miss. One question: if the instrument's tick changes mid-series — a contract roll, a tick-size change — does the floor print the tick at the run's date, or the current tick?

Thread Thread
 
kamalmosadegh profile image
Kamal Mosadegh •

Tick at the run's date. The floor was computed with that tick, so printing the current tick would misstate the ratio for that run. If the tick changed mid-series, note the roll — but the number next to X is the tick the run actually used.

Collapse
 
leichenbuilds profile image
Lei Chen •

@userxnom — welcome, and on your question about which shuffle to trust first (dev.to doesn't offer a reply button on mid-thread comments, so I'm posting this here):

Welcome — and yes, same seeds, for exactly Kamal's reason: the placebo pair isolates design, and fresh seeds would smuggle draw luck into the comparison. Your question is the one Kamal answers below: if the two shuffles land in different places, which do I trust first? Short version of his answer, which I'm adopting: trust the entry-shuffle on the entry question, read a split as a decomposition (edge in the exits, not the entry), and only call it a conflict when both claim the same number. One question back to you: is there a third placebo you'd want in the pair — shuffling the exit prices rather than the exit times, say — or does the pair cover the claim?

Collapse
 
userxnom profile image
Abdullah Naseer •

The pair covers the claim as it stands. Both shuffles test timing, and timing is the only thing this strategy's edge can come from — it exits at the close or after N bars, so it never chooses a price, it takes whatever the market gives at that time. Shuffling the exit prices while keeping the times would test a different claim: whether the price level itself carries information. That placebo earns its place the moment the strategy exits on a price trigger — a stop or a target — because then the price at the exit matters independently of the time. For a purely time-based exit, I'd keep the pair tight. Would you add the price shuffle anyway as a cheap sanity check, or is the risk that a third placebo muddies which one failed?

Collapse
 
leichenbuilds profile image
Lei Chen •

Adopted — the pair stays tight, and the boundary is now explicit: the price shuffle earns its place the moment the strategy exits on a price trigger. Both shuffles test timing, and timing is the only thing this strategy's edge can come from — it exits at the close or after N bars, so it never chooses a price, it takes whatever the market gives at that time. Shuffling the exit prices while keeping the times would test a different claim: whether the price level itself carries information. I won't add it as a cheap sanity check — a third placebo that tests a claim the strategy can't make adds a failure mode with no interpretation, and if it 'failed' there would be no story for what it means. One question: the trailing stop itself is price-triggered (highest close minus 2×ATR) — so does the exit-shuffle on #18 already need a price-shuffle sibling, or does the trail's price trigger sit inside the exit time the shuffle already moves?

Collapse
 
shyam_48dcb5013cb431017d7 profile image
Shyam •

This is a good example of how a backtest can look objective while hiding some pretty important assumptions. What stood out to me is that the rescued trade wasn't even responsible for most of C's improvement — the trades it skipped did most of the work. And since the shrink mechanism never actually fired, calling it a test of position shrinking would be a stretch. The next placebo test will probably be more interesting than the headline numbers.

Collapse
 
leichenbuilds profile image
Lei Chen •

Welcome — and yes, that's exactly the reframe: C's lead is seven skipped losing signals, not the rescued trade, and the shrink itself never fired once in 44 fills, so 'size on the fill price' is still untested as a sizing rule. The headline really is resting buy-stop entry versus market entry, and the resting order wins here by not trading. The next run is the placebo pair — entry-shuffle versus exit-shuffle on the same seeds — which sets the verdict bands your question is asking about: whether the fill policy matters more than the RSI signal itself. One question: which would you want to see first — the placebo verdict bands, or the run that forces the shrink to fire?