OPEN-SOURCE SCRIPT

All-in-one trend clarity

1 040
TrendLens is a multi-layer, all-in-one overlay indicator designed to visually detect and filter market direction — not a buy/sell strategy.
It highlights early trend shifts based on candle behavior, then supports that view using Pivot High/Low structure, three customizable EMAs, and a visible daily session window to focus on active market hours.

What’s included (All inside one indicator)

Structural Trend Candles

If price closes above the highest high of the previous N bars → candle turns white (bullish structural breakout).

If price closes below the lowest low of the previous N bars → candle turns black (bearish structural breakdown).

Pivot High / Pivot Low Markers
Detects swing highs/lows using adjustable left/right bars (default 7) and plots small gray triangle markers on the chart.

Active Session Window
Highlights a fixed daily time window (default 06:00–18:00 UTC) with a transparent green background to visually mark the active trading session.

3 Customizable EMAs

EMA Fast (default 10)

EMA Mid (default 20)

EMA Long (default 100)
Each EMA supports custom length, source, color, and thickness.

How to use it

Use white/black candles as a quick trend filter and early structure shift cue.

Use EMA100 as the main trend bias reference; use EMA10/EMA20 positioning to gauge momentum.

Use Pivot High/Low to spot structure levels for potential support/resistance and risk management.

Enable the session highlight to focus analysis on high-activity hours.

Disclaimer

This indicator is a technical analysis helper, not a trading strategy.

It does not provide buy/sell recommendations. You are responsible for your own trade decisions and risk management.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.