OPEN-SOURCE SCRIPT

DUAL MOMENTUM

592
dual momentum

dual momentum is a visual momentum oscillator built to compare a fast momentum line and a slow momentum line inside a symmetric oscillator range.

the goal of this tool is to help traders read momentum expansion, momentum compression, bullish pressure, bearish pressure, crossovers, overbought areas and oversold areas in a clean separate pane.

this indicator is not a strategy and does not place trades. it does not predict the future and does not guarantee buy or sell signals. it is designed as a technical analysis tool for reading momentum context.

main idea

dual momentum uses a normalized price calculation to transform price movement into a bounded oscillator.

the fast line reacts more quickly to price movement.

the slow line reacts more slowly and gives a smoother momentum reference.

when the fast line is above the slow line, momentum is generally stronger on the bullish side.

when the fast line is below the slow line, momentum is generally stronger on the bearish side.

the distance between both lines helps show whether momentum is expanding or compressing.

what the indicator displays

fast momentum line

slow momentum line

bullish and bearish gradient fill

fast and slow spread ribbon

higher and lower flow bands

bull and bear rails

optional cross triangles

ob and os text markers

glow effect

separate buy and sell alert conditions

how to read the oscillator

the oscillator is centered around zero.

above zero, momentum is generally stronger.

below zero, momentum is generally weaker.

when the fast line crosses above the slow line, bullish momentum may be increasing.

when the fast line crosses below the slow line, bearish momentum may be increasing.

when both lines are far from zero, momentum is extended.

when both lines return toward zero, momentum is cooling down.

input guide

engine

source

selects the price source used for the main calculation.

common choices are close, open, high, low, hl2, hlc3 or ohlc4.

normalization window

sets how many bars are used to normalize price movement.

a higher value creates a smoother and more stable oscillator.

a lower value makes the oscillator more reactive but also more sensitive to noise.

fast smoothing

controls the speed of the fast momentum line.

lower values make the fast line react quickly.

higher values make the fast line smoother.

slow smoothing

controls the speed of the slow momentum line.

lower values make the slow line more reactive.

higher values make the slow line smoother and slower.

amplitude

controls how much the oscillator expands vertically.

higher values make the lines move farther from zero.

lower values keep the lines closer to the center.

range cap

sets the maximum positive and negative range of the oscillator.

this keeps the display symmetrical and prevents the lines from expanding too far.

flow bands

show higher / lower bands

shows or hides the upper and lower flow bands.

these bands help visualize where the oscillator is moving inside its higher and lower zones.

band length

sets the calculation length used for the flow bands.

a higher value makes the bands smoother.

a lower value makes the bands more reactive.

band smoothing

smooths the flow band calculation.

higher smoothing reduces noise.

lower smoothing reacts faster.

band inner edge

controls how deep the flow bands extend toward the center.

higher values create tighter bands.

lower values create larger bands.

bull / bear fill

gradient fill under line

shows or hides the bull and bear gradient fill around the oscillator.

this fill helps identify whether the oscillator is leaning bullish or bearish.

gradient transparency

controls the visibility of the gradient fill.

higher values make the fill lighter.

lower values make the fill stronger.

fast / slow spread ribbon

shows the colored ribbon between the fast and slow lines.

when fast is above slow, the ribbon uses the bullish color.

when fast is below slow, the ribbon uses the bearish color.

ribbons

show bull / bear rails

shows or hides the rail markers at the top and bottom of the oscillator pane.

these rails help show when the fast and slow spread becomes strong enough.

rail min strength

sets the minimum strength required before the rails appear.

higher values show fewer rail signals.

lower values show more rail signals.

signals

show cross triangles

shows or hides triangle markers when the fast line crosses the slow line.

this input is off by default to keep the chart cleaner.

show ob / os text

shows or hides overbought and oversold text markers.

the script displays only text markers, without boxes.

ob text appears above the upper rail.

os text appears below the lower rail.

overbought level

sets the level where the script can mark an ob event.

an ob event appears when the fast line crosses above this level.

oversold level

sets the level where the script can mark an os event.

an os event appears when the fast line crosses below this level.

glow

neon glow

shows or hides the glow around the fast and slow lines.

glow intensity

controls the strength of the glow.

higher values make the glow stronger.

lower values make it softer.

colors

fast / bull color

sets the color of the fast line and bullish visuals.

