Indicator

DUAL Relative Strength Index (Settings: 14 14 28)RSI with Dual Smoothing MA
A modified version of TradingView's built-in RSI indicator with a second RSI-based moving average added.
The standard RSI includes a single smoothing MA. This version adds a second, fully independent one — so you can run a fast MA alongside a slow MA and compare the RSI's short-term movement against its longer-term trend in the same pane.
Features
Two separate RSI-based MAs, each with its own type and length (SMA, EMA, SMMA/RMA, WMA, VWMA)
Independent color selection for each line
Either MA can be switched off entirely by setting its type to "None"
Optional Bollinger Bands on the first MA (as in the original)
Regular bullish/bearish divergence detection and alerts (as in the original)
Settings
RSI Settings: RSI length, source, divergence calculation
Smoothing: first MA — defaults to 14 SMA, yellow
Smoothing 2: second MA — defaults to 28 SMA, orange
Ways to use it
The fast MA crossing above the slow MA can be read as strengthening momentum; crossing below, as weakening
Both MAs sitting on the same side of the 50 level can serve as directional confirmation
The distance between the two lines gives a sense of how quickly momentum is shifting
This indicator does not generate standalone buy or sell signals. It is intended as a confirmation tool within your own system, and settings should be tested against the symbol and timeframe you trade.
Based on TradingView's open-source built-in "Relative Strength Index" indicator.
İngilizce:
Ways to use it
The fast MA crossing above the slow MA can be read as strengthening momentum; crossing below, as weakening
Crossovers that occur in the extreme zones (below 30 / above 70) tend to be more meaningful than those in the middle range (roughly 40–60), where the RSI often moves sideways and the MAs cross back and forth, producing noise
Both MAs sitting on the same side of the 50 level can serve as directional confirmation
The distance between the two lines gives a sense of how quickly momentum is shifting Indicator

XAUUSD Session 9EMA Last-Cross + Touch + Enter/R.EnterEMA Cross → EMA 9 Touch → Touch Candle Breakout (BOT) → Previous Swing Break (ENTER)
1. EMA setup
The script uses:
EMA 9 = fast EMA
EMA 21 = slow EMA
There are two possible directions:
Bullish
EMA 9 crosses above EMA 21.
This creates a BUY bias.
Bearish
EMA 9 crosses below EMA 21.
This creates a SELL bias.
The crossover itself is not the final entry.
2. Stage 1 — CROSS
After a fresh crossover, the system starts a new setup.
For BUY:
EMA 9 crosses above EMA 21
For SELL:
EMA 9 crosses below EMA 21
The script then waits for price to come back to the 9 EMA.
The previous swing is also captured at this point:
BUY → previous swing high
SELL → previous swing low
The default swing calculation is:
10 bars before the crossover.
3. Stage 2 — TOUCH
After the crossover, the script waits for a candle to touch the 9 EMA.
The condition is:
Low <= EMA 9 AND High >= EMA 9
So the candle's range must contain the 9 EMA.
For example:
BUY setup
Price
↑
│
EMA 9 ────────
│
Candle
touches
EMA 9
When this happens, the script records:
Touch candle high
Touch candle low
This candle becomes the reference candle for the next step.
4. Stage 3 — BOT
BOT means the touch candle's range gets broken.
For a BUY:
The high of the touch candle must be broken.
For a SELL:
The low of the touch candle must be broken.
Example BUY:
Touch candle
High ───────────────
│
│
EMA 9 ──────────────
│
Low ───────────────
↑
Price breaks
touch high
↓
BOT
Important:
The script checks:
high > touchHigh
for BUY.
And:
low < touchLow
for SELL.
So BOT happens when price moves beyond the touch candle's range.
5. Stage 4 — ENTER
BOT is still not the final entry.
After BOT, the script waits for price to break the previous swing level.
For BUY:
Candle CLOSE must be above the previous swing high.
For SELL:
Candle CLOSE must be below the previous swing low.
This is important because the script specifically uses the candle body/close, rather than accepting a wick.
BUY
Previous Swing High
──────────────────────
█
█ ← candle closes above
█
█
↑
ENTER
Condition:
close > swingLevel
SELL
Previous Swing Low
──────────────────────
█
█
█
↓
ENTER
Condition:
close < swingLevel
So the final sequence is:
BUY
9/21 bullish cross
→ 9 EMA touch
→ touch candle high broken (BOT)
→ previous swing high broken by CLOSE
→ ENTER BUY
SELL
9/21 bearish cross
→ 9 EMA touch
→ touch candle low broken (BOT)
→ previous swing low broken by CLOSE
→ ENTER SELL
6. Very important: the setup is sequential
The script uses a state machine:
Stage Meaning What it waits for
0 Idle New crossover
1 CROSS 9 EMA touch
2 TOUCH Touch candle breakout
3 BOT Previous swing breakout
4 ENTER Setup completed
Once ENTER happens, that setup is finished.
The script waits for a new EMA crossover before starting another setup.
7. What happens if the opposite EMA cross occurs?
A new crossover completely resets the setup.
For example:
BUY CROSS
↓
TOUCH
↓
BOT
↓
SELL CROSS
The previous BUY setup is abandoned.
The new SELL crossover starts a fresh setup.
8. The chart displays four different signals
You will see:
BUY / SELL
This is the EMA crossover, not the actual trade entry.
Yellow circle
This is the 9 EMA TOUCH.
BOT
This means the touch candle's high/low has been broken.
ENTER
This is the actual final entry signal.
So for your trading purposes, the most important signal is:
ENTER BUY / ENTER SELL
9. Alerts
The script has separate alerts for:
Cross BUY
Cross SELL
Touch
BOT
ENTER BUY
ENTER SELL
Therefore, if your goal is only to receive the actual trading signal, you would normally use:
ENTER BUY
and
ENTER SELL
rather than creating alerts for every intermediate stage.
10. Multi-Timeframe Table
The script also checks the same system on:
Weekly
1 Day
4 Hour
30 Minute
It displays:
Timeframe Stage Bias
Weekly CROSS/TOUCH/BOT/ENTER BUY/SELL
1 Day CROSS/TOUCH/BOT/ENTER BUY/SELL
4 Hour CROSS/TOUCH/BOT/ENTER BUY/SELL
30 Min CROSS/TOUCH/BOT/ENTER BUY/SELL
For example, you might see:
Timeframe Stage Bias
Weekly ENTER BUY
1 Day BOT BUY
4 Hour TOUCH BUY
30 Min CROSS BUY
That means each timeframe is independently running the same EMA 9/21 system.
11. One important detail about the swing level
This part is particularly important:
swingHighVal = ta.highest(high, swingLookback)
swingLowVal = ta.lowest(low, swingLookback)
With the default:
Swing Lookback = 10
the script takes the highest high / lowest low from the preceding 10 bars, excluding the current bar.
That level is stored when the EMA crossover happens.
It does not continuously move afterward.
So if the BUY crossover happens and the swing high is 10 bars back at 3340, the ENTER condition remains:
close > 3340
even if later candles create another higher high.
12. Example of a complete BUY trade
Suppose XAUUSD does this:
1. EMA 9 crosses above EMA 21
↓
BUY bias
2. Price pulls back
↓
3. Candle touches EMA 9
↓
TOUCH
4. Price breaks touch candle high
↓
BOT
5. Price continues higher
↓
6. Candle CLOSES above previous swing high
↓
ENTER BUY
Your actual entry is at step 6, not at the EMA crossover.
13. In simple words
Your indicator is looking for momentum + pullback + confirmation + structure breakout.
The philosophy is:
EMA crossover tells the direction → price pulls back to EMA 9 → price proves momentum by breaking the touch candle → price confirms the trend by breaking the previous swing → ENTER.
So the system is designed to avoid taking the trade immediately after an EMA crossover.
The complete logic
EMA 9 / EMA 21
│
┌─────────┴─────────┐
│ │
9 crosses UP 9 crosses DOWN
│ │
BUY bias SELL bias
│ │
└─────────┬─────────┘
↓
WAIT FOR TOUCH
│
Price touches EMA 9
│
↓
TOUCH
│
↓
Break touch candle
high / low
│
↓
BOT
│
↓
Break previous swing
with candle CLOSE
│
↓
ENTER Indicator

