Skip to content

What are the rules, in order?

Each cycle checks each stock. First the stock must pass the filter. Then the five rules run.

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.
OrderRuleWhenAction
1discount_entryGap ≤ −(edge + round-trip cost)Buy
2premium_exitHolding, and gap ≥ +(edge + round-trip cost)Sell all
3convergedHolding from rule 1, and gap ≥ convergePctSell all
4time_stopHeld for maxHoldHours or moreSell all
5hard_stopPosition PnL ≤ hardStopPctSell 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.

  • Sells go before buys.
  • Then the largest gap size goes first.
  • At most 3 fills per cycle.
  • One stock waits 60 seconds between fills.
  • Never trade on a stale reading.
  • Never mark at a stale price.

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.

Read the ledger fields.