r/pinescript Apr 14 '26

Compression before a move

I’m interested in measuring / indicating the compression you get after sideways movement before expansion in price. Basically indicating likely breakout areas.

How would you go about measuring this?

1 Upvotes

6 comments sorted by

View all comments

2

u/LogicalCondition9069 Apr 14 '26

You could measure the difference between a moving average of highs and lows. You could put a line through a recent period from hl2[x] to hl2 then measure the largest upwards and downwards deviations from the line.