TF: BB/KC and Potential Reversals (BBKC)TradingFlow: BB/KC and Potential Reversals (BBKC)
BBKC combines Bollinger Bands (BB) and a Keltner Channel (KC) in one clean overlay, then uses band re-entry and momentum conditions to highlight potential bullish and bearish reversals. Its purpose is to make volatility structure, trend behaviour, compression, expansion, and possible turning points easier to read without covering the chart with separate indicators.
The diamond markers are hints that price may be reacting after an extended move or that momentum may be fading. They are not automatic trade instructions, and they do not mean a reversal is confirmed.
A Unified BB / KC View
Bollinger Bands and Keltner Channels describe volatility in different ways:
• Bollinger Bands: use standard deviation, so their width changes as price movement expands or contracts.
• Keltner Channel: uses ATR around an EMA to create a smoother channel for reading trends and pullbacks.
BBKC plots both structures with one visual theme rather than stacking two unrelated indicators. The more visible aqua boundaries are the KC, while the lighter boundaries are the BB. Subtle shading makes it easier to see how the two envelopes contract and expand around price, and the full KC area can also be lightly shaded if preferred.
This merged presentation is useful even without the reversal markers. The slope and direction of the channels, the side of the channel where price is holding, and the way price reacts at the boundaries can all provide trend context.
Why the Default KC Multiplier Is 1.6
By default, the KC uses a 20-period EMA and an ATR multiplier of 1.6. Many modern Keltner Channel implementations use a 2.0 ATR setting. BBKC uses 1.6 to keep the boundaries somewhat closer to price, making routine pullbacks, boundary tests, and re-entry behaviour easier to see. This is a visual design choice, not a claim that 1.6 is inherently more accurate.
The multiplier is adjustable. Different instruments and trading styles may benefit from a wider or narrower channel, so 1.6 should be understood as a useful default rather than a universal optimum.
How to Read the Potential Reversal Markers
• Green diamond: a bullish potential reversal. Price has reacted from a lower volatility boundary and passed the enabled filters.
• Red diamond: a bearish potential reversal. Price has reacted from an upper volatility boundary and passed the enabled filters.
By default, the script looks for the close to cross back inside a lower or upper KC or BB boundary. An optional rejection rule also checks whether the current or preceding candle touched or pierced a Bollinger Band before the current candle closed back inside.
The optional filters are designed to reduce ordinary boundary crossings:
• Volatility context: one of the two preceding closes must have been outside the corresponding boundary of a separate ATR-based Volatility Channel.
• RSI momentum: RSI must be below the bullish threshold or above the bearish threshold. Both levels are adjustable.
• Stoch RSI extreme: within a recent validity window, at least one completed bar must have both smoothed K and D in the 90/10 extreme zone. The window is adjustable and defaults to the two bars before the potential reversal; the current re-entry bar is excluded.
Potential reversal conditions are confirmed at bar close. The separate Volatility Channel can remain hidden while its values are still used by the filter; display it when you want to inspect those boundaries on the chart.
What a Marker Can and Cannot Mean
A potential reversal may become a major trend reversal, but it may also be only a small pullback, a pause within the existing trend, or a failed signal followed by continuation. The script detects a filtered move back from a volatility boundary; it cannot know in advance which outcome will follow.
The marker is therefore more useful as a prompt to investigate the chart than as a standalone entry command. A marker appearing against a strong trend should generally require more evidence than one appearing at a well-established structural level after an exhausted move.
Practical Reading Process
1. Read the slope and position of the BB / KC structure to understand the current trend and volatility regime.
2. Note whether the BB is compressing inside the KC or expanding beyond it.
3. When a diamond appears, check whether it is located near meaningful market structure rather than evaluating the marker in isolation.
4. Look for confirmation through price action, trend structure, support and resistance, or a failed breakout.
5. Add independent context such as volume profile, high- and low-volume areas, and the reaction around important support or resistance levels.
6. Define invalidation and risk before considering an entry.
Alerts
Alerts can be created for bullish potential reversals, bearish potential reversals, or either direction. They use the same final confirmed conditions and remain available when chart markers are hidden. For live use, “Once Per Bar Close” is recommended.
Important
BBKC is a chart-reading and opportunity-screening tool. Its markers are filtered potential reversals, not probabilities, guaranteed turning points, or complete trading systems. Settings behave differently across instruments and timeframes. Always combine the output with broader trend analysis, market structure, volume context, support and resistance, and appropriate risk management.
---
TradingFlow: BB/KC and Potential Reversals (BBKC)
BBKC 把布林通道(Bollinger Bands,BB)與肯特納通道(Keltner Channel,KC)整合在同一張主圖,並根據價格重新進入通道及動能條件,標示潛在的多頭和空頭反轉。它讓波動、趨勢、收縮、擴張和可能的轉折位置更容易判讀,不用另外疊加兩個指標。
菱形標記只是一個提示:價格經過一段延伸後,可能開始回頭,或原有動能正在減弱。它不是自動交易指令,也不代表反轉已經確認。
整合的 BB / KC 顯示
BB 與 KC 以不同方式描述波動:
• 布林通道: 使用標準差,會隨價格波動的擴大和收窄而改變。
• 肯特納通道: 以 EMA 為中心,利用 ATR 建立較平滑的通道,適合觀察趨勢與回調。
BBKC 用統一的配色呈現兩者。較清晰的水藍色邊界是 KC,較淡的邊界是 BB。淡色填充可幫助觀察兩組通道如何隨價格收縮和擴張,也可選擇顯示整個 KC 範圍。
即使不看反轉標記,這組通道本身也能幫助判斷趨勢。可留意通道斜率、價格主要停留在哪一側,以及價格接近邊界時的反應。
為何 KC 預設倍數是 1.6
KC 預設使用 20 週期 EMA 和 1.6 倍 ATR。現代 KC 指標常見的 ATR 設定是 2.0;BBKC 改用 1.6,讓邊界稍微靠近價格,更容易看到一般回調、邊界測試及價格重新進入通道的情況。這是為了方便讀圖,並不代表 1.6 本身更準確。
倍數可以自行修改。不同市場、時間週期和交易方式可能適合不同寬度,因此 1.6 只是實用的起始設定,並非所有情況下的最佳值。
如何閱讀潛在反轉標記
• 綠色菱形: 多頭潛在反轉。價格從下方邊界回升,並通過已啟用的過濾條件。
• 紅色菱形: 空頭潛在反轉。價格從上方邊界回落,並通過已啟用的過濾條件。
預設會尋找收盤價重新進入 KC 或 BB 邊界的情況。也可加入額外條件:目前或前一根 K 線先觸及/突破 BB,然後目前 K 線收回通道內。
各項過濾器用於減少普通邊界穿越造成的雜訊:
• 波動背景: 前兩根 K 線中,至少一根的收盤價必須曾位於另一組 ATR 波動通道的相應邊界之外。
• RSI 動能: 多頭標記要求 RSI 偏低,空頭標記要求 RSI 偏高;門檻可自行調整。
• Stoch RSI 極端值: 在近期有效期內,至少一根已完成 K 線的平滑 K、D 必須同時進入 90/10 極端區域。有效期可以調整;預設檢查潛在反轉前的兩根 K 線,不包括目前重新進入通道的 K 線。
潛在反轉條件只會在 K 線收盤後確認。另一組 Volatility Channel 即使隱藏,其數值仍可用於過濾;如想直接查看這些邊界,可在設定中顯示它。
標記可能代表甚麼
潛在反轉可能最終發展成主要趨勢反轉,也可能只是一個小型回調、原有趨勢中的短暫停頓,甚至是錯誤提示,之後價格繼續沿原方向運行。這套判斷只能找出價格從波動邊界回頭的跡象,無法預先知道之後會出現哪一種結果。
標記的作用是提醒你多看一眼,而不是叫你立即進場。逆著強勁趨勢出現時,通常需要更多確認;若它出現在明確的支撐、阻力或區間邊緣,而且此前走勢已有明顯延伸,才更值得留意。
實用判讀流程
1. 先閱讀 BB / KC 的斜率及價格位置,判斷目前趨勢與波動狀態。
2. 觀察 BB 正在 KC 內部收縮,還是向 KC 外部擴張。
3. 菱形出現時,先看它是否接近支撐、阻力或區間邊緣,不要只看標記本身。
4. 利用價格行為、趨勢結構、支撐阻力或假突破尋找確認。
5. 配合成交量分布(Volume Profile)、高/低成交量區,以及重要支撐阻力附近的反應。
6. 考慮進場前,先定義失效位置及風險。
警報
如需追蹤,可分別在多頭潛在反轉、空頭潛在反轉,或兩者任一出現時建立警報。警報只會在收盤條件確認後觸發;隱藏圖表上的菱形標記不會影響警報。即時使用時,建議選擇「Once Per Bar Close」。
重要說明
BBKC 是圖表判讀及機會篩選工具。標記只表示經過條件過濾的潛在反轉,不代表任何勝率,也不是必然轉折或完整交易系統。不同市場和時間週期的表現可能不同。使用時仍要結合趨勢、市場結構、成交量、支撐阻力和風險管理。
---
TradingFlow: BB/KC and Potential Reversals (BBKC)
BBKCは、ボリンジャーバンド(BB)とケルトナーチャネル(KC)を1つの見やすいオーバーレイに統合し、バンドへの再進入とモメンタム条件から、強気・弱気の潜在的な反転を表示します。複数の指標を重ねてチャートを複雑にすることなく、ボラティリティ構造、トレンド、収縮、拡大、転換候補を読みやすくすることが目的です。
ひし形のマーカーは、伸びた値動きが反応し始めた、またはモメンタムが弱まりつつある可能性を知らせるヒントです。自動売買の指示ではなく、反転が確定したことも意味しません。
BBとKCを統合した表示
BBとKCは異なる方法でボラティリティを表します。
• ボリンジャーバンド: 標準偏差を使うため、価格のばらつきの変化に反応します。
• ケルトナーチャネル: EMAを中心にATRで幅を作る、より滑らかなチャネルです。トレンドや押し戻りの確認に使えます。
BBKCは両者を共通の配色で整理して表示します。より明瞭なアクア色の境界がKC、薄い境界がBBです。控えめな色付けにより、2つのチャネルが価格の周囲で収縮・拡大する様子を見やすくし、必要に応じてKC全体の範囲も薄く表示できます。
この統合表示は、反転マーカーを使わない場合にも有用です。チャネルの傾き、価格が維持されている側、境界での反応から、トレンドの背景を読み取れます。
KCのデフォルト倍率が1.6である理由
KCは、デフォルトで20期間EMAと1.6倍のATRを使用します。現代的なKCでは2.0倍のATRもよく使われますが、BBKCは境界を価格に少し近づけ、通常の押し戻り、境界テスト、チャネルへの再進入を見やすくするために1.6倍を採用しています。これは見やすさのための設計であり、1.6倍のほうが本質的に正確という意味ではありません。
倍率は調整可能です。銘柄、時間軸、取引スタイルによって適切な幅は異なるため、1.6は実用的な初期値であり、すべての市場に共通する最適値ではありません。
潜在リバーサル・マーカーの見方
• 緑のひし形: 強気の潜在リバーサル。価格が下側のボラティリティ境界から反応し、有効なフィルターを通過した状態です。
• 赤のひし形: 弱気の潜在リバーサル。価格が上側のボラティリティ境界から反応し、有効なフィルターを通過した状態です。
デフォルトでは、終値がKCまたはBBの境界内へ戻る動きを検出します。追加条件では、現在または直前の足がBBに到達・突破し、その後に現在の終値がバンド内へ戻った場合も候補にできます。
各フィルターは、通常の境界通過によるノイズを抑えるために使用します。
• ボラティリティ背景: 直前2本のうち少なくとも1本の終値が、別のATRベースのVolatility Channelの対応する境界より外側であることを要求します。
• RSIモメンタム: 強気ではRSIが下側しきい値未満、弱気では上側しきい値を超えていることを要求します。どちらもしきい値を調整できます。
• Stoch RSIの極端値: 直近の有効期間内で、少なくとも1本の確定足において平滑化されたKとDが同時に90/10の極端ゾーンへ入っていることを要求します。有効期間は調整でき、デフォルトでは潜在リバーサル前の2本を確認します。現在の再進入足は含めません。
潜在リバーサルの条件は足の確定時にのみ成立します。Volatility Channelは非表示でもフィルターに使われ、必要に応じてチャート上に境界を表示できます。
マーカーが意味する可能性
潜在的な反転は、大きなトレンド転換につながる場合もあれば、小さな押し戻り、既存トレンド内の一時停止、または誤ったシグナルとなってそのままトレンドが継続する場合もあります。検出しているのは、フィルターを通過したボラティリティ境界からの戻りです。その後の結果を事前に判断することはできません。
そのため、マーカーは単独のエントリー指示ではなく、チャートを詳しく確認するためのヒントとして使うのが適切です。強いトレンドに逆らうマーカーには、明確な構造水準で伸び切った後に出るマーカーよりも多くの確認が必要です。
実践的な読み方
1. BB / KCの傾きと価格位置から、現在のトレンドとボラティリティ状態を確認します。
2. BBがKCの内側で収縮しているか、外側へ拡大しているかを確認します。
3. ひし形が出たら、重要な市場構造の近くにあるかを確認し、マーカーだけで判断しないようにします。
4. プライスアクション、トレンド構造、サポートとレジスタンス、または失敗したブレイクから確認を探します。
5. ボリュームプロファイル、高・低出来高帯、重要なサポート/レジスタンスでの反応など、独立した情報を組み合わせます。
6. エントリーを検討する前に、無効化水準とリスクを定義します。
アラート
強気、弱気、またはいずれかの方向に潜在リバーサルが現れた場合のアラートを作成できます。どれも同じ足の確定条件で作動し、チャート上のマーカーを非表示にしても機能します。リアルタイムでは「Once Per Bar Close」の使用を推奨します。
重要
BBKCはチャート分析と候補抽出のためのツールです。マーカーはフィルターを通過した潜在的な反転を示すものであり、確率、保証された転換点、または完全な売買システムではありません。銘柄や時間軸によって挙動は異なります。より広いトレンド分析、市場構造、出来高、サポートとレジスタンス、適切なリスク管理と組み合わせて使用してください。
Indicator

