Position scaler
A position size ratio that grows with positive momentum and volume, capped at max_size.
PositionScaler turns three momentum readings into a position size ratio. It adds 10 times the positive ROC input, 5 times the positive MACD input and 0.5 when the OBV input is above zero, then adds that score to base_size. The result is capped at max_size and floored at 0.05, and it stays empty until the ROC, MACD and OBV inputs all have values. The optional ATR input is stored but never used.
How to read it
- The line sits in its own pane below the price, and its values are size ratios, not prices.
- On this chart it is flat at max_size (0.9 by default): its three momentum inputs all read the close price, so the score always overshoots the cap.
- In a real strategy the size rises from base_size as momentum strengthens and stops at the cap.
- A flat line here shows the cap you set, not momentum.
What it outputs
- Position size
- Size ratio from momentum, between the 0.05 floor and max_size. On this chart it is flat at the cap.
Settings
- base_size
- The size before momentum is added, so it sets the size at zero momentum and lifts every level above it. On this chart it has no visible effect, because the momentum score there is far above any allowed base.
- max_size
- The cap: the size never goes above it. Raising it lets strong momentum push the size higher; lowering it pulls the cap down, and at or below 0.05 the line stops at the 0.05 floor. On this chart the line sits exactly at this value.
Pitfalls
- On this chart the three momentum inputs all read the close price, so the line is flat at the cap and does not show real momentum.
- Any score above max_size minus base_size hits the cap, so with strong momentum the size sits at max_size and stops responding.
- atr_pipe is accepted but unused, so connecting it does not change the size.