Advanced approaches to detect Trend vs Sideways

D_Tramp

New member
VIP
Hi All,

I’m specifically looking for non-standard and more advanced approaches in thinkScript to classify whether a stock is currently in a trending regime or a ranging / sideways / choppy regime. I’m already very familiar with the classic tools (ADX thresholds, moving average slope/alignment, Bollinger Bandwidth, ATR vs its average, basic higher-highs/higher-lows structure, etc.), so please skip those.

What I’m interested in:
- statistical / quantitative measures that can be coded in thinkScript
(Kaufman Efficiency Ratio and its variations, approximations of Hurst exponent, Fractal Dimension, Choppiness Index if used in a more sophisticated way, linear regression R-squared + slope combinations, entropy-based measures, variance ratio tests, etc.)​
- any custom multi-factor or hybrid regime filters that go beyond the usual indicators
- scripts that produce a clean regime label / state (Trend / Range / Transition) using less common math
- anything people have developed or found useful that feels more “quantitative” and less laggy than the standard toolkit

If you have (or know of) threads/scripts that implement any of the above - or your own experimental approaches - I’d really appreciate links, code, or descriptions of what actually works well on stocks in TOS.

Thanks a lot!
 
Solution
"Sideways" is a ranging result that is caused by multi-dimensional footprint across Price Action, Candle Patterns, and Volume Dynamics


Market BehaviorCandle / Price Action PatternVolume DynamicsResulting Regime StateWhy Standard Metrics Fail
Institutional Accumulation / DistributionTight price bounds, frequent long wicks on one side (rejection).High, steady, or spiking volume at bound edges without price continuation.Squeeze / CoilingHigh volume tricks trend/momentum indicators into expecting a breakout prematurely.
Market Apathy / Low Liquidity
...
"Sideways" is a ranging result that is caused by multi-dimensional footprint across Price Action, Candle Patterns, and Volume Dynamics


Market BehaviorCandle / Price Action PatternVolume DynamicsResulting Regime StateWhy Standard Metrics Fail
Institutional Accumulation / DistributionTight price bounds, frequent long wicks on one side (rejection).High, steady, or spiking volume at bound edges without price continuation.Squeeze / CoilingHigh volume tricks trend/momentum indicators into expecting a breakout prematurely.
Market Apathy / Low LiquiditySmall real bodies, overlapping bars, low intra-bar range (narrow spreads).Substantially below-average, declining volume.Dormant SidewaysVolatility-based metrics drop, but breakout signals produce high slippage and false triggers.
Equilibrium Price Discovery (Value Area)Symmetric bell-curve distribution of price around a point of control (POC).High volume centered at the middle of the range; dropping volume at edges.Balanced RangeStatistical metrics see zero directional drift, mistaking consolidation for zero momentum.
Volatility Compression (Contraction)Decreasing high-to-low ranges per candle; forming wedges/pennants.Volume steadily drying up as price moves toward the apex.Volatility SqueezeLinear regression slope drops to near 0, missing the explosive potential energy build-up.
Stop-Hunting / Mean-Reverting ChurnLarge candle bodies with immediate full-bar reversals (whipsaws), breaking recent swings.High, erratic volume spikes on Reversal bars.Choppy / Expansion-Range SidewaysADX drops, but standard Deviation/ATR explodes—tricking filters into seeing a "trending" state.

As you have seen, there are issues when using standard indicators. Some can be overcome; some cannot.

Which specific market behavior are you attempting to identify?
 
Solution
"Sideways" is a ranging result that is caused by multi-dimensional footprint across Price Action, Candle Patterns, and Volume Dynamics


Market BehaviorCandle / Price Action PatternVolume DynamicsResulting Regime StateWhy Standard Metrics Fail
Institutional Accumulation / DistributionTight price bounds, frequent long wicks on one side (rejection).High, steady, or spiking volume at bound edges without price continuation.Squeeze / CoilingHigh volume tricks trend/momentum indicators into expecting a breakout prematurely.
Market Apathy / Low LiquiditySmall real bodies, overlapping bars, low intra-bar range (narrow spreads).Substantially below-average, declining volume.Dormant SidewaysVolatility-based metrics drop, but breakout signals produce high slippage and false triggers.
Equilibrium Price Discovery (Value Area)Symmetric bell-curve distribution of price around a point of control (POC).High volume centered at the middle of the range; dropping volume at edges.Balanced RangeStatistical metrics see zero directional drift, mistaking consolidation for zero momentum.
Volatility Compression (Contraction)Decreasing high-to-low ranges per candle; forming wedges/pennants.Volume steadily drying up as price moves toward the apex.Volatility SqueezeLinear regression slope drops to near 0, missing the explosive potential energy build-up.
Stop-Hunting / Mean-Reverting ChurnLarge candle bodies with immediate full-bar reversals (whipsaws), breaking recent swings.High, erratic volume spikes on Reversal bars.Choppy / Expansion-Range SidewaysADX drops, but standard Deviation/ATR explodes—tricking filters into seeing a "trending" state.

As you have seen, there are issues when using standard indicators. Some can be overcome; some cannot.

Which specific market behavior are you attempting to identify?

Thank you for the detailed breakdown — this is extremely helpful.You’re absolutely right: treating “sideways” as a single regime is too crude. The multi-dimensional view (Price Action + Candle Patterns + Volume Dynamics) makes much more sense, especially when standard metrics start failing.

What I’m ultimately trying to build is a reliable, codeable regime filter that can distinguish:

1) True trending conditions
2) Different subtypes of non-trending / ranging environments (particularly the ones that look like Squeeze/Coiling, Volatility Compression, and Choppy/Expansion-Range Sideways)

The goal is to have a clean state output (or probability scores) that I can use as a filter in strategies — preferably something quantitative enough to be implemented in thinkScript without heavy discretionary interpretation.Do you (or anyone else) have any existing scripts, approaches, or combinations that try to classify these more nuanced regimes using a multi-factor footprint (price action structure + volume behavior + candle characteristics)?Even partial implementations or ideas on how to quantify these distinctions would be gold.Thanks again for taking the time to explain this so clearly.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Thread starter Similar threads Forum Replies Date
M Advanced Market Moves 2.0 Questions 3
W Advanced TRIX Questions 3
W Advanced VWAP Questions 13
W Advanced Pivot Point Indicator Questions 6
W Advanced EMAD Modification Request Questions 6

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
1213 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top