รูปแบบชาร์ต
Trend Speed Analyzer + alerts//@version=6
indicator('Trend Speed Analyzer + alerts', overlay = false)
//~~}
// ~~ Tooltips {
string t1 = 'Maximum Length: This parameter sets the upper limit for the number of bars considered in the dynamic moving average. A higher value smooths out the trend line, making it less reactive to minor fluctuations but slower to adapt to sudden price movements. Use higher values for long-term trend analysis and lower values for faster-moving markets.'
string t2 = 'Accelerator Multiplier: Adjusts the responsiveness of the dynamic moving average to price changes. A larger value makes the trend more reactive but can introduce noise in choppy markets. Lower values create a smoother trend but may lag behind rapid price movements. This is particularly useful in volatile markets where precise sensitivity is needed.'
string t5 = 'Enable Candles: When enabled, the candlesticks on the chart will be color-coded based on the calculated trend speed. This provides a visual representation of momentum, making it easier to spot shifts in market dynamics. Disable this if you prefer the standard candlestick colors.'
string t6 = 'Collection Period: Defines the number of bars used to normalize trend speed values. A higher value includes a broader historical range, smoothing out the speed calculation. Lower values make the speed analysis more sensitive to recent price changes, ideal for short-term trading.'
string t7 = 'Enable Table: Activates a statistical table that provides an overview of key metrics, such as average wave height, maximum wave height, dominance, and wave ratios. Useful for traders who want numerical insights to complement visual trend analysis.'
string t8 = 'Lookback Period: Determines how many historical bars are used for calculating bullish and bearish wave data. A longer lookback period provides a more comprehensive view of market trends but may dilute sensitivity to recent market conditions. Shorter periods focus on recent data.'
string t9 = 'Start Date: Sets the starting point for all calculations. This allows you to analyze data only from a specific date onward, which is useful for isolating trends within a certain period or avoiding historical noise.'
string t10 = 'Timer Option: Select between using a custom start date or starting from the first available bar on the chart. The \'Custom\' option works with the Start Date setting, while \'From start\' includes all available data.'
// Tooltips for Table Cells
string tt1 = 'Average Wave: Shows the average size of bullish or bearish waves during the lookback period. Use this to assess overall market strength. Larger values indicate stronger trends, and comparing bullish vs bearish averages can reveal market bias. For instance, a higher bullish average suggests a stronger uptrend.'
string tt2 = 'Max Wave: Displays the largest bullish or bearish wave during the lookback period. Use this to identify peak market momentum. A significantly higher bullish or bearish max wave indicates where the market may have shown extreme trend strength in that direction.'
string tt3 = 'Current Wave Ratio (Average): Compares the current wave\'s size to the average wave size for both bullish and bearish trends. A value above 1 indicates the current wave is stronger than the historical average, which may signal increased market momentum. Use this to evaluate if the current move is significant compared to past trends.'
string tt4 = 'Current Wave Ratio (Max): Compares the current wave\'s size to the maximum wave size for both bullish and bearish trends. A value above 1 suggests the current wave is setting new highs in strength, which could indicate a breakout or strong momentum in the trend direction.'
string tt5 = 'Dominance (Average): The net difference between the average bullish and bearish wave sizes. Positive values suggest bullish dominance over time, while negative values indicate bearish dominance. Use this to determine which side (bulls or bears) has had consistent control of the market over the lookback period.'
string tt6 = 'Dominance (Max): The net difference between the largest bullish and bearish wave sizes. Positive values suggest bulls have dominated with stronger individual waves, while negative values indicate bears have produced stronger waves. Use this to gauge the most significant power shifts in the market.'
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
max_length = input.int(50, minval = 1, title = 'Maximum Length', group = 'Dynamic Moving Average', tooltip = t1)
accel_multiplier = input.float(5.0, minval = 0.0, step = 1.1, title = 'Accelerator Multiplier', group = 'Dynamic Moving Average', tooltip = t2)
tbl_ = input.bool(true, title = 'Enable Table', group = 'Wave Analysis', tooltip = t7)
lookback_period = input.int(100, minval = 1, step = 1, title = 'Lookback Period', group = 'Wave Analysis', tooltip = t8)
candle = input.bool(true, title = 'Enable Candles', group = 'Trend Visualization', tooltip = t5)
collen = input.int(100, step = 10, minval = 5, title = 'Collection Period', group = 'Trend Visualization', tooltip = t6)
up_col = input.color(color.lime, title = 'Dynamic Trend', group = 'Trend Visualization', inline = 'Trend')
dn_col = input.color(color.red, title = '', group = 'Trend Visualization', inline = 'Trend')
up_hist_col = input.color(#82ffc3, title = 'Trend Speed Up', group = 'Trend Visualization', inline = 'up')
up_hist_col_ = input.color(color.lime, title = '', group = 'Trend Visualization', inline = 'up')
dn_hist_col = input.color(color.red, title = 'Trend Speed Dn', group = 'Trend Visualization', inline = 'dn')
dn_hist_col_ = input.color(#f78c8c, title = '', group = 'Trend Visualization', inline = 'dn')
start = input.time(timestamp('1 Jan 2020 00:00 +0000'), title = 'Start Date', group = 'Time Settings', tooltip = t9, inline = 'startdate')
timer = input.string('From start', title = 'Timer Option', options = , group = 'Time Settings', tooltip = t10, inline = 'startdate')
// ~~ Dynamic Average {
counts_diff = close
max_abs_counts_diff = ta.highest(math.abs(counts_diff), 200)
counts_diff_norm = (counts_diff + max_abs_counts_diff) / (2 * max_abs_counts_diff)
dyn_length = 5 + counts_diff_norm * (max_length - 5)
// ~~ Function to compute the accelerator factor with normalization of delta_counts_diff {
calc_accel_factor(float counts_diff, float prev_counts_diff) =>
delta_counts_diff = math.abs(counts_diff - prev_counts_diff)
float max_delta_counts_diff = ta.highest(delta_counts_diff, 200)
max_delta_counts_diff := max_delta_counts_diff == 0 ? 1 : max_delta_counts_diff
float accel_factor = delta_counts_diff / max_delta_counts_diff
accel_factor
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Function to adjust alpha using the accelerator factor {
adjust_alpha(float dyn_length, float accel_factor, float accel_multiplier) =>
alpha_base = 2 / (dyn_length + 1)
alpha = alpha_base * (1 + accel_factor * accel_multiplier)
alpha := math.min(1, alpha)
alpha
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Accelerator Factor
accel_factor = calc_accel_factor(counts_diff, nz(counts_diff ))
alpha = adjust_alpha(dyn_length, accel_factor, accel_multiplier)
// ~~ Compute dynamic Ema
var float dyn_ema = na
dyn_ema := na(dyn_ema ) ? close : alpha * close + (1 - alpha) * dyn_ema
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Trend Speed {
trend = dyn_ema
bullsrc = close
bearsrc = close
type TrendData
array change
array t
StartTime() =>
time > start
var bullish = TrendData.new(array.new(), array.new())
var bearish = TrendData.new(array.new(), array.new())
var x1 = int(na)
var y1 = float(na)
var pos = 0
var speed = 0.0
c = ta.rma(close, 10)
o = ta.rma(open, 10)
// ~~ First value {
if na(x1) and StartTime() or na(x1) and timer == 'From start'
x1 := bar_index
y1 := o
y1
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Trend direction {
if StartTime() or timer == 'From start'
if bullsrc > trend and bullsrc <= trend
bearish.change.unshift(ta.lowest(speed, bar_index - x1))
bearish.t.unshift(bar_index - x1)
x1 := bar_index
y1 := bullsrc
pos := 1
speed := c - o
speed
if bearsrc < trend and bearsrc >= trend
bullish.change.unshift(ta.highest(speed, bar_index - x1))
bullish.t.unshift(bar_index - x1)
x1 := bar_index
y1 := bearsrc
pos := -1
speed := c - o
speed
speed := speed + c - o
speedGradient = color.from_gradient(speed, ta.min(-speed / 3), ta.max(speed / 3), color.red, color.lime)
trendspeed = ta.hma(speed, 5)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Plots {
rma_dyn_ema(x, p) =>
average = ta.rma(dyn_ema , p)
average
colour = ta.wma(close, 2) > dyn_ema ? up_col : dn_col
fillColor = rma_dyn_ema(0, 5) > rma_dyn_ema(1, 5) ? color.new(up_col, 70) : color.new(dn_col, 70)
p1 = plot(dyn_ema, color = colour, linewidth = 2, title = 'Dynamic Trend', force_overlay = true)
p2 = plot(ta.rma(hl2, 50), display = display.none, editable = false, force_overlay = true)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
min_speed = ta.lowest(speed, collen)
max_speed = ta.highest(speed, collen)
normalized_speed = (speed - min_speed) / (max_speed - min_speed)
speedGradient1 = speed < 0 ? color.from_gradient(normalized_speed, 0.0, 0.5, dn_hist_col, dn_hist_col_) : color.from_gradient(normalized_speed, 0.5, 1.0, up_hist_col, up_hist_col_)
plot(StartTime() or timer == 'From start' ? trendspeed : na, title = 'Trend Speed', color = speedGradient1, style = plot.style_columns)
plotcandle(open, high, low, close, color = candle ? speedGradient1 : na, wickcolor = candle ? speedGradient1 : na, bordercolor = candle ? speedGradient1 : na, force_overlay = true)
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
// ~~ Table {
if barstate.islast and tbl_
bullish_recent = bullish.change.slice(0, math.min(lookback_period, bullish.change.size()))
bearish_recent = bearish.change.slice(0, math.min(lookback_period, bearish.change.size()))
bull_max = bullish_recent.max()
bear_max = bearish_recent.min()
bull_avg = bullish_recent.avg()
bear_avg = bearish_recent.avg()
wave_size_ratio_avg = bull_avg / math.abs(bear_avg)
wave_size_text_avg = str.tostring(math.round(wave_size_ratio_avg, 2)) + 'x'
wave_size_color_avg = wave_size_ratio_avg > 0 ? color.lime : color.red
wave_size_ratio_max = bull_max / math.abs(bear_max)
wave_size_text_max = str.tostring(math.round(wave_size_ratio_max, 2)) + 'x'
wave_size_color_max = wave_size_ratio_max > 0 ? color.lime : color.red
dominance_avg_value = bull_avg - math.abs(bear_avg)
dominance_avg_text = dominance_avg_value > 0 ? 'Bullish +' + str.tostring(math.round(wave_size_ratio_avg, 2)) + 'x' : 'Bearish -' + str.tostring(math.round(1 / wave_size_ratio_avg, 2)) + 'x'
dominance_avg_color = dominance_avg_value > 0 ? color.lime : color.red
dominance_max_value = bull_max - math.abs(bear_max)
dominance_max_text = dominance_max_value > 0 ? 'Bullish +' + str.tostring(math.round(wave_size_ratio_max, 2)) + 'x' : 'Bearish -' + str.tostring(math.round(1 / wave_size_ratio_max, 2)) + 'x'
dominance_max_color = dominance_max_value > 0 ? color.lime : color.red
current_wave = speed
current_wave_color = current_wave > 0 ? color.lime : color.red
current_ratio_avg = current_wave > 0 ? current_wave / bull_avg : current_wave / math.abs(bear_avg)
current_ratio_max = current_wave > 0 ? current_wave / bull_max : current_wave / math.abs(bear_max)
current_text_avg = str.tostring(math.round(current_ratio_avg, 2)) + 'x'
current_text_max = str.tostring(math.round(current_ratio_max, 2)) + 'x'
current_color_avg = current_ratio_avg > 0 ? color.lime : color.red
current_color_max = current_ratio_max > 0 ? color.lime : color.red
var tbl = table.new(position.top_right, 3, 3, force_overlay = true)
table.cell(tbl, 0, 0, '', text_color = chart.fg_color, tooltip = '')
table.cell(tbl, 0, 1, 'Average Wave', text_color = chart.fg_color, tooltip = tt1)
table.cell(tbl, 0, 2, 'Max Wave', text_color = chart.fg_color, tooltip = tt2)
table.cell(tbl, 1, 0, 'Current Wave Ratio', text_color = chart.fg_color, tooltip = '')
table.cell(tbl, 1, 1, current_text_avg, text_color = current_color_avg, tooltip = tt3)
table.cell(tbl, 1, 2, current_text_max, text_color = current_color_max, tooltip = tt4)
table.cell(tbl, 2, 0, 'Dominance', text_color = chart.fg_color, tooltip = '')
table.cell(tbl, 2, 1, dominance_avg_text, text_color = dominance_avg_color, tooltip = tt5)
table.cell(tbl, 2, 2, dominance_max_text, text_color = dominance_max_color, tooltip = tt6)
// ─────────────────────────────────────────────────────────────
// MTF BUY/SELL alerts: 10m & 1H agreement (no logic changes)
isGreen = ta.wma(close, 2) > dyn_ema
tf_fast = input.timeframe("10", "Fast TF (Buy/Sell check)", group = "MTF Alerts")
tf_slow = input.timeframe("60", "Slow TF (Buy/Sell check)", group = "MTF Alerts")
confirm_on_close = input.bool(true, "Confirm on bar close", group = "MTF Alerts")
green_fast = request.security(syminfo.tickerid, tf_fast, isGreen, lookahead = barmerge.lookahead_off)
green_slow = request.security(syminfo.tickerid, tf_slow, isGreen, lookahead = barmerge.lookahead_off)
buyCond = green_fast and green_slow
sellCond = not green_fast and not green_slow
triggerOK = confirm_on_close ? barstate.isconfirmed : true
// Single BUY / SELL alerts (messages unchanged)
alertcondition(buyCond and triggerOK, title = "MTF BUY (10m & 1H GREEN)", message = "{{ticker}} | TF={{interval}} | Dynamic line")
alertcondition(sellCond and triggerOK, title = "MTF SELL (10m & 1H RED)", message = "{{ticker}} | TF={{interval}} | Dynamic line")
// ─────────────────────────────────────────────────────────────
// NEW: 10m status repeated EVERY MINUTE (no logic changes)
// ─────────────────────────────────────────────────────────────
// 1-minute pulse: true once per closed 1m bar
m1_pulse = request.security(syminfo.tickerid, "1", barstate.isconfirmed, lookahead = barmerge.lookahead_off)
// Repeat ONLY the 10-minute status every minute
status10_green = green_fast
status10_red = not green_fast
alertcondition(status10_green and m1_pulse, title = "10m Status GREEN — repeat each minute", message = "{{ticker}} | TF=10 | Dynamic line — GREEN")
alertcondition(status10_red and m1_pulse, title = "10m Status RED — repeat each minute", message = "{{ticker}} | TF=10 | Dynamic line — RED")
how do the trend speed anlaysis work
Multi-Timeframe Dual MA Downside DetectorThis indicator is designed to highlight potential downside moves using two customizable moving averages (MA1 and MA2) across multiple timeframes. It works on any chart and provides a visual cue when the price is trading below both selected moving averages on a red/down candle.
Key Features:
Dual Moving Averages: Supports EMA, SMA, VWMA, and HMA for both MA1 and MA2.
Multi-Timeframe Support: Each moving average can be calculated on a different timeframe, allowing higher timeframe trend context on lower timeframe charts.
Downside Detection: Highlights candles where the close is below both moving averages and forms a down candle (close < open).
Visual Signals:
Plots MA1 (orange) and MA2 (blue) on the chart.
Colors the downside candles blue when the price is below both MAs.
Customizable: Easily adjust the MA type, length, and timeframe to suit your trading style.
Usage:
Helps identify strong bearish conditions or potential pullbacks.
Can be combined with other technical analysis tools for trend confirmation.
Works across any market, instrument, or timeframe
MSRanges📖 Market Structure with Ranges —
What this script does
This indicator highlights market structure on any symbol or timeframe. It automatically marks:
Swing points: Higher High (HH), Lower High (LH), Higher Low (HL), Lower Low (LL).
Break of Structure (BOS) and optional Change of Character (CHoCH) events.
Price ranges: each new swing label shows the difference from the last swing in price units (e.g. HH (54.8) or LL (-169.5)).
This lets you see at a glance whether the market is trending, consolidating, or shifting character.
How it works
Pivot detection
Uses TradingView’s ta.pivothigh / ta.pivotlow with a user-set Swing Length.
A pivot is confirmed only after the right-hand bars pass, so labels appear with a delay equal to Swing Length.
Swing classification
Each new pivot is compared with the previous pivot:
If a new high is higher than the last → HH.
If a new high is lower → LH.
If a new low is higher → HL.
If a new low is lower → LL.
Break of Structure (BOS)
A BOS is drawn when price closes (or wicks, depending on settings) beyond a previous swing.
The first BOS against trend can optionally be labelled CHoCH.
Range calculation
When a new swing is confirmed, the script prints the difference between that pivot and the previous swing.
Example: HL at 24,600 → HH at 24,655 → label shows HH (55).
Inputs & customization
Swing Length: bars left/right used to confirm pivots. Larger = fewer, more reliable swings; smaller = more signals, more noise.
BOS Confirmation: choose whether a BOS requires a full candle close or just a wick beyond the level.
Show CHoCH: toggle whether the first countertrend BOS is renamed CHoCH.
Show Swing Points: show/hide HH / LH / HL / LL labels.
BOS Style Settings: customize color, line style, and width.
How to use in practice
Trend identification:
Uptrend → repeating HL → HH sequence.
Downtrend → repeating LH → LL.
Breakout confirmation:
A BOS confirms continuation. Retests of BOS lines often act as support/resistance.
Reversal watch:
A CHoCH can signal possible trend shift. Wait for confirmation from price action or higher timeframe structure.
Range analysis:
The range numbers help compare move sizes. If swings shrink, market may be consolidating; if they expand, volatility is rising.
Best practices
Combine with higher timeframe analysis: use HTF trend, then refine entries on LTF.
Always confirm with other tools (volume, RSI, order flow) before trading.
Adjust Swing Length for the symbol and timeframe you trade.
Use risk management — never rely on a single indicator.
Technical notes
Pivots are not predictive — they appear only after confirmation. This avoids repainting but introduces lag.
Many labels/lines can impact chart performance; the script sets sensible max_labels_count and max_lines_count.
Designed for clarity, not signals. It does not issue buy/sell calls.
Disclaimer
This script is for educational purposes only . It is not financial advice and should not be used as a sole basis for trading decisions. Past performance of any method or indicator does not guarantee future results. Always test on demo accounts and apply proper risk management.
A2 By Gadirov Optimized Traffic Light Signal - POS for binaryA2 By Gadirov Optimized Traffic Light Signal - POS for binary
Rolling Highest + Qualified Ghost (price-synced)[돌파]English Guide
What this indicator does
Plots a rolling highest line hh = ta.highest(src, len) that step-changes whenever the highest value inside the last len bars changes.
When a step ends after being flat for at least minHold bars (a “plateau”), it draws a short horizontal ghost line for ghostLen bars to the right at the previous step level.
By default, the ghost appears only on step-down events (behaves like a short-lived resistance trace). You can allow both directions with the onlyOnDrop setting.
Everything is rendered with plot() series (not drawing objects), bound to the right price scale → it moves perfectly with the chart.
Inputs
len — Lookback window (bars) for the rolling highest.
basis — Price basis used to compute the highest: High / Close / HLC3 / OHLC4.
minHold — Minimum plateau length (bars). Only steps that stayed flat at least this long qualify for a ghost.
ghostLen — Number of bars to keep the horizontal ghost to the right.
onlyOnDrop — If true, make ghosts only when the step moves down (default). If false, also create ghosts on step-ups.
Visuals: mainColor/mainWidth for the main rolling highest line; ghostColor/ghostTrans/ghostWidth for the ghost.
How it works (logic)
Rolling highest:
hh = ta.highest(src, len) produces a stair-like line.
Step detection:
stepUp = hh > hh
stepDown = hh < hh
startUp / startDown mark the first bar of a new step (prevents retriggering while the step continues).
Plateau length (runLen):
Counts consecutive bars where hh remained equal:
runLen := (hh == hh ) ? runLen + 1 : 1
Qualification:
On the first bar of a step change, check previous plateau length prevHold = runLen .
If prevHold ≥ minHold and direction matches onlyOnDrop, start a ghost:
ghostVal := hh (the previous level)
ghostLeft := ghostLen
Ghost series:
While ghostLeft > 0, output ghostVal; otherwise output na.
It’s plotted with plot.style_linebr so the line appears as short, clean horizontal segments instead of connecting across gaps.
Why it stays synced to price
The indicator uses overlay=true, scale=scale.right, format=format.price, and pure series plot().
No line.new() objects → no “stuck on screen” behavior when panning/zooming.
Tips & customization
If your chart is a line chart (close), set basis = Close so visuals align perfectly.
Want ghosts on both directions? Turn off onlyOnDrop.
Make ghosts subtler by increasing ghostTrans (e.g., 60–80).
If ghosts appear too often or too rarely, tune minHold and len.
Larger minHold = only long, meaningful plateaus will create ghosts.
Edge cases
If len is very small or the market is very volatile, plateaus may be rare → fewer ghosts.
If the stair level changes almost every few bars, raise len or minHold.
한글 설명서
기능 요약
최근 len개 바 기준의 롤링 최고가 hh를 그립니다. 값이 바뀔 때마다 계단식(step)으로 변합니다.
어떤 계단이 최소 minHold봉 이상 유지된 뒤 스텝이 끝나면, 직전 레벨을 기준으로 우측 ghostLen봉짜리 수평선(고스트) 을 그립니다.
기본값은 하락 스텝에서만 고스트를 생성(onlyOnDrop=true). 꺼두면 상승 스텝에서도 만듭니다.
전부 plot() 시리즈 기반 + 우측 가격 스케일 고정 → 차트와 완전히 동기화됩니다.
입력값
len — 롤링 최고가 계산 윈도우(바 수).
basis — 최고가 계산에 사용할 기준: High / Close / HLC3 / OHLC4.
minHold — 플래토(같은 값 유지) 최소 길이. 이 이상 유지된 스텝만 고스트 대상.
ghostLen — 우측으로 고스트를 유지할 바 수.
onlyOnDrop — 체크 시 하락 스텝에서만 고스트 생성(기본). 해제하면 상승 스텝도 생성.
표시 옵션: 본선(mainColor/mainWidth), 고스트(ghostColor/ghostTrans/ghostWidth).
동작 원리
롤링 최고가:
hh = ta.highest(src, len) → 계단형 라인.
스텝 변화 감지:
stepUp = hh > hh , stepDown = hh < hh
startUp / startDown 으로 첫 바만 잡아 중복 트리거 방지.
플래토 길이(runLen):
hh가 같은 값으로 연속된 길이를 누적:
runLen := (hh == hh ) ? runLen + 1 : 1
자격 판정:
스텝이 바뀌는 첫 바에서 직전 플래토 길이 prevHold = runLen 가 minHold 이상이고, 방향이 설정(onlyOnDrop)과 맞으면 고스트 시작:
ghostVal := hh (직전 레벨)
ghostLeft := ghostLen
고스트 출력:
ghostLeft > 0 동안 ghostVal을 출력, 아니면 na.
plot.style_linebr로 짧은 수평 구간만 보이게 합니다(NA 구간에서 선을 끊음).
가격과 동기화되는 이유
overlay=true, scale=scale.right, format=format.price로 가격 스케일에 고정, 그리고 모두 plot() 시리즈로 그립니다.
line.new() 같은 도형 객체를 쓰지 않아 스크롤/줌 시 화면에 박히는 현상이 없습니다.
활용 팁
차트를 라인(종가) 로 보신다면 basis = Close로 맞추면 시각적으로 더욱 정확히 겹칩니다.
고스트가 너무 자주 나오면 minHold를 올리거나 len을 키워서 스텝 빈도를 낮추세요.
고스트를 더 은은하게: ghostTrans 값을 크게(예: 60–80).
저항/지지 라인처럼 보이게 하려면 기본 설정(onlyOnDrop=true)이 잘 맞습니다.
주의할 점
변동성이 큰 종목/타임프레임에선 플래토가 짧아 고스트가 드물 수 있습니다.
len이 너무 작으면 스텝이 잦아져 노이즈가 늘 수 있습니다.
ORB + Prev Close — [GlutenFreeCrypto]Draws a red line at the high of the first 5 min candle, draws a green line at the bottom of the first 5 min candle, draws a grey line at midpoint. Lines extend until market close (4pm) or after-hours 98pm) or extend the next day pre-market (until 9:30am). Closing blue dotted line is drawn at closing price, and extends in after-hours and pre-market.
DBO_Prod Updated Sept 27Added News Day Support, has support for variable sizing on recoup trading. This does a opposite trade using YM in real time, but keeps MYM on historical bars.
Known bug: On the historical view, I'm getting a ghost trade causing results to be 13% inflated.
Index Day Ranges (Selectable - Universal Live Update)it helps to show the days range so we can take decision accordingly
XAUUSD CSI+RSI+Delta (15m)XAUUSD 15m
Candle Stability Index: 0.4
RSI Index: 80
Candle Delta Length: 6
Disable Repeating Signals: Enabled
Jasons Bullish Reversal DetectorThis bullish reversal detector is designed to spot higher-quality turning points instead of shallow bounces. At its core, it looks for candles closing above the 20-period SMA, a MACD bullish crossover, and RSI strength above 50. On top of that, it layers in “depth” filters: price must reclaim and retest a long-term baseline (like the 200-period VWMA), momentum should confirm with RSI and +DI leading, short-term EMAs need to slope upward, and conditions like overheated ATR or strong downside ADX will block false signals. When all of these align, the script flags a depth-confirmed bullish reversal, aiming to highlight spots where structure, momentum, and volatility all support a sustainable shift upward.
Fractal Strength OscillatorThe Fractal Strength Oscillator Indicator combines the Relative Strength Index (RSI) and Fractal Dimension Index (FDI) to identify market momentum and trend direction. By integrating RSI's momentum signals with FDI's fractal-based trend analysis, this indicator provides clear visual cues for bullish and bearish conditions through colored plots and price bars.
How It Works
RSI Calculation: Computes RSI based on a user-selected price source (default: Close) over a configurable period. Optional smoothing with various moving average types (e.g., SMA, EMA, ALMA) enhances signal clarity.
FDI Calculation: Measures market complexity using a fractal dimension over a user-defined period (default: 20). A threshold (default: 1.45) determines trend strength.
Trend Logic
Bullish Signal: RSI > 55 or FDI < threshold indicates upward momentum
Bearish Signal: RSI < 45 or FDI > threshold indicates downward momentum
Customization & Parameters
RSI Parameters: RSI length, smoothing option , MA type, MA length, ALMA sigma
FDI Parameters: FDI length, trend threshold.
Trading Applications
Momentum Trading: Use RSI and FDI signals for entry/exit points.
Trend Confirmation: Bar coloring aligns with trend signals.
Reversal Detection: Identify shifts when RSI or FDI crosses thresholds
Final Note
The Fractal Strength Oscillator Indicator is a straightforward tool for traders seeking momentum and trend insights. Its combination of RSI, FDI, and visual cues supports informed trading decisions. Backtest thoroughly and use within a broader strategy. This indicator is for educational purposes and not financial advice.
Validated Order Blocks with Fib LevelsThis indicator automatically identifies and displays Smart Money Concepts (SMC) order blocks based on market structure breaks:
How it works:
Bearish Order Blocks (Red): Marks the last bullish candle before a swing high. The OB becomes valid when price breaks below the previous swing low, indicating institutional selling zones. Drawn from the candle's close (body top) to its low (bottom wick).
Bullish Order Blocks (Green): Marks the last bearish candle before a swing low. The OB becomes valid when price breaks above the previous swing high, indicating institutional buying zones. Drawn from the candle's high (top wick) to its close (body bottom).
Features:
Three Fibonacci retracement levels (50%, 75%, 100%) for each order block
Fib 100% faces downward on bearish OBs and upward on bullish OBs
Auto-validation: OBs are removed when price closes through them
Customizable: Adjustable swing detection, timeframe selection, and OB display limits
Optional Break of Structure (BOS) markers to show when OBs activate
Works on any timeframe with HTF analysis support
Perfect for identifying key institutional support/resistance zones and potential reversal areas.
A5 By Gadirov TLS Super Binary EURUSD 15mA5 By Gadirov TLS Super Binary EURUSD 15minute and 1 minute
A4 By Gadirov TLS Aggressive EURUSD 15m for binaryA4 By Gadirov TLS Aggressive EURUSD 15m for binary
A1 By Gadirov Reversal T L S - POST (Optimized) for binary By Gadirov Reversal T L S - POST (Optimized) for binary 1 minute
Time Cycles (90/30/10)This indicator plots hierarchical market cycles inside the 07:00 – 11:00 session (UTC-4), tailored for intraday NASDAQ trading on the 1-minute chart.
🔹 Cycles included:
90-minute cycle (primary)
30-minute cycles nested inside the 90m
10-minute cycles nested inside the 30m
🔹 Features:
Session-based: automatically resets daily at 07:00
Strict cutoff at 11:00 (no cycles extend past session close)
Adaptive box coloring to distinguish between nested cycles
Dynamic highs and lows: cycle boxes expand as new bars print
🔹 Use cases:
Visualize intraday rhythm & price structure
Spot potential turning points within nested timeframes
Enhance trade timing with cycle alignment
Trend ScalperThe Trend Scalper is a simple EMA-based trend-following and scalping indicator designed to help traders identify potential long and short trading opportunities on any timeframe. It uses a three-EMA strategy to filter trades in the direction of the prevailing trend while refining entry signals based on price reactions to the EMAs.
Here’s how it works:
It calculates three Exponential Moving Averages (EMA) with customizable lengths (default: 9, 21, and 89).
A long signal is generated when the EMAs align in bullish order (EMA1 > EMA2 > EMA3) and the price low dips into the zone between EMA1 and EMA2. This indicates a pullback into short-term support while the broader trend remains bullish.
A short signal is generated when the EMAs align in bearish order (EMA1 < EMA2 < EMA3) and the price high rises into the zone between EMA1 and EMA2. This indicates a pullback into resistance within a bearish trend.
The EMAs are plotted on the chart for visual guidance, while buy and sell signals are displayed as up and down triangles directly on price bars.
Best use practices:
The indicator works best as a trend continuation scalping tool, aiming to join established market direction after minor pullbacks.
It is most effective on liquid assets and in trending market conditions. Avoid relying on signals during sideways or choppy markets.
For confirmation, combine with volume, momentum oscillators, or higher timeframe trend analysis.
Risk management is critical: consider setting stop losses beyond EMA zones or recent swing highs/lows, and use take profits that match your risk-reward plan.
This indicator provides clean, rule-based signals that help traders time entries within the broader context of the trend. It is not a standalone strategy but a tool to assist in disciplined trade execution.
Watermark with Session Boxes (by Rufi)Watermark & Session Boxes - Chart Branding Tool
What it does: Combines professional chart watermarking with automated trading session visualization for clean, branded analysis.
Key Features:
Smart Session Boxes: Auto-draws boxes around Asia (8PM-11:59PM), London (2AM-5AM), and NY (7AM-10AM) sessions using high/low detection
Custom Watermark: Professional text overlay with your brand/tagline
Full Customization: Adjustable colors, transparency (0-100%), and display limits (1-30 days)
How it works: Uses Pine Script's time() function to detect session periods, tracks price extremes during each session, then draws filled rectangles from session high to low. Perfect for identifying key support/resistance levels from major trading periods.
Best for: Intraday traders who want branded charts with clear session-based S/R levels. Ideal for forex, indices, and crypto on lower timeframes.
Mystic Pulse V2.0 [CHE] Mystic Pulse V2.0 — Adaptive DI streaks with gradient intensity for clearer trend persistence
Summary
Mystic Pulse V2.0 measures directional persistence by counting how often the positive or negative directional index strengthens and dominates. These counts drive gradient colors for bars, wicks, and helper plots, so intensity reflects local momentum rather than absolute values. A windowed normalization and gamma control adapt the visuals to recent conditions, preventing one regime from overpowering the next. The result is an immediate, at-a-glance read of trend direction and stamina without relying on crossovers alone.
Motivation: Why this design?
Classical DI and ADX signals can flip during choppy phases or feel sluggish in calm regimes. This script focuses on persistence: it increments a positive or negative streak only when the corresponding directional pressure both strengthens compared with the prior bar and dominates the other side. Simple OHLC pre-smoothing reduces micro-noise, and local normalization keeps the scale relevant to the last segment of data, not a distant past.
What’s different vs. standard approaches?
Reference baseline: Traditional DI and ADX lines with crossovers and fixed-scale thresholds.
Architecture differences:
Wilder-style recursive smoothing on true range and directional movement.
Streak counters for positive and negative pressure that advance only on strengthening and dominance.
Windowed normalization and gamma shaping for visual intensity.
Wick coloring via `plotcandle` with forced overlay from a pane indicator.
Practical effect: Bars and wicks grow more vivid during sustained pressure and fade during indecision. The column plots show streak depth directly, which helps filter one-bar flips.
How it works (technical)
1. Pre-smoothing: Open, high, low, and close are averaged over a short simple moving window to dampen micro-ticks.
2. Directional inputs: True range and directional movement are formed from the smoothed prices, then recursively smoothed using a Wilder-style update that carries prior state forward.
3. DI comparison: The script derives positive and negative directional ratios relative to smoothed range. A side advances its streak when it increases compared with the previous bar and exceeds the opposite side. The other streak resets.
4. Trend score and color base: The difference between positive and negative streaks defines the active side.
5. Normalization and gamma: The absolute streak magnitude and each side’s streak are normalized within a rolling window. Gamma parameters reshape intensity so mid-range values are either compressed or emphasized.
6. Rendering:
Two column plots show positive and negative streak counts in the pane with gradient colors.
A square marker at the bottom uses the global gradient as a compact heat cue.
Bar colors on the main chart use either the gradient, neutral trend colors, or no paint depending on toggles.
Wick, border, and candle overlays are colored via `plotcandle` with forced overlay.
7. State handling: Smoothed values and counters persist across bars; initialization uses first available values without lookahead. No higher-timeframe requests are used, so repaint risk is limited to normal live-bar evolution.
Parameter Guide
Show neutral candles (fallback) — Paints main-chart bars in plain up or down colors when gradients are disabled — Default false — Use when you prefer simple up/down coloring.
Show last N shapes — Limits bottom square markers — Default 333 — Reduce if your chart gets cluttered.
ADX smoothing length — Controls the Wilder smoothing window for range and directional movement — Default 9 — Larger values increase stability but respond later.
OHLC SMA length — Pre-smoothing for inputs — Default 1 — Increase slightly on noisy assets to reduce flip risk.
Gradient barcolor — Enables gradient bar paint on the main chart — Default true — Turn off to use wicks only or neutral bars.
Wick coloring — Colors wicks, borders, and bodies via overlay — Default true — Disable if it conflicts with other overlays.
Gradient window — Lookback for local normalization — Default 100 — Shorter windows adapt faster; longer windows provide steadier intensity.
Gradient transparency — Overall transparency for gradient paints — Default 0 — Increase to make gradients subtler.
Gamma bars/shapes — Contrast for bar and shape intensity — Default 0.70 — Lower values brighten mid-tones; higher values compress them.
Gamma plots — Contrast for the column plots — Default 0.80 — Tune separately from bar intensity.
Wick transparency — Transparency for wick coloring — Default 0 — Raise to let price action show through.
Up/Down colors (dark and neon) — Base and accent colors for both directions — Defaults as provided — Adjust to match your chart theme.
Reading & Interpretation
Pane columns: The green column represents the positive streak count; the red column represents the negative streak count. Taller columns signal stronger persistence.
Gradient marker: The bottom square indicates the active side and persistence strength at a glance.
Main-chart bars and wicks: Color direction shows the dominant side; intensity reflects the normalized and gamma-shaped streak magnitude. Faded tones suggest weak or fading pressure.
Practical Workflows & Combinations
Trend following: Enter in the direction of the active side when the corresponding column expands over several bars. Confirm with structure such as higher highs and higher lows or lower highs and lower lows.
Exits and stops: Consider scaling out when intensity fades toward mid-range while structure stalls. Tighten stops after extended streaks or when wicks lose intensity.
Multi-asset/Multi-TF: Use defaults for liquid assets on intraday to swing timeframes. For highly volatile instruments, raise smoothing and the normalization window. For calm markets, lower them to regain sensitivity.
Behavior, Constraints & Performance
Repaint/confirmation: Values update during the live bar and stabilize after bar close. No historical repaint beyond normal live-bar updates.
security()/HTF: Not used; cross-timeframe repaint paths do not apply.
Resources: Declared `max_bars_back` two thousand; no explicit loops or arrays; plot and label limits are generous.
Known limits: Streak counters can remain elevated during slow reversals. Very short normalization windows can cause rapid intensity swings. Gaps or extreme spikes may temporarily distort intensity until the window adapts.
Sensible Defaults & Quick Tuning
Start with: ADX smoothing nine, OHLC SMA one, normalization window one hundred, gradient and wick coloring enabled, gamma around zero point seven to zero point eight.
Too many flips: Increase ADX smoothing and the normalization window; consider a small bump in OHLC SMA.
Too sluggish: Decrease ADX smoothing and the normalization window.
Colors overpower chart: Increase gradient and wick transparency or raise gamma to compress mid-tones.
What this indicator is—and isn’t
This is a visualization and signal layer that represents directional persistence and intensity. It does not issue trade entries or exits on its own and is not predictive. Use it alongside market structure, volume, and risk controls.
Disclaimer
The content, including any code, is for educational and informational purposes only and does not constitute financial advice or a recommendation to buy or sell any instrument. Trading involves substantial risk, including the possible loss of principal. Past performance is not indicative of future results. Always do your own research and consider consulting a qualified professional.