High Time Frame Candle OverlayOverlay higher-timeframe (HTF) candles on the same pane as the chart. Each HTF candle spans the lower-timeframe bars that belong to that period, using the same OHLC aggregation as a normal HTF candle: open of the first bar, high/low of the range, close of the last bar (updates while the HTF bar is still forming).
This is a visual overlay only . It does not generate buy or sell signals and is not a trading system.
Why use it
Read the higher-timeframe candle (body, wick, close relative to open) without leaving the working timeframe. Example: on a 15-minute chart, each 1-hour candle covers the four 15-minute bars that form that hour.
Auto HTF (on by default)
The overlay timeframe follows the chart:
1m → 5m
5m → 15m
15m → 1h
1h → 4h
4h → 1D
1D → 1W
1W → 1M
Turn Auto HTF from chart off to pick 1m, 5m, 15m, 1h, 4h, 1D, 1W, or 1M manually. The overlay must be higher than the chart timeframe.
Alignment
Period edges follow TradingView session/clock for that timeframe (same boundaries as the built-in HTF chart), not “every N bars from bar 0”.
The right edge stops on the last chart bar of the HTF period (its close) , not on the next HTF open. Example: 4h chart + 1D overlay — the daily candle runs from the 08:00 open through the 04:00–08:00 bar close, not through the next day’s 08:00 open.
X uses bar index (stays glued when you pan or the chart auto-fits). Y is price.
Candle styles
One candle — one body and a center wick (default).
Four sections — the same HTF OHLC split into four columns, with a wick band in each column so the wick is easier to see against the chart’s own wicks.
Colors and look
Same layout as TradingView candle style: Body, Border, and Wick, each with bull and bear colors (close ≥ open = bull). Color pickers include their own transparency. A separate Transparency input (0–100) sets body fill so the chart candles stay visible underneath.
Also adjustable: wick width, body border width, and how many HTF candles to keep (platform max 500 drawings; Four sections uses more drawings per candle, so the script caps that style at 62).
How to use
Add the script to a standard candlestick chart (not Heikin Ashi, Renko, or other non-standard types if you need real OHLC).
Leave Auto HTF on, or turn it off and choose Overlay timeframe.
Raise Transparency if the overlay hides the chart candles; lower it if the HTF body is too faint.
Switch to Four sections if the center wick is hard to read.
Notes
The first HTF candle at the left of loaded history may be a partial period if the first bar is not an HTF boundary.
Missing chart bars can make the overlay open differ slightly from the exchange HTF print.
Doji (open = close) uses bull colors, same as TradingView candles.
Indicator

