Exponential sizer
Order size multiplier: about 0.63 on quiet bars, climbing to 1.6 on volume or upward-momentum surges.
ExponentialSizer turns an explosive score into an order-size ratio. The score squashes three parts through a logistic curve: upward 5- and 21-bar momentum, how far the bar's volume runs above its recent average, and ATR as a percent of price, which contributes little on one-minute SPY bars. The size is base_size times exp(2.5 x score), capped at base_size times max_mult, so it sits near 0.63 on a quiet bar and climbs toward 1.6 on a surge.
How to read it
- The line sits in its own pane below the price, not on the candles.
- Most bars sit just above 0.63, the quietest reading: no upward momentum and no volume surge.
- Spikes toward 1.6 mark bars with a volume surge or a fast upward move. 1.6 is the ceiling, reached on at least 5% of bars.
- It has no direction: a high reading means the strategy sizes up on an explosive bar, not that price will rise.
What it outputs
- Order size
- Order size ratio: base_size times a multiplier from about 1.6 up to max_mult. On defaults it reads 0.63 to 1.6, with 0.4 only during warm-up.
Settings
- base_size
- Scales the whole output. Each size is base_size times a multiplier, and the ceiling is base_size times max_mult, so the quiet floor and the cap both move with it. Very small values hit a hard 0.05 floor.
- max_mult
- Sets the ceiling as a multiple of base_size, 1.6 at defaults. Raising it lets strong surges size higher, with the multiplier topping out near 12. Lowering it below about 1.6 makes the output almost flat.
Pitfalls
- Warm-up returns base_size (0.4), so the first 22 or so bars show 0.4. After warm-up the output never drops below about 0.63, so 0.4 is not a real minimum.
- Only upward momentum counts; a sharp sell-off adds nothing. A bar with volume about 1.7 times its recent average reaches the 1.6 ceiling on volume alone, whichever way price moves.
- The source docstring says 0.4 to 3.0, but the real ceiling with defaults is 1.6. Negative base_size or max_mult, which the bounds allow, collapses the output to a flat 0.05 after warm-up.