slow / bear color

sets the color of the slow line and bearish visuals.

buy triangle color

sets the color of the bullish triangle when cross triangles are enabled.

ob / os gold

sets the color of the ob and os text markers.

signals and alerts

buy condition

a buy condition happens when the fast line crosses above the slow line.

this does not mean automatic entry.

it only means the fast momentum line moved above the slow momentum line.

sell condition

a sell condition happens when the fast line crosses below the slow line.

this does not mean automatic exit or short entry.

it only means the fast momentum line moved below the slow momentum line.

ob condition

an ob condition happens when the fast line crosses above the overbought level.

this can show strong upside extension.

os condition

an os condition happens when the fast line crosses below the oversold level.

this can show strong downside extension.

beginner tutorial

step 1: start with the default settings

keep the default settings at first.

the default setup gives a balanced view between speed and smoothness.

step 2: watch the fast and slow lines

the fast line reacts first.

the slow line confirms the broader momentum direction.

when fast is above slow, bullish momentum is stronger.

when fast is below slow, bearish momentum is stronger.

step 3: use the zero line as balance

when both lines are above zero, momentum is generally positive.

when both lines are below zero, momentum is generally negative.

when both lines are close to zero, the market may be neutral or compressing.

step 4: read the spread ribbon

the ribbon between fast and slow shows the momentum spread.

a wider ribbon means stronger separation.

a smaller ribbon means momentum is compressing.

step 5: read the rails

rails appear when the fast and slow difference becomes strong enough.

bull rails show stronger bullish spread.

bear rails show stronger bearish spread.

step 6: use ob and os as extension warnings

ob means the fast line has reached an overbought extension area.

os means the fast line has reached an oversold extension area.

these markers are not automatic reversal signals.

they only show that momentum reached an extreme area.

step 7: use cross triangles only when needed

cross triangles are off by default.

turn them on only if you want visual markers for fast and slow crosses.

for a cleaner chart, keep them disabled and focus on the lines and ribbon.

step 8: confirm with price action

before using any signal, check the price chart.

look for trend direction, support and resistance, market structure, candle close and volume reaction.

do not use the oscillator alone.

example 1: bullish momentum shift

the fast line crosses above the slow line.

the spread ribbon turns bullish.

the oscillator is moving above zero.

this can suggest that bullish momentum is increasing.

a beginner should then check if price is also making higher highs or higher lows.

example 2: bearish momentum shift

the fast line crosses below the slow line.

the spread ribbon turns bearish.

the oscillator is moving below zero.

this can suggest that bearish momentum is increasing.

a beginner should then check if price is also making lower highs or lower lows.

example 3: overbought extension

the fast line crosses above the overbought level.

the script prints ob text above the rail.

this means momentum is stretched upward.

it does not mean price must reverse immediately.

a beginner should wait for rejection, loss of momentum or a structure shift before making any decision.

example 4: oversold extension

the fast line crosses below the oversold level.

the script prints os text below the rail.

this means momentum is stretched downward.

it does not mean price must reverse immediately.

a beginner should wait for support reaction, momentum recovery or a structure shift before making any decision.

example 5: compression before expansion

the fast and slow lines move close together near zero.

the spread ribbon becomes small.

this can show momentum compression.

if the fast line later separates strongly from the slow line, momentum may begin expanding again.

recommended beginner workflow

first, identify the market trend on the price chart.

second, check whether the oscillator is above or below zero.

third, compare the fast line with the slow line.

fourth, read the spread ribbon.

fifth, check for ob or os extension.

sixth, confirm with support, resistance, structure and candle close.

seventh, define risk before any trade idea.

best use cases

reading momentum direction

spotting momentum expansion

spotting momentum compression

watching fast and slow line crosses

identifying overbought and oversold extensions

supporting trend continuation analysis

supporting reversal watch zones

building simple momentum alerts

important notes

ob does not automatically mean sell.

os does not automatically mean buy.

cross triangles are only visual momentum markers.

the oscillator should be used with price action and risk management.

higher settings make the tool smoother.

lower settings make the tool faster.

no indicator can guarantee future market direction.

risk note

this indicator is for technical analysis and educational market study only. it does not provide financial advice, investment advice or guaranteed trading signals. all signals, levels, labels and alerts are references that require independent confirmation and proper risk management.

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.