ATR Swing Stop Loss (Long)ATR Swing Stop Loss (Long) — Documentation
Purpose: Plots a trailing stop-loss line for long swing positions in Indian equities, based on Average True Range (ATR) volatility rather than a fixed percentage or arbitrary support level.
Core Logic
ATR Calculation — Measures 14-period average true range (Wilder's smoothing), capturing the stock's typical daily volatility.
Stop Level — Highest High (14 bars) − (ATR × 3.0). Anchoring to the recent high (not just current price) keeps the stop from tightening prematurely during a pullback within an uptrend.
Ratcheting — The stop only moves up, never down, as price makes new highs. This locks in gains as the trade progresses.
Reset on Breach — If a candle closes below the trailing stop, it's treated as a stop-out. The calculation resets fresh from that point (as if starting a new trade), and the line briefly turns red.
Inputs
Input Default Description
ATR Length 14 Lookback period for ATR and highest-high calculation
ATR Multiplier 3.0 Controls stop distance — lower = tighter stop, higher = more room
Show Info Table On Displays ATR value, stop price, and risk % in top-right corner
Show Stop-Hit Markers On Plots an "SL" cross marker when price closes below the stop
Visual Output
Orange line — active trailing stop
Red line/marker — stop was just breached (exit signal)
Info table — current ATR, stop level, and % distance from close to stop (useful for position sizing/risk calc)
Alerts
One built-in alert condition: "Long ATR Stop Hit" — fires when price closes below the trailing stop. Set this up via TradingView's Alert panel to get notified without watching the chart.
Usage Notes
Designed for daily timeframe swing trades; can be used intraday but multiplier/length may need adjustment for lower timeframes.
Works best on trending stocks — in sideways/choppy names it may whipsaw more often near the 3× ATR threshold.
Long-only. Does not track entry price or position size — it's a volatility-based exit reference, not a full position manager.
Not signal generation — this indicator does not tell you when to enter, only where to consider exiting once you're long.
Suggested Workflow
Add to your stock's daily chart alongside your entry signal/strategy.
Enter long per your own setup.
Use the plotted stop as your live stop-loss reference — adjust broker SL order as the line ratchets up.
Exit (or tighten manually) when the "SL" marker appears or your alert fires.
Indicator

Indicator

Indicator

Indicator

Professional Volume Delta & CVD SuiteEnglish Version
Professional Volume Delta & CVD Suite
Professional Volume Delta & CVD Suite is an all-in-one order flow and volume analysis indicator engineered to deliver institutional-grade market context across any timeframe. By combining Intrabar Volume Delta estimation, Cumulative Volume Delta (CVD), Order Flow Divergences, Volume Climax detection, and a dynamic Real-Time Data Table, this script condenses multiple advanced trading tools into a single, clean workspace.
Key Features & Internal Mechanics
Dual Volume Delta Calculation Engine:
Wick-Based Estimation (Recommended): Evaluates intrabar price action by analyzing high, low, and close prices (volume * (close - low) / (high - low)) to accurately distribute buying and selling volume within each candle.
Color-Based Alternative: Calculates net volume based strictly on candle close vs. open.
Automated Multi-Timeframe Adaptation (Auto-Adjust):
Intraday Mode (1m - 1H): Calculates a Session CVD that resets to 0 at the start of each trading day (00:00 UTC), ideal for tracking day-trading order flow absorption. Divergence lookback is set to 5 bars, Volume MA to 20 periods, and Climax Multiplier to 2.0x.
Daily & Weekly Mode (1D, 1W, 1M): Automatically switches to a Continuous Accumulated CVD (no daily reset) to track multi-week accumulation/distribution cycles. Sets the volume Moving Average to 21 periods (1 trading month) and divergence lookback to 10 bars for high-conviction swing signals.
In-Bar Buyer/Seller Percentage Labels:
Plots exact percentages of buying (%C) and selling (%V) pressure on each individual volume bar.
Fully customizable display: show both percentages, only the winning side, adjust font sizes, toggle % symbols, and control vertical offset distance.
Algorithmic Price vs. Delta Divergence Detection:
Bullish Divergence (Green Arrow): Triggers below the volume histogram when price marks a lower low but Volume Delta forms a higher low (indicates institutional supply absorption).
Bearish Divergence (Red Arrow): Triggers above the volume histogram when price marks a higher high but Volume Delta forms a lower high (indicates demand exhaustion/distribution).
Volume Climax & Trend Filters:
Volume Moving Average (MA): Smoothed volume baseline (default 21 periods for daily charts).
Volume Climax Highlights: Highlights exceptional volume spikes in bright gold when total volume exceeds the moving average by the configured multiplier (e.g., 1.8x or 2.0x), signaling heavy institutional positioning or potential exhaustion.
Dynamic Real-Time Information Table:
Candle Status: Live indicator (Bullish 🟢 / Bearish 🔴).
% Buyer / % Seller: Exact percentage breakdown for the current open candle.
Candle Delta: Net delta percentage of the active bar.
Session CVD / Accumulated CVD: Shows continuous capital flow adapted to the current timeframe.
Volume Activity: Displays current volume activity relative to the MA percentage or alerts CLIMAX ⚡.
Inputs & Customization Settings
Timeframe Configuration: Toggle auto-adaptation or manually enforce Intraday / Daily modes.
Calculations & Display: Choose calculation methods, toggle label modes, change text sizes, and adjust label offsets.
Divergences & MA Filters: Customize MA period, divergence lookback window (bars), and climax thresholds.
Table & Aesthetics: Full control over UI table placement (9 anchor points), table size, row visibility, and custom color palettes for buyers, sellers, climax bars, and divergence shapes.
Versión en Español
Professional Volume Delta & CVD Suite
Professional Volume Delta & CVD Suite es un indicador de análisis de flujo de órdenes (order flow) y volumen todo-en-uno, diseñado para proporcionar contexto de nivel institucional en cualquier marco temporal. Al combinar la estimación de Delta por vela, el Delta Acumulado (CVD), Divergencias de Order Flow, detección de Clímax de Volumen y una Tabla de Datos en Tiempo Real, este script sintetiza múltiples herramientas avanzadas en un único panel limpio y eficiente.
Características Principales y Mecánica Interna
Motor Doble de Cálculo de Volumen Delta:
Estimación por Mechas (Recomendado): Evalúa la acción del precio dentro de la vela analizando máximos, mínimos y cierres (volumen * (cierre - mínimo) / (máximo - mínimo)) para distribuir de manera precisa el volumen comprador y vendedor.
Alternativa por Color de Vela: Calcula el volumen neto basándose estrictamente en el cierre vs. la apertura.
Adaptación Automática según Temporalidad (Auto-Adjust):
Modo Intradía (1m - 1H): Calcula un CVD de Sesión que se reinicia a 0 al inicio de cada jornada (00:00 UTC), ideal para medir la absorción en el day trading. Configura la evaluación de divergencias en 5 velas, la Media Móvil en 20 períodos y el Clímax en 2.0x.
Modo Diario y Semanal (1D, 1W, 1M): Cambia automáticamente a un CVD Acumulado Continuo (sin reseteo diario) para medir ciclos de acumulación y distribución de mediano/largo plazo. Ajusta la Media Móvil de volumen a 21 ruedas (1 mes bursátil) y la evaluación de divergencias a 10 velas para señales swing de alta probabilidad.
Etiquetas de Porcentaje Comprador/Vendedor en Barras:
Muestra en tiempo real los porcentajes exactos de presión compradora (%C) y vendedora (%V) sobre cada barra de volumen.
Personalización visual total: muestra ambos porcentajes, solo el lado ganador, ajusta el tamaño de texto, activa/desactiva el símbolo % y modifica la distancia vertical.
Detección Algorítmica de Divergencias (Precio vs. Delta):
Divergencia Alcista (Flecha Verde): Salta debajo del histograma cuando el precio hace un mínimo más bajo pero el Delta de Volumen hace un mínimo más alto (señal de absorción de oferta institucional).
Divergencia Bajista (Flecha Roja): Salta arriba del histograma cuando el precio marca un máximo más alto pero el Delta de Volumen marca un máximo más bajo (señal de agotamiento de demanda o distribución).
Clímax de Volumen y Filtros de Tendencia:
Media Móvil de Volumen (MA): Línea base del volumen promedio (fijada en 21 ruedas para gráficos diarios).
Resaltado de Clímax: Pinta las barras en color dorado brillante cuando el volumen total supera drásticamente la media móvil según el multiplicador configurado (1.8x o 2.0x), alertando sobre volumen institucional masivo o posible agotamiento.
Tabla Informativa Dinámica en Tiempo Real:
Estado Vela: Indicador en vivo del sesgo actual (ALCISTA 🟢 / BAJISTA 🔴).
% Comprador / % Vendedor: Desglose porcentual exacto de la vela en formación.
Delta Vela: Porcentaje de delta neto de la barra activa.
CVD Sesión / CVD Acumulado: Flujo continuo de dinero adaptado dinámicamente según la temporalidad del gráfico.
Actividad Vol.: Muestra la actividad de volumen respecto a la Media Móvil o la alerta de CLÍMAX ⚡.
Parámetros y Opciones de Configuración
Configuración de Temporalidad: Activa/desactiva la autoconfiguración o fuerza manualmente los modos Intradía o Diario/Semanal.
Cálculos y Visualización: Elección del método de cálculo, formatos de etiqueta, tamaños de texto y distancias en el gráfico.
Divergencias y Filtros de MA: Ajuste de períodos de Media Móvil, rango de velas para divergencias (lookback) y umbrales de clímax.
Estética de la Tabla: Control total sobre la posición de la tabla (9 anclajes), tamaño de celda, visibilidad de filas y paletas de colores totalmente personalizables (compradores, vendedores, clímax y flechas de divergencia).
Indicator

HARSI Suite Divergneces [Market Breakers]HARSI Suite Divergences is an oscillator-pane indicator that merges three open-source HARSI works into one coherent workflow: HARSI candles for momentum, WaveTrend-gated buy/sell dots, a fractal divergence engine that draws lines on both this pane AND the main chart, higher-timeframe HARSI candle boxes for top-down context, and independent HH/LL structure labels. The reason for the merge is that these components describe momentum at different scales, and running them as one script lets each engine be styled without moving the others.
BACKGROUND — WHAT HARSI IS
The Heikin Ashi RSI ("HARSI") reinterprets the RSI series as a Heikin-Ashi–style candle sequence. Where a raw RSI line asks you to read momentum from a jagged plot, HARSI presents the same information as body-and-wick candles you can read the way you read price. This oscillator is centered on zero (RSI − 50) so overbought/oversold zones sit symmetrically above and below the midline.
HOW THE ENGINES ARE SEPARATED
The build's design choice is to run four independent engines so restyling one thing doesn't move another. This is the primary architectural addition over the source works.
1. Display engine — draws the HARSI candles on this pane and the HTF HARSI candle boxes when enabled. A preset system (Raw 14/1 for the classic HARSI look, Smoothed 10/5 for a noise-reduced pairing with the HTF boxes, Custom for direct parameter control) lets you switch display profiles without touching the other engines.
2. Structure engine — a dedicated HARSI (default 14/1) drives the HH/LL pivot detection. Because it's independent of the display, changing the display candles' smoothing never shifts where the HH/LL labels land.
3. Gate RSI — a dedicated RSI (default 7-length, smoothed) whose prior-bar cross of ±gate level is required for a WaveTrend buy/sell dot to fire. Decoupled from the display so restyling the candles never changes when signals appear.
4. WaveTrend + Divergence engine — WaveTrend cross-in-zone conditions produce the dots (regular vs. divergence-confirmed distinctly), and a fractal-based divergence scanner captures the two swings for the divergence lines.
FEATURES
Dual-pane divergence lines — When the divergence engine confirms a regular or hidden divergence, the connecting line is drawn twice off the same two swing points: once across the HARSI candle highs/lows on this pane (in-scale, riding the visible candles), and once via force_overlay across the corresponding price highs/lows on the main chart. Optional +RD / −RD / +HD / −HD labels on both. Oscillator and price stay in agreement because both lines share the exact same endpoints captured at fractal-confirmation time.
HTF HARSI candles — Higher-timeframe HARSI candles rendered as boxes with independently stylable outline, body, wicks, midline, and range label. A shared auto-pair table maps chart timeframe to a sensible HTF (five default LTF→HTF pairs, all user-editable), with a manual override and a safety fallback if the resolved HTF is somehow at or below the chart timeframe. The in-progress HTF candle grows live on the current bar so you can watch it develop between closes.
WaveTrend buy/sell dots — Triangles fire when the WT oscillator crosses inside its OB/OS zone AND the dedicated gate RSI has crossed its ±threshold on the prior bar. Divergence-confirmed dots (WT signal + WT divergence agreeing) plot fully opaque; plain WT-only dots plot faded, so you can tell the two apart at a glance.
HH/LL structure labels — Higher-highs and lower-lows are identified on the structure HARSI's pivots and labeled at the candle high/low with configurable offset, color, text color, and size.
OB/OS boundary bands — Three colored fill zones (OB extreme, main channel, OS extreme) spanning the full pane width via extend.both, so the oscillator's zonal context reads clearly and stays visible past the last candle.
ALERTS
- Buy/Sell (Divergence + WT) — divergence-confirmed dots
- Buy/Sell (WT Cross) — regular WT dots
- HARSI Higher High / Lower Low — structure prints
- Bearish/Bullish Divergence Line — fires on the confirmation bar of a drawn line, so the alert and the line always agree
HOW TO USE
Add it to any liquid instrument on the timeframe you actually trade — HARSI is a momentum interpretation and works on any chart timeframe, though intraday-to-swing timeframes are where most of the design attention went. Start on the Raw (14/1) preset for the classic look; try Smoothed (10/5) if you're using the HTF candle boxes. Leave HTF on Auto until you have a preferred mapping, then switch to Manual to lock it. Use the divergence lines on either pane alone if the dual-pane display is too busy for your layout.
LIMITATIONS
- HARSI is a momentum interpretation, not a directional prediction. It smooths noise but does not create predictive edge on its own.
- Structure labels lag by the right-bar setting (default 5 bars) because a pivot cannot be confirmed until N bars after it forms.
- Divergences are pattern annotations describing momentum vs. price behavior, not entry signals in themselves.
- HTF candle boxes on very long histories may recycle older elements because of TradingView's 500-drawings-per-script cap.
- Works best on standard candle/bar charts. Non-standard chart types (Heikin Ashi, Renko, P&F, Range, Kagi) alter the underlying series and will produce unrealistic HARSI and WaveTrend behavior.
CREDITS
Full credit to the original authors whose open-source work this script builds on:
@JayRogers — Heikin Ashi RSI Oscillator. This is the foundational work the entire Suite is built around. The core HARSI candle engine — the zero-median RSI helper, the RSI Heikin-Ashi OHLC derivation, the OB/OS boundary architecture with its three-zone fill approach, and the mode-selectable smoothed RSI overlay — all originate with Jay's script. This build parameterizes the HARSI generator so multiple independent engines (Display, Structure) can run off the same math with different settings, but the math itself is Jay's. He released the original under an explicitly permissive grant ("free to use, copy, and alter in any way you choose").
@LordKaan — Overlay - HARSI + Divergences + TTF. The WaveTrend oscillator + fractal-based divergence engine architecture was adapted from this work. The 3LS Oscillator and Stochastic modules present in the original were removed for this build; the WT + divergence portion was kept and extended.
@krollo041 (Kevin Rollo) — HTF Candle Boxes for LTF Charts. The HTF candle-box rendering approach (aggregating OHLC across an HTF interval into a drawn box + wicks between chart bars) was adapted for HARSI values rather than price.
Additions in this build, over the source works:
- A dedicated Structure engine (a second HARSI instance) driving HH/LL pivots, so structure labels are independent of the Display preset
- A dedicated Gate RSI for the WT buy/sell dots, so restyling the display never changes when signals fire
- Dual-pane divergence lines drawing simultaneously on the oscillator AND via force_overlay on the main chart, from the same fractal-confirmed swing points
- Shared HTF auto-pair table with manual override and a same-or-lower-TF safety fallback, unified across the HTF module
- Preset system for the display candles (Raw / Smoothed / Custom)
- Live in-progress HTF candle rendering that grows on the current bar
- Consolidated alert layer covering dots, structure prints, and confirmed divergence lines
Source is published open under the Mozilla Public License 2.0.
Indicator

VWAP Regime AI [AxeAlgo]OVERVIEW
VWAP Regime AI is an anchored VWAP (Volume-Weighted Average Price) with
standard-deviation bands, enhanced by a native, from-scratch k-means
clustering engine that classifies recent market volatility into three
regimes — Low, Medium, and High — and adapts the indicator's behavior
based on which regime is currently active.
At its foundation this is the same tool institutional desks use every
day: a running volume-weighted average price with bands around it, used
to judge where "fair value" sits and how far price has stretched away
from it. What this script adds on top is a genuine unsupervised machine
learning step that reads the market's own volatility and lets that
reading drive three things: how wide the bands are, which signal logic
is active, and how much the indicator should trust its own regime call
before acting on it.
This script is free and open-source. All calculations happen natively in
Pine Script on your own chart data.
============================================================
FULL TRANSPARENCY ABOUT THE "AI" IN THIS SCRIPT
============================================================
Pine Script cannot call an LLM, a remote model, or any external AI
service — TradingView does not allow outbound network requests from
indicators, and this script makes none. There is no hidden API call,
no "black box," and nothing running outside of what you can read in the
source code.
What "AI" means here specifically: this script implements k-means
clustering — a well-established unsupervised machine learning algorithm
— entirely in native Pine Script math and arrays. It groups a rolling
window of recent ATR (volatility) readings into three clusters by
repeatedly assigning each reading to its nearest cluster center and then
recomputing each center as the mean of everything assigned to it. This
publication states plainly what is and is not happening so nobody
mistakes this for predictive AI, sentiment analysis, or anything that
consults external data or forecasts the future. It classifies what has
already happened; it does not predict what will happen next.
============================================================
HOW IT WORKS
============================================================
VWAP & Standard Deviation Bands
--------------------------------
The core VWAP resets at the start of each new anchor period (Session,
Week, Month, Quarter, or Year — configurable) and accumulates a running
volume-weighted average from there. Standard deviation is calculated
using the same volume-weighted variance formula TradingView's own
built-in VWAP-with-bands tool. Up to three bands can be shown,
each set at a configurable standard-deviation distance from VWAP.
AI Volatility Clustering (K-Means)
------------------------------------
A rolling window of recent ATR readings (length and window size are both
configurable) is periodically re-clustered into three groups — Low,
Medium, High — using k-means. Reclustering happens every N bars rather
than every single bar, purely for performance; the live classification
of the current bar still updates continuously between reclusters.
Alongside the classification, the script computes a Confidence score
(0-100%): how much closer the current reading sits to its nearest
cluster than to its second-nearest one. A reading sitting right on a
cluster's center scores near 100%; a reading sitting on the boundary
between two regimes — an effectively ambiguous call — scores near 0%.
A "Minimum Regime Confidence" input lets you require a minimum score
before the regime is allowed to influence anything else in the script,
so an unconfident, boundary-line classification doesn't silently drive
behavior.
Adaptive Band Width
----------------------
When enabled, the standard-deviation band multipliers are scaled by a
per-regime factor: tighter in Low volatility, wider in High volatility,
instead of one fixed multiplier that's too tight in some conditions and
too loose in others. This only engages once the AI is both ready
(its lookback window has filled and it has run at least once) and
confident, per the Minimum Regime Confidence setting above.
Signal Logic — Mean Reversion, Breakout, or Auto
----------------------------------------------------
Two independent signal styles are built in, both measured off Band 2:
Mean Reversion looks for price crossing back inside the band from
outside (betting an extreme move snaps back toward VWAP); Breakout looks
for price crossing outside the band (betting the move has momentum to
keep running). "Auto" mode lets the detected volatility regime decide
which logic applies bar by bar — Low/Medium volatility defaults to Mean
Reversion, High volatility defaults to Breakout — falling back to Mean
Reversion whenever the AI isn't ready or confident enough to trust.
Three independent, stackable filters reduce noise on top of the raw
band cross:
- Bar-Close Confirmation: a cross only counts once the bar has fully
closed, filtering out intrabar wicks that reverse before the close.
- Signal Cooldown: blocks a new signal, in either direction, for a
configurable number of bars after the last one — aimed directly at
whipsaw (price crossing back and forth across a band repeatedly).
- Band Cross Buffer (hysteresis): requires price to clear a band by a
small extra distance, in standard deviations, rather than an exact
touch, so noise sitting right on the line doesn't keep re-triggering
crosses back and forth.
AI Volume Confirmation Filter
---------------------------------
The same k-means engine used for volatility is optionally reused on raw
volume, classifying each bar's volume as Low, Normal, or High. When
enabled, signals are only allowed on Normal-or-above volume, filtering
out low-conviction moves.
Secondary VWAP
-----------------
An optional second VWAP anchored to a different (typically higher)
period can be plotted alongside the primary one — for example a Weekly
VWAP behind a Session VWAP — for confluence, since multiple VWAP anchors
are commonly watched together rather than trusting a single one in
isolation. It is a reference line only; no bands are drawn for it.
Signal Track Record
-----------------------
An on-chart scorecard tracks, in a simple and fully model-free way, how
the signals have actually performed: each signal opens a virtual
position at that bar's close, and the next opposite-direction signal
closes it out, scored as a win or a loss purely on which way price
moved in between. No target or stop-loss assumption is built into this
score — see the Limitations section below for exactly what this number
does and does not tell you.
Status Table
---------------
An optional on-chart table shows the current regime and its confidence,
the active band scale, the current VWAP value, a "Stretch Score" (see
below), and the Signal Track Record numbers, all in one place.
Stretch Score
----------------
A signed z-score of how many standard deviations price currently sits
from VWAP. Because it's measured in the same standard deviations the
bands are drawn in, it stays consistent with whatever the adaptive band
width currently has in effect — a reading of +2.00 always means "sitting
on Band 2," whether that band is currently tight or wide.
============================================================
HOW TO USE THIS INDICATOR
============================================================
1. Start with the default settings and watch the status table for a
while before changing anything. Let the AI Volatility Clustering
lookback window fill (the table will show "Calibrating..." until it
has enough data) so the regime classification is meaningful.
2. Decide whether you want Mean Reversion, Breakout, or Auto signal
logic. Auto is a reasonable starting point since it adapts to
detected conditions automatically.
3. Watch the Confidence score alongside the regime label. If confidence
is frequently low on your instrument/timeframe, consider raising the
Minimum Regime Confidence input so the indicator falls back to
neutral behavior more readily instead of acting on ambiguous calls.
4. Use the Stretch Score to judge how extended price currently is
relative to VWAP in a way that stays consistent even as band width
adapts.
5. Treat the Signal Track Record as a rough, ongoing sanity check on
signal quality — not a backtest and not a promise (see Limitations).
6. This is a visual/analytical tool, not an auto-trading system. It
does not place trades. Any alerts it can generate are notifications
only.
============================================================
INPUT GROUPS (SUMMARY)
============================================================
VWAP Settings
- Anchor Period (Session / Week / Month / Quarter / Year)
- Source price used for the VWAP calculation
Secondary VWAP (Confluence)
- Show/hide toggle, its own anchor period, and its own color
Standard Deviation Bands
- Independent show/hide and distance (in standard deviations) for
three bands, plus a toggle for the gradient fill shading around them
AI Volatility Clustering (K-Means)
- Enable/disable the clustering engine
- ATR length used as the raw volatility reading that gets clustered
- Clustering lookback window (bars) and reclustering frequency
- Number of k-means refinement iterations per reclustering
- Adaptive band width toggle and the three per-regime scale factors
- Minimum Regime Confidence threshold
Signals
- Show/hide signal markers
- Signal Mode (Mean Reversion / Breakout / Auto)
- Volume confirmation filter toggle
- Bar-close confirmation toggle
- Signal cooldown (bars)
- Band cross buffer (hysteresis, in standard deviations)
Visuals
- Regime background highlight toggle
- Status table toggle and Signal Track Record toggle
- Colors for VWAP, each band, each regime, and each signal direction
============================================================
REPAINTING & REAL-TIME BEHAVIOR
============================================================
This script does not use any higher-timeframe security() calls and does
not look ahead — every value at every historical bar is a function of
data available up to and including that bar. Once a historical bar is
confirmed, its VWAP, bands, regime classification, and signals do not
change on subsequent chart loads or reloads.
Like any real-time indicator, values on the currently forming (unclosed)
bar update as new price/volume ticks arrive, and will settle once that
bar closes — this is standard behavior for any live indicator, not
repainting of historical data. If you want signal markers to appear only
after a bar has fully closed rather than updating intrabar, keep the
"Require Bar Close Confirmation" input enabled (it is on by default).
============================================================
LIMITATIONS — PLEASE READ
============================================================
- The Signal Track Record is a simplified, model-free heuristic, not a
backtest. It ignores commissions, spread, slippage, position sizing,
and any stop-loss/take-profit logic, and it scores a "trade" purely by
whether price was above or below the entry price when the next
opposite signal fired. It exists to give a rough, ongoing sense of
signal direction quality — it is not a performance guarantee and
should not be relied on as one.
- K-means clustering, like any clustering method, can produce a
misleadingly high confidence score if recent volatility (or volume)
readings happen to be nearly constant for an extended window — a rare
condition, more likely on thinly-traded instruments, but worth being
aware of.
- Regime classification and adaptive behavior depend on the Clustering
Lookback window filling with data first; expect "Calibrating..." on a
freshly loaded chart or a short history until then.
- This is a discretionary analysis tool intended to support your own
judgment, not a mechanical, guaranteed-signal system. No combination
of settings eliminates false signals entirely, which is why several
independent, adjustable filters (bar-close confirmation, cooldown,
hysteresis buffer, volume confirmation, regime confidence threshold)
are provided rather than relied on individually.
============================================================
RISK DISCLAIMER
============================================================
This script is provided for educational and informational purposes
only. It is not financial advice, and it is not a recommendation to buy
or sell any security or instrument. Trading and investing involve
substantial risk of loss and are not suitable for every investor. Past
performance — whether real, simulated, or shown via the on-chart Signal
Track Record — is not indicative of future results. Always do your own
research and consider consulting a licensed financial advisor before
making trading decisions. Use this indicator, and any alerts it
generates, entirely at your own risk. Indicator

EMA Reversal Squeeze K8EEMA Reversal Squeeze K8E
The EMA Reversal Squeeze K8E is designed to identify potential momentum reversals by detecting a specific sequence of EMA compression and directional flipping.
Works on lower time frames only
The indicator monitors the 9 EMA, 20 EMA, and 50 EMA internally and looks for situations where the three averages come tightly together before reversing their order.
How LONG signals work
A LONG setup begins when:
EMA 9 < EMA 20 < EMA 50
All three EMAs are within 1 point of each other
The EMAs compress further to within 0.5 points
The EMA structure then flips to EMA 9 > EMA 20 > EMA 50
The final flip occurs while the EMAs remain within 1 point
The indicator then prints a LONG signal on the first qualifying candle.
How SHORT signals work
A SHORT setup is the exact opposite:
EMA 9 > EMA 20 > EMA 50
All three EMAs are within 1 point
The EMAs compress to within 0.5 points
The EMA structure flips to EMA 9 < EMA 20 < EMA 50
The final flip occurs while the EMAs remain within 1 point
The indicator then prints a SHORT signal on the first qualifying candle.
Why the squeeze matters
The idea behind the setup is that when the 9, 20, and 50 EMAs become extremely compressed, the market is showing a period of reduced separation between short-, medium-, and longer-term momentum.
When that compression is followed by a complete EMA order reversal, it can indicate that momentum is transitioning to the opposite direction.
The EMA lines are intentionally hidden from the chart so the indicator provides clean LONG and SHORT signals without clutter.
Note: This indicator is a technical analysis tool and should not be considered financial advice. Signals should be evaluated alongside price action, market structure, volatility, session levels, and your own risk-management rules. Indicator

EMA + VWAP + Sessions + ORB v2EMA + VWAP + Sessions + ORB
An all-in-one intraday toolkit combining trend, mean-reversion, session-timing, and opening-range tools in a single overlay — every element independently customizable.
📈 Triple EMA
Three fully independent EMAs, each with its own length, color, visibility toggle, and line style (Solid / Dashed / Dotted). Defaults: 9 (red) / 21 (white) / 50 (blue).
⚖️ VWAP
Session-anchored VWAP with adjustable color, line width, and style (Solid / Dashed / Dotted). Default: yellow.
🎨 Adjustable Dash/Dot Spacing
Dashed and Dotted styles use a custom-built rendering method so they show exactly as much chart history as Solid lines — no artificial history limit. Dash length, dash gap, and dot gap are all independently tunable to match your timeframe.
🌍 Session Overlay
Highlights the London, New York, Tokyo, and Sydney sessions directly on the chart. Each session has its own show/hide toggle, editable time window, and color. Choose between full background shading or a band that hugs just the session's high/low range — useful for spotting session overlaps and volatility windows at a glance.
🎯 Opening Range Breakout (ORB)
Define any custom time window (not locked to fixed 5/15/30-min presets) and the script plots the resulting opening range as a shaded box with extending high, low, and halfway (50%) lines. Includes:
Optional breakout and retest signals, with failed-retest detection
Previous-day range visibility
Built-in alert conditions for both simple level crosses and confirmed breakouts
🎯 ORB-Based Take-Profit Levels
Six auto-calculated TP lines — TP1/TP2/TP3 for both long and short scenarios — measured as configurable multiples of the ORB range, projected from the ORB midpoint. Default multiples are 1x / 2x / 3x, each independently adjustable, so you can size targets to your own risk model.
Fully customizable colors and toggles across every component — EMAs, VWAP, all four sessions, and every ORB element — so the indicator can be tuned to match any chart theme or trading style. Indicator

Position Size & R-Multiple Calculator & Lot Size CalculatorCalculates your lot size from a fixed percentage of account risk, so position size is never a decision you make in the heat of a setup.
Drag Entry, Stop Loss and Take Profit on the chart. The script returns the exact lot to trade, the dollar and percentage risk, the R:R, and a mechanical exit plan — all recalculating live as you move the levels.
What it shows
Lot size — derived from account balance, risk %, and stop distance. Always rounded down to your broker's lot step, so you can never accidentally size above your limit.
Risk in $ and % — turns red if the trade breaches your hard cap.
R:R — flagged if it falls below your minimum.
1R / 2R / 3R levels drawn on the chart, plus the exact half-lot to close at 1R and the breakeven stop that follows.
Verdict bar — a single green/orange/red line telling you whether the trade meets your own rules before you click buy.
Setup
Set your account balance and risk % once in Settings. Choose a contract preset (gold, silver, FX major) or enter a custom contract size. For non-USD-quoted symbols, set the quote conversion rate.
Why fixed risk
Inconsistent position sizing is what turns a run of small losses into a hole. Sizing every trade to the same percentage means your worst trade costs the same as your best one — and a losing streak stays survivable.
Not financial advice. This is a sizing tool, not a signal generator; it takes no view on whether a trade is worth taking. Indicator

Indicator

Indicator

BearScope Pattern RadarBearScope - Bearish Pattern Scanner
OVERVIEW
BearScope is a bearish chart-pattern research indicator that identifies five commonly followed bearish formations on the current symbol and timeframe.
The indicator displays pattern-shaped outlines directly over the price chart and provides a separate lower panel showing when each formation was identified throughout the available chart history.
PATTERNS IDENTIFIED
• Classic Bear Flag
• Descending Triangle
• Rising Wedge
• Double Top
• Inverse Cup and Handle
HOW IT WORKS
Classic Bear Flag
BearScope searches for a strong downward flagpole followed by a controlled, upward-sloping consolidation channel. The upper and lower channel slopes must be reasonably parallel, and the consolidation must remain within the selected maximum retracement.
Descending Triangle
The indicator looks for approximately horizontal support combined with descending resistance and repeated tests near the support area. The pattern is identified when price confirms a downside breakdown beneath the fitted support line.
Rising Wedge
BearScope searches for rising upper and lower boundaries that converge as the pattern develops. The lower boundary must rise faster than the upper boundary, creating a narrowing structure. Identification requires a confirmed downside breakdown.
Double Top
Two confirmed pivot highs must occur within the selected price tolerance and bar-separation limits. A meaningful decline must appear between the two tops.
Because pivot highs require subsequent candles for confirmation, a Double Top is recognized only after the selected pivot-strength period has elapsed.
Inverse Cup and Handle
The indicator searches for two similar lower rim areas separated by a rounded price advance, followed by a smaller upward handle. Identification requires price to break below the rim area.
CHART DISPLAY
Pattern-shaped outlines are drawn directly on the main price chart:
• Red — Classic Bear Flag
• Yellow — Descending Triangle
• Orange — Rising Wedge
• Purple — Double Top
• Aqua — Inverse Cup and Handle
LOWER PATTERN PANEL
The lower panel contains five permanently labeled rows corresponding to the five pattern types.
• Faint dotted lines identify each pattern row.
• Thick colored segments show the complete historical duration of identified patterns.
• Colored confirmation markers identify the candle on which the script confirmed the pattern.
• Pattern names remain positioned at the left edge of the visible chart and automatically adjust when the chart is scrolled or zoomed.
ALERTS
Individual alert conditions are available for:
• Bear Flag
• Descending Triangle breakdown
• Rising Wedge breakdown
• Double Top
• Inverse Cup and Handle breakdown
IMPORTANT INFORMATION
BearScope evaluates only the symbol and timeframe currently displayed on the chart. It does not scan the entire stock market or a TradingView watchlist.
Pattern detection is based on mathematical approximations of price structure. Real-world formations are subjective, and no automated method will identify every valid pattern or exclude every questionable one.
Historical markings show when the script’s programmed conditions were satisfied. They are not evidence that a trade would have been profitable.
Double Top detection uses confirmed pivots and therefore occurs after the actual pivot candle. Pattern drawings may extend back to the formation’s earlier bars, but the information was not available until confirmation occurred.
DISCLAIMER
BearScope is provided solely for educational, informational and historical research purposes. It is not financial or investment advice and does not constitute a recommendation to buy, sell or short any security.
A detected pattern does not guarantee a downside move. Bearish formations can fail, reverse or break upward. Users should independently evaluate trend, volume, liquidity, market conditions, news, risk tolerance and position sizing before making any trading decision.
Past performance and historical chart patterns are not reliable indicators of future results. Indicator

Red Light / Green LightRed Light / Green Light (ATR Distribution & FTD Signals)
Pressing the gas when momentum favors you is easy, but the hard part is knowing when to hit the brakes before getting caught in a sharp distribution drop.
Red Light / Green Light is an overlay indicator designed to keep you on the right side of heavy market moves. It combines ATR-based volatility expansion on down days with Follow-Through Day (FTD) breakout logic to give clear visual entry and exit cues right on your chart.
How It Works
Red Light (Bearish Exit Signal): Triggers on down-bars where the body size expands beyond a customizable ATR threshold (default: 1.5x 10-period ATR). This flags heavy institutional selling or distribution before a deeper pullback unfolds.
Green Light (Bullish Entry Signal): Triggers on a custom Follow-Through Day setup requiring a minimum +1.5% single-day gain, higher volume than the prior bar, and structural price support off a 10-day lookback low.
Key Features & Customization
Custom Emojis or Text: Choose from preset emojis (e.g., 🍆 / ☠️, 🚀 / 💥) or type in your own custom text labels (e.g., "BUY", "SELL", "GTFO", "DONT BE A HERO").
Smart Wick Clearance: Uses ATR-based dynamic positioning so labels remain readable across all timeframes without crowding candle wicks.
Directional Arrows: Optional toggleable pointer arrows (↑ / ↓) pointing directly at signal candles.
Alert Ready: Includes native alertcondition triggers for both Red Light and Green Light signals so you can route them to webhooks, pop-ups, or SMS.
How to Use
1. Add to Chart: Works across standard timeframes (Daily recommended for standard swing trading logic).
2. Adjust Inputs: Fine-tune ATR length, percentage gain thresholds, or lookback periods in the settings menu to fit your asset class (Equities, Crypto, Futures).
3. Set Alerts: Create a TradingView alert selecting "Red Light Alert" or "Green Light Alert" for real-time notification.
Disclaimer: For educational and informational purposes only. Always manage risk and conduct your own analysis before entering any trade. Indicator

Sphinx Fixed Price GridA grid of horizontal lines at every N-point multiple of price, plus the order prices those multiples imply.
What it does
The grid is computed as floor(price / step) × step. It depends on price alone, so the same levels appear on every chart, every reload, and every timeframe. There is no anchor bar and no state carried between sessions.
Why that matters
Traditional Renko anchors its brick sequence to the start of available data rather than to a price grid. There is no offset input, and the anchor can move when the data window changes — loading more history, switching sessions, or reloading the chart. Brick boundaries are therefore not a stable price reference, even though they look like one.
Any method that places orders relative to brick edges inherits that instability. This indicator computes the levels arithmetically instead, so they are reproducible.
Order levels
Optionally marks the entry and protective stop implied by the current grid position, on both sides. Entry sits one tick beyond the next grid level so a stop order triggers on a break rather than a touch; the protective stop sits on the grid level a configurable number of steps away. The tick offset applies to the entry only — offsetting both ends would change the risk distance without it being obvious.
Distances are shown in points on the labels and exported to the data window.
Drift check
An optional readout comparing the current close against the nearest grid level. On a Renko chart this reveals whether the plotted brick boundaries sit on grid prices or somewhere between them. A non-zero reading means brick edges are not grid levels and should not be used as order prices.
Notes
Set the grid step to match your brick size. The indicator draws levels and reports distances only. It reads no trend, generates no signals, and takes no directional view. Indicator

THE 4TH DESKWatermark + ATR + 4 EMA
A three-in-one overlay indicator combining a chart watermark, an ATR-based stop-loss reference, and a four-line EMA ribbon — each independently configurable and toggleable.
Watermark
Displays the current symbol, exchange prefix, timeframe, and (optionally) percentage change in a customizable table anchored to any corner or edge of the chart. Includes an editable signature/branding field, adjustable text sizes, and a custom color with transparency support.
ATR Value Table
Calculates Average True Range (length and smoothing method both configurable — RMA, SMA, EMA, or WMA) multiplied by a user-defined multiplier, useful for setting stop-loss distances. Shown in its own bordered table, positioned and styled independently from the watermark.
4 EMA Ribbon
Plots four exponential moving averages (default periods: 13, 34, 55, 200) on the price chart, each with its own configurable length and color — useful for trend identification and dynamic support/resistance.
All three components have their own input group in the settings panel (Watermark / ATR / 4 EMA), so you can enable, disable, or restyle each piece independently without affecting the others.
Indicator

IST Trading SessionsSession ranges plotted in Indian Standard Time (UTC+5:30).
This is for traders trading forex in IST hours.
WHAT IT DRAWS
- A live box around each session's high and low, labelled inside the box
with the session name and its current range in dollars. No floating
labels cluttering the chart.
- Two dotted lines carrying the last completed session's high and low
forward, so you can see whether price is reacting to the Tokyo high or
the London low without scrolling back.
- Killzone shading over the first 90 minutes of the London and New York
opens.
- Previous day high and low.
- A summary table with each session's range in dollars and pips, and a
marker showing which session is currently live.
DEFAULT TIMES (IST)
Tokyo 05:30 – 14:30
London 12:30 – 21:30
New York 17:30 – 02:30
DAYLIGHT SAVING
India does not observe daylight saving, but London and New York do. The
defaults above are set for summer (BST / EDT), roughly mid-March to late
October. During winter, add one hour to the London and New York session
inputs. All three sessions are editable, so you can also set them to
whatever windows you actually trade.
KEEPING IT READABLE
Boxes are only drawn for the last N days, adjustable, which stops the
chart filling up on long scrollbacks. Carry-forward lines extend a set
number of bars and older ones are removed automatically. Background tint
is off by default; turn it on if you prefer shading over boxes.
NOTES
This is a visual reference tool. It generates no signals and makes no
suggestion about direction. Works on any intraday timeframe, though
session boxes are most useful on 5m to 1h. Indicator

OTE Wealth Multi-Timeframe [Din]OTE Wealth — Multi-Timeframe Fibo / ICT Optimal Trade Entry Map
Short description (for the script list):
Multi-timeframe Fibo / ICT OTE (Optimal Trade Entry) mapping tool with confirmed-swing detection, full zone lifecycle, and visual backtesting through unlimited historical zones.
Full description:
OTE Wealth maps the ICT Optimal Trade Entry retracement zone (0.618–0.886, with 0.705 as the primary sweet spot) across up to 5 independently configurable timeframes at once — see your current chart's OTE alongside 5m, 15m, 1H and 4H without switching charts or cluttering price action.
Detection, not guesswork. Impulse legs are anchored to confirmed pivots only (ta.pivothigh/ta.pivotlow), filtered by market structure break and/or ATR displacement so minor noise never becomes a zone. The leg anchor uses the deepest confirmed pullback between swings, not just the most recent pivot, so the fib is drawn from the true impulse rather than a fragment of it. Higher-timeframe data is pulled through request.security with lookahead_off and an optional one-bar confirmation shift — built to minimize repaint, accepting a small delay in exchange for zones that don't move once drawn.
Built for visual backtesting. Every OTE ever confirmed is retained — not just the current one — with its original swing anchors, sweet spot line, and label intact. Choose how history is kept: a fixed count per timeframe, a lookback in bars, or a lookback in days, with no upper limit. Scroll back through the chart and see exactly how price reacted to past zones, on every timeframe, at once.
Clean by design. Transparent fills, a prominent 0.705 line, right-side labels instead of clutter on old candles, and an automatic object-budget manager that keeps the most recent zones fully detailed while older ones gracefully fade to a simple shaded box — so a deep history never breaks the chart or exceeds TradingView's drawing limits.
Also included: 3 custom fib levels, configurable invalidation (close or wick beyond 0.886, with fade/delete/keep behavior), swing-point markers, and alerts for zone entry, sweet-spot touch, core-range entry, invalidation, and new zone creation — with timeframe and direction included in the alert message.
This is a mapping tool, not a signal generator — it shows you where OTE zones are, not when to trade them. Indicator
