OPEN-SOURCE SCRIPT

TREND RIBBON

619
trend filter ribbon

trend filter ribbon is a market structure and trend filtering tool designed to help traders read the active direction of price with a clean ema ribbon, external structure logic, internal entry markers, htf bias filtering, and a compact live dashboard.

the tool is built to answer one simple question:

is the market bullish, bearish, or neutral?

it does not try to predict every candle. it filters the chart so the trader can avoid low-quality counter-trend decisions and focus on cleaner directional setups.

what the indicator does

the indicator combines several elements:

ema ribbon:
a multi-layer ema ribbon shows the current trend body. when the ribbon expands, the trend is stronger. when it compresses, the market is weaker or flatter.

external structure:
major swing highs and swing lows define the main market structure. when price breaks a major level, the script detects bos or choch depending on the current structure state.

internal structure:
smaller swing breaks are used as early entry markers, but only when they agree with the active master trend.

htf veto:
a higher timeframe ema filter can block counter-trend conditions. when the lower timeframe disagrees with the selected htf direction, the master trend can be held as neutral.

live structure levels:
the most important active high and low levels are drawn on the chart so the trader can see where the next structural decision may happen.

dashboard:
a compact institutional-style panel displays external trend, htf bias, master state, ribbon spread, active levels, and early long or short validity.

how to read the ribbon

bullish ribbon:
when the ribbon is bullish, the tool is showing that the active structure and trend conditions favor long setups.

bearish ribbon:
when the ribbon is bearish, the tool is showing that the active structure and trend conditions favor short setups.

neutral ribbon:
when the ribbon is neutral, the market is not clean enough or the htf filter is blocking the active direction. beginners should usually avoid trading during neutral conditions.

ribbon spread:
the ribbon spread measures the distance between the fastest and slowest ribbon ema, normalized by atr.

flat:
the ribbon is compressed. the market may be ranging or weak.

building:
the ribbon is expanding. trend strength is improving.

strong:
the ribbon is clearly expanded. the current direction has stronger momentum.

bos and choch

bos means break of structure.

a bullish bos appears when price continues higher by breaking a valid structural high during a bullish structure.

a bearish bos appears when price continues lower by breaking a valid structural low during a bearish structure.

choch means change of character.

a bullish choch appears when price breaks structure upward after a bearish phase.

a bearish choch appears when price breaks structure downward after a bullish phase.

for beginners:
bos usually means continuation.
choch usually means possible reversal.

how to use the indicator

step 1: check the master trend

start with the dashboard.

if master is bullish, focus only on long ideas.
if master is bearish, focus only on short ideas.
if master is neutral, wait.

step 2: check the htf bias

the htf line shows whether the selected higher timeframe is bullish or bearish.

when the htf agrees with the master trend, the condition is cleaner.
when the htf disagrees, the tool can hold the master trend in neutral mode.

step 3: check the ribbon spread

flat ribbon:
avoid aggressive entries.

building ribbon:
look for confirmation.

strong ribbon:
trend conditions are more active.

step 4: wait for structure

a bos can confirm continuation.
a choch can show that the previous direction may be changing.

beginners should not enter only because a label appears. the label should be combined with context, trend direction, support and resistance, and risk management.

step 5: use internal entry markers

internal entry markers are early signals that appear only in the direction of the active filtered trend.

a long marker is only valid when the master trend is bullish.
a short marker is only valid when the master trend is bearish.

beginner example

example long setup:

1. master trend is bullish
2. htf bias is bullish
3. ribbon spread is building or strong
4. price breaks structure upward
5. a long entry marker appears
6. trader looks for a logical stop below the recent swing low
7. trader targets the next resistance, previous high, or a fixed risk/reward level

example short setup:

1. master trend is bearish
2. htf bias is bearish
3. ribbon spread is building or strong
4. price breaks structure downward
5. a short entry marker appears
6. trader looks for a logical stop above the recent swing high
7. trader targets the next support, previous low, or a fixed risk/reward level

main inputs

external swing strength:
controls the strength of the major swing structure. higher values create fewer but stronger structure signals. lower values create more responsive signals.

internal swing strength:
controls the smaller internal structure used for early entry markers. lower values are faster. higher values are cleaner but slower.

break confirmation:
choose whether structure breaks are confirmed by close or wick.

close:
more conservative.

wick:
more reactive.

bos pivot strength:
controls the pivot sensitivity used for bos continuation levels.

choch pivot strength:
controls the pivot sensitivity used for choch reversal levels.

htf timeframe:
selects the higher timeframe used for directional filtering.

htf ema length:
controls the ema used for the higher timeframe bias.

base ema length:
sets the first ema in the ribbon.

ema step:
controls the spacing between each ema in the ribbon.

ribbon lines:
turns the ribbon lines on or off.

ribbon fill:
turns the fill between ribbon layers on or off.

core glow:
adds a stronger visual emphasis to the main ribbon line.

external structure labels:
shows or hides bos and choch labels.

internal entry markers:
shows or hides early long and short markers.

live structure levels:
shows or hides the active major structure levels.

background tint:
adds a light background color based on the current master trend.

dashboard:
shows or hides the live panel.

dashboard position:
lets the trader place the panel in any chart position.

alerts

the script includes alerts for:

bullish choch
bearish choch
bullish bos
bearish bos
long entry
short entry

for best results, create alerts after the indicator is added to the chart and select the alert condition that matches your trading plan.

beginner tips

do not trade every signal.

use the indicator as a filter, not as a complete trading system.

avoid trading when the dashboard shows neutral.

avoid trading when the ribbon spread is flat.

look for agreement between master trend and htf bias.

always define stop loss, target, and invalidation before entering.

combine the tool with support and resistance, liquidity levels, volume, session context, or higher timeframe analysis.

important notes

this indicator is designed for market analysis and trend filtering.

it does not guarantee profitable trades.

signals can fail during news, low liquidity, sideways markets, or high volatility conditions.

risk management remains the responsibility of the trader.

the best use of this tool is to filter direction, read structure, and avoid trading against the dominant trend.

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。