Pyramid multiplier
Size multiplier that steps up by a fixed amount for each bar momentum stays on, up to a cap.
This indicator outputs a position-size multiplier, not a price signal. It counts consecutive bars where its momentum input is truthy (any non-zero value) and resets the count on the first bar it is not. The multiplier is 1.0 on the first bar of a run and on every bar with momentum off, then rises by per_step for each further bar, capped at max_boost.
How to read it
- The line lives in its own pane below the price and starts at 1.0, the no-boost level.
- Each further bar of an unbroken momentum run adds one per_step, so with defaults the line reaches the 2.5 cap on the fifth bar of a run.
- It drops back to 1.0 on the same bar momentum turns off, and a new run counts up again from 1.0.
- A line stuck at 2.5 for hours means the momentum input never turned off, not that the market kept accelerating.
What it outputs
- Multiplier
- Position-size multiplier: 1.0 with no momentum run, rising by per_step per further bar and capped at max_boost.
Settings
- max_boost
- The ceiling on the multiplier. Raising it lets long momentum runs reach bigger sizes; lowering it flattens the line lower and sooner. Set below 1.0, it pulls every bar with an input value under 1.0.
- per_step
- The step added for each further bar of momentum. Raising it reaches the cap in fewer bars; lowering it stretches the ramp, and 0 holds the line at 1.0. Negative values shrink the multiplier each bar and can take it below zero.
Pitfalls
- The input is read as a flag, so any non-zero value counts as momentum. Fed the close price, the run never breaks and the line sat at 2.5 on at least 95% of SPY one-minute bars in the sample used here.
- Nothing clamps the output below zero. A negative per_step, or a max_boost under 1.0, can give a multiplier under 1.0 or below zero, and only the top is capped.
- Before the input has its first value it returns 1.0 without counting, and that warm-up 1.0 ignores max_boost even when max_boost is below 1.0.