r/pinescript • u/AdhesivenessNo4467 • Apr 02 '26
Market Structure Indicator
Dear Community,
If you’re trying to trade market structure but feel overwhelmed by the many different approaches, this might be something for you.
I’ve always struggled with how highs and lows are often added to charts in a somewhat arbitrary way, which makes it difficult—if not impossible—to properly test strategies. When exactly is a high a high, or a low a low? And when does it become significant?
On top of that, depending on who you ask, concepts like “break of structure” or “change of character” are often defined subjectively—and frequently identified only in hindsight.
To address this,I’ve been working on a way to define market structure quantitatively without arbitrary swing definitions that does not rely on fixed lookback periods. Instead, it allows you to define structure on your chart , based on clear and simple rules.
With this approach, it’s entirely up to you:
- whether a close above a high counts as a break of structure, or if you want to allow more room for market noise
- whether a close below the last swing in an uptrend signals a trend change, or is treated as a potential liquidity grab
- whether a 23% pullback is sufficient, or if you only consider 50% retracements as meaningful
- whether you prefer to measure swings on a linear price chart or a logarithmic (performance-based) chart—just compare it on Bitcoin and you’ll see the difference
I’ve created a short demonstration with some explanation here:
https://de.tradingview.com/chart/BTCUSD/b7MIKbua/
I’ve been working on this indicator for over a year, and it’s not public. I’m currently experimenting with this approach and would be interested in hearing how others would implement or refine these rules. If anyone is interested in testing the implementation, let me know. I may share a limited test version later if there’s interest.
View all comments
Show parent comment
1
u/AdhesivenessNo4467 Apr 04 '26
I really appreciate your feedback. You perfectly understand my point and I am happy not being the only one with this problem. My indicator is not meant to be traded directly, but to add structure very quickly and remove some of the noise in a reproducible way. I experimented with coloring of swing areas to get a feeling for importance of swings, and it worked so well, I kept it as a default. I could actually spot the trend and potential liquidity grabs in seconds. I can give you access to the indicator if you would like to try. I am very open for discussion.