What are the rules, in order?
Each cycle checks each stock. First the stock must pass the filter. Then the five rules run.
The filter
Section titled “The filter”A stock is skipped when:
- Its prices cannot be compared. Decision:
skip/stale. - Its main pool depth is under
$5,000. Decision:skip/thin_depth.
The five rules
Section titled “The five rules”| Order | Rule | When | Action |
|---|---|---|---|
| 1 | discount_entry | Gap ≤ −(edge + round-trip cost) | Buy |
| 2 | premium_exit | Holding, and gap ≥ +(edge + round-trip cost) | Sell all |
| 3 | converged | Holding from rule 1, and gap ≥ convergePct | Sell all |
| 4 | time_stop | Held for maxHoldHours or more | Sell all |
| 5 | hard_stop | Position PnL ≤ hardStopPct | Sell all |
Buy size is the smallest of four limits:
size = min( maxPositionPct × equity − held mark, maxDepthSharePct × depth, cash, maxOrderUsd)A size under $25 is skipped. Decision: skip/no_cash or skip/limit.
Order of fills
Section titled “Order of fills”- Sells go before buys.
- Then the largest gap size goes first.
- At most
3fills per cycle. - One stock waits
60seconds between fills.
- Never trade on a stale reading.
- Never mark at a stale price.
Sample
Section titled “Sample”The gap is -10%. The edge is 1%. The round trip is 8.6%. The sum is 9.6%. The gap is past it. Rule 1 fires. Equity is $100,000. Depth is $100,000. Size is the least of $5,000, $2,000, cash, and $5,000. That is $2,000.