3-Candle Swing Highs & Lows//@version=5
indicator("3-Candle Swing Highs & Lows", overlay=true, max_lines_count=1000)
// Inputs
highColor = input.color(color.red, "Swing High (Unbroken)")
highBreachCol = input.color(color.green, "Swing High (Breached)")
lowColor = input.color(color.blue, "Swing Low (Unbroken)")
lowBreachCol = input.color(color.orange, "Swing Low (Breached)")
// Arrays for storing lines and prices
var line highLines = array.new_line()
var float highPrices = array.new_float()
var line lowLines = array.new_line()
var float lowPrices = array.new_float()
// --- Swing High condition ---
// We check candle (the middle one) against candle and candle
isSwingHigh = high > high and high > high
// --- Swing Low condition ---
isSwingLow = low < low and low < low
// If swing high found (confirmed after bar closes)
if isSwingHigh
newHigh = line.new(bar_index - 1, high , bar_index, high , extend=extend.right, color=highColor, width=2)
array.push(highLines, newHigh)
array.push(highPrices, high )
// If swing low found (confirmed after bar closes)
if isSwingLow
newLow = line.new(bar_index - 1, low , bar_index, low , extend=extend.right, color=lowColor, width=2)
array.push(lowLines, newLow)
array.push(lowPrices, low )
// Update line colours for swing highs
for i = 0 to array.size(highLines) - 1
ln = array.get(highLines, i)
lvl = array.get(highPrices, i)
if close > lvl
line.set_color(ln, highBreachCol)
else
line.set_color(ln, highColor)
// Update line colours for swing lows
for i = 0 to array.size(lowLines) - 1
ln = array.get(lowLines, i)
lvl = array.get(lowPrices, i)
if close < lvl
line.set_color(ln, lowBreachCol)
else
line.set_color(ln, lowColor)
Grafik Desenleri
Greer Gap# Greer Gap Indicator (No mitigation: i.e. removing false signals)
## Summary
The **Greer Gap Indicator** identifies **Fair Value Gaps (FVGs)** and introduces specialized **Greer Bull Gaps (Blue)** and **Greer Bear Gaps (Orange)** to highlight high-probability trading opportunities. Unlike traditional FVG indicators, it avoids hindsight bias by not removing historical gaps based on future price action, ensuring transparency in signal accuracy. Built upon LuxAlgo’s FVG logic, it adds unique filtering: only the first Greer Gap after an opposite gap is plotted if its level (min for Bull, max for Bear) is not higher/lower than the previous Greer Gap of the same type, while all valid gaps are recorded for comparison. Traders can use these gaps as support/resistance or entry signals, customizable via timeframe, look back, and display options.
## Description
This indicator detects and displays **Fair Value Gaps (FVGs)** on the chart, with a focus on specialized **Greer Gaps**:
- **Bullish Gaps (Green)**: Areas where the low of the current candle is above the high of a previous candle (look back period), indicating potential upward momentum.
- **Bearish Gaps (Red)**: Areas where the high of the current candle is below the low of a previous candle, indicating potential downward momentum.
- **Greer Bull Gaps (Blue)**: A bullish gap that is above the latest bearish gap's max. Only the first such gap after a bearish gap is plotted if it meets criteria (not higher than the previous Greer Bull Gap's min), but all valid ones are recorded for comparison.
- **Greer Bear Gaps (Orange)**: A bearish gap that is below the latest bullish gap's min. Only the first such gap after a bullish gap is plotted if it meets criteria (not lower than the previous Greer Bear Gap's max), but all valid ones are recorded.
## How It Works
The script uses a dynamic look back period to detect FVGs. It maintains a record of all detected gaps and applies additional logic for Greer Gaps:
- **Greer Bull Gaps**: Checks if the new bullish gap's min is above the latest bearish gap's max. Plots only if it's the first since the last bearish gap and its min is <= previous Greer Bull min (or first one).
- **Greer Bear Gaps**: Checks if the new bearish gap's max is below the latest bullish gap's min. Plots only if it's the first since the last bullish gap and its max is >= previous Greer Bear max (or first one).
- **Resets**: A new bearish gap resets the Greer Bull Gap flag, and a new bullish gap resets the Greer Bear Gap flag.
## How to Use
- **Timeframe**: Set a higher timeframe (e.g., 'D' for daily) to detect gaps from that timeframe on the current chart.
- **Look back Period**: Adjust to change gap detection sensitivity (default: 34). Use 2 if you want to compare to LuxAlgo
- **Extend**: Controls how far right the gap boxes extend.
- **Show Options**: Toggle visibility of all bullish/bearish gaps or Greer Gaps.
- **Colors**: Customize colors for each gap type.
- **Application**: Use Greer Gaps as potential support/resistance levels or entry signals, but combine with other analysis for confirmation.
## Originality and Credits
This script is inspired by and builds upon the **"Fair Value Gap "** indicator by LuxAlgo (available on TradingView: ()).
**Credits**: Thanks to LuxAlgo for the core FVG detection logic.
**Significant Changes**:
- Added **Greer Bull and Bear Gap** logic for filtered, directional gaps with reset mechanisms.
- Introduced recording of all valid Greer Gaps without plotting all, to compare levels without hindsight bias.
- **No mitigation/removal of gaps**: Unlike LuxAlgo's approach, which mitigates (removes or alters) gaps based on future price action (e.g., when filled), this can create a hindsight bias where incorrect signals disappear over time. If a signal is used for a trade and later removed due to new data, it doesn't reflect real-time performance accurately. The Greer Gap avoids this by using gap comparisons to validate signals without altering historical boxes, ensuring transparency in when signals were right or wrong.
MTF FVG Confluence v6 — JSON Alerts via alert()This strategy combines multi-timeframe confluence with candlestick analysis and fair value gaps (FVGs) to generate structured long/short entries. It aligns Daily and 4H EMA trends with 1H MACD momentum, then confirms with engulfing candles and FVG zones for precision entries. Risk management is built-in, featuring stop-loss, 3R take-profit targets, and optional break-even logic, with dynamic JSON alerts for webhook automation.
Categories:
Candlestick analysis
Chart patterns
Cycles
Market Opening Time### TradingView Pine Script "Market Opening Time" Explanation
This Pine Script (`@version=5`) is an indicator that visually highlights market trading sessions (Sydney, London, New York, etc.) by changing the chart's background color. It adjusts for U.S. and Australian Daylight Saving Time (DST).
---
#### **1. Overview**
- **Purpose**: Changes the chart's background color based on UTC time zones to highlight market sessions.
- **Features**:
- Automatically adjusts for U.S. DST (2nd Sunday of March to 1st Sunday of November) and Australian DST (1st Sunday of October to 1st Sunday of April).
- Assigns colors to four time zones (00:00, 06:30, 14:00, 21:00).
- **Use Case**: Helps forex/stock traders identify active market sessions.
---
#### **2. Key Logic**
- **DST Detection**:
- `f_isUSDst`: Checks U.S. DST status.
- `f_isAustraliaDst`: Checks Australian DST status.
- **Time Adjustment** (`f_getAdjustedTime`):
- U.S. DST off: Shifts `time3` (14:00) forward by 1 hour.
- Australian DST off: Shifts `time4` (21:00) forward by 1 hour.
- **Time Conversion** (`f_timeToMinutes`): Converts time (e.g., "14:00") to minutes (e.g., 840).
- **Current Time** (`f_currentTimeInMinutes`): Gets UTC time in minutes.
- **Background Color** (`f_getBackgroundColor`):
- Applies colors based on time ranges:
- 00:00–06:30: Orange (Asia)
- 06:30–14:00: Purple (London)
- 14:00–21:00: Blue (New York, DST-adjusted)
- 21:00–00:00: Red (Sydney, DST-adjusted)
- Outside ranges: Gray
---
#### **3. Settings**
- **Time Zones**:
- `time1` = 00:00 (Orange)
- `time2` = 06:30 (Purple)
- `time3` = 14:00 (Blue, DST-adjusted)
- `time4` = 21:00 (Red, DST-adjusted)
- **Colors**: Transparency set to 90 for visibility.
---
#### **4. Example**
- **September 5, 2025, 10:25 PM JST (13:25 UTC)**:
- U.S. DST active, Australian DST inactive.
- 13:25 UTC falls between `time2` (06:30) and `time3` (14:00) → Background is **Purple** (London session).
- **Effect**: Background color changes dynamically to reflect active sessions.
---
#### **5. Customization**
- Modify `time1`–`time4` or colors for different sessions.
- Add time zones for other markets (e.g., Tokyo).
---
#### **6. Notes**
- Uses UTC; ensure chart is set to UTC.
- DST rules are U.S./Australia-specific; verify for other regions.
A simple, visual tool for tracking market sessions.
----
### TradingView Pine Script「Market Opening Time」解説
このPine Script(`@version=5`)は、市場の取引時間帯(シドニー、ロンドン、ニューヨークなど)を背景色で視覚化するインジケーターです。米国とオーストラリアの夏時間(DST)を考慮し、時間帯を調整します。
---
#### **1. 概要**
- **目的**: UTC基準の時間帯に基づき、チャートの背景色を変更して市場セッションを強調。
- **機能**:
- 米国DST(3月第2日曜~11月第1日曜)とオーストラリアDST(10月第1日曜~4月第1日曜)を自動調整。
- 4つの時間帯(00:00、06:30、14:00、21:00)に色を割り当て。
- **用途**: FXや株式トレーダーが市場のアクティブ時間を把握。
---
#### **2. 主要ロジック**
- **DST判定**:
- `f_isUSDst`: 米国DSTを判定。
- `f_isAustraliaDst`: オーストラリアDSTを判定。
- **時間調整** (`f_getAdjustedTime`):
- 米国DST非適用時: `time3`(14:00)を1時間遅延。
- オーストラリアDST非適用時: `time4`(21:00)を1時間遅延。
- **時間変換** (`f_timeToMinutes`): 時間(例: "14:00")を分単位(840)に変換。
- **現在時刻** (`f_currentTimeInMinutes`): UTCの現在時刻を分単位で取得。
- **背景色** (`f_getBackgroundColor`):
- 時間帯に応じた色を適用:
- 00:00~06:30: オレンジ(アジア)
- 06:30~14:00: 紫(ロンドン)
- 14:00~21:00: 青(ニューヨーク、DST調整)
- 21:00~00:00: 赤(シドニー、DST調整)
- 時間外: グレー
---
#### **3. 設定**
- **時間帯**:
- `time1` = 00:00(オレンジ)
- `time2` = 06:30(紫)
- `time3` = 14:00(青、DST調整)
- `time4` = 21:00(赤、DST調整)
- **色**: 透明度90で視認性確保。
---
#### **4. 使用例**
- **2025年9月5日22:25 JST(13:25 UTC)**:
- 米国DST適用、豪DST非適用。
- 13:25は`time2`(06:30)~`time3`(14:00)の間 → 背景色は**紫**(ロンドン)。
- **効果**: 時間帯に応じて背景色が変化し、市場セッションを直感的に把握。
---
#### **5. カスタマイズ**
- 時間帯(`time1`~`time4`)や色を変更可能。
- 他の市場(例: 東京)に対応する時間帯を追加可能。
---
#### **6. 注意点**
- UTC基準のため、チャート設定をUTCに。
- DSTルールは米国・オーストラリア準拠。他地域では要確認。
シンプルで視覚的な市場時間インジケーターです。
dabilThe strategy is probably to go short or long with the trend depending on the case, but if all time units 1 minute then 3 minutes then 5 minutes then 15 minutes then 1 hour all show the same direction, but first the 1 hour must be bullish in which the 1 hour candle closes above the previous one, for example if the trend is bearish then the market wants to change direction, then a 1 hour bullish close must then be followed by a 1 hour bearish close below the bullish candle, then another bullish candle must shoot above the previous bullish candle, then 15 minutes also shoot above the previous 15 bullish candles, then 1 and 2...3.5. Then I can rise with the market by only covering the last 15 bullish candles with my stop loss, if my SL is 50 pips then I want 100 pips and then I'm out.
Kalkulator pozycji N100This indicator is a real-time position size calculator designed specifically for NASDAQ 100 futures (E-mini NQ and Micro NQ). It works on any timeframe, best on 1-minute charts, and calculates your position size based on candle body (ignoring wicks). This allows you to always see your exact risk and the number of contracts you can take before the candle closes.
FVG & SMA @danciFVG zones with 200 SMA & daily dividers for intraday analysis, customizable and clear.
Prev Swing High/Low Before Session (TF 1H/4H)Higher Lows (HL) indicate weakening selling pressure and possible upward trends. Lower Highs (LH) show reduced buying strength and potential bearish trends.
bygokcebey crt 1-5-9This script is designed to help you effortlessly track the 1 AM, 5 AM, and 9 AM timeframes, and monitor these levels across lower timeframes as well. It allows you to easily identify key price levels, such as the lowest, highest, and mid points during these crucial times, giving you a clear visual guide for trading decisions.
Key Features:
Defined Timeframes: The script specifically highlights the 1 AM, 5 AM, and 9 AM timeframes by drawing lines (representing the low, high, and mid levels) and adding labels (CRT Low, CRT High, and 50%) at these critical times.
Visibility of Time Levels: These key levels will appear only during the specified timeframes, ensuring a clean chart with relevant data at key moments.
Tracking in Lower Timeframes: These levels can also be followed in lower timeframes (e.g., 4-hour charts), allowing traders to monitor the important price levels continuously as they evolve.
Indicator Features:
The "bygokcebey crt 1-5-9" indicator will plot lines and labels only during the 1 AM, 5 AM, and 9 AM timeframes.
These levels can be tracked across lower timeframes, offering continuous reference points for your trades.
The lines and labels serve as visual markers, helping you track significant price points and providing a reliable guide to refine your trading strategy.
If you'd like to add more features or make any adjustments, feel free to let me know how I can assist further!
Shalev OB V2Indicator for OB for order blocks trade used to send an slert every time there is a new OB created or an old one is tuched
Trend River Pullback (Avramis-style) v1//@version=5
strategy("Trend River Pullback (Avramis-style) v1",
overlay=true, initial_capital=10000, commission_type=strategy.commission.percent, commission_value=0.02,
pyramiding=0, calc_on_order_fills=true, calc_on_every_tick=true, margin_long=1, margin_short=1)
// ===== Inputs
// EMA "река"
emaFastLen = input.int(8, "EMA1 (быстрая)")
ema2Len = input.int(13, "EMA2")
emaMidLen = input.int(21, "EMA3 (средняя)")
ema4Len = input.int(34, "EMA4")
emaSlowLen = input.int(55, "EMA5 (медленная)")
// Откат и импульс
rsiLen = input.int(14, "RSI длина")
rsiOB = input.int(60, "RSI порог тренда (лонг)")
rsiOS = input.int(40, "RSI порог тренда (шорт)")
pullbackPct = input.float(40.0, "Глубина отката в % ширины реки", minval=0, maxval=100)
// Риск-менеджмент
riskPct = input.float(1.0, "Риск на сделку, % от капитала", step=0.1, minval=0.1)
atrLen = input.int(14, "ATR длина (стоп/трейлинг)")
atrMultSL = input.float(2.0, "ATR множитель для стопа", step=0.1)
tpRR = input.float(2.0, "Тейк-профит R-множитель", step=0.1)
// Трейлинг-стоп
useTrail = input.bool(true, "Включить трейлинг-стоп (Chandelier)")
trailMult = input.float(3.0, "ATR множитель трейлинга", step=0.1)
// Торговые часы (по времени биржи TradingView символа)
useSession = input.bool(false, "Ограничить торговые часы")
sessInput = input.session("0900-1800", "Сессия (локальная для биржи)")
// ===== Calculations
ema1 = ta.ema(close, emaFastLen)
ema2 = ta.ema(close, ema2Len)
ema3 = ta.ema(close, emaMidLen)
ema4 = ta.ema(close, ema4Len)
ema5 = ta.ema(close, emaSlowLen)
// "Река": верх/низ как конверт по средним
riverTop = math.max(math.max(ema1, ema2), math.max(ema3, math.max(ema4, ema5)))
riverBot = math.min(math.min(ema1, ema2), math.min(ema3, math.min(ema4, ema5)))
riverMid = (riverTop + riverBot) / 2.0
riverWidth = riverTop - riverBot
// Трендовые условия: выстроенность EMAs
bullAligned = ema1 > ema2 and ema2 > ema3 and ema3 > ema4 and ema4 > ema5
bearAligned = ema1 < ema2 and ema2 < ema3 and ema3 < ema4 and ema4 < ema5
// Импульс
rsi = ta.rsi(close, rsiLen)
// Откат внутрь "реки"
pullbackLevelBull = riverTop - riverWidth * (pullbackPct/100.0) // чем больше %, тем глубже внутрь
pullbackLevelBear = riverBot + riverWidth * (pullbackPct/100.0)
pullbackOkBull = bullAligned and rsi >= rsiOB and low <= pullbackLevelBull
pullbackOkBear = bearAligned and rsi <= rsiOS and high >= pullbackLevelBear
// Триггер входа: возврат в импульс (пересечение быстрой EMA)
longTrig = pullbackOkBull and ta.crossover(close, ema1)
shortTrig = pullbackOkBear and ta.crossunder(close, ema1)
// Сессия
inSession = useSession ? time(timeframe.period, sessInput) : true
// ATR для стопов
atr = ta.atr(atrLen)
// ===== Position sizing по риску
// Расчет размера позиции: риск% от капитала / (стоп в деньгах)
capital = strategy.equity
riskMoney = capital * (riskPct/100.0)
// Предварительные уровни стопов
longSL = close - atrMultSL * atr
shortSL = close + atrMultSL * atr
// Цена тика и размер — приблизительно через syminfo.pointvalue (может отличаться на разных рынках)
tickValue = syminfo.pointvalue
// Избежать деления на 0
slDistLong = math.max(close - longSL, syminfo.mintick)
slDistShort = math.max(shortSL - close, syminfo.mintick)
// Кол-во контрактов/лотов
qtyLong = riskMoney / (slDistLong * tickValue)
qtyShort = riskMoney / (slDistShort * tickValue)
// Ограничение: не меньше 0
qtyLong := math.max(qtyLong, 0)
qtyShort := math.max(qtyShort, 0)
// ===== Entries
if inSession and longTrig and strategy.position_size <= 0
strategy.entry("Long", strategy.long, qty=qtyLong)
if inSession and shortTrig and strategy.position_size >= 0
strategy.entry("Short", strategy.short, qty=qtyShort)
// ===== Exits: фиксированный TP по R и стоп
// Храним цену входа
var float entryPrice = na
if strategy.position_size != 0 and na(entryPrice)
entryPrice := strategy.position_avg_price
if strategy.position_size == 0
entryPrice := na
// Цели
longTP = na(entryPrice) ? na : entryPrice + tpRR * (entryPrice - longSL)
shortTP = na(entryPrice) ? na : entryPrice - tpRR * (shortSL - entryPrice)
// Трейлинг: Chandelier
trailLong = close - trailMult * atr
trailShort = close + trailMult * atr
// Итоговые уровни выхода
useTrailLong = useTrail and strategy.position_size > 0
useTrailShort = useTrail and strategy.position_size < 0
// Для лонга
if strategy.position_size > 0
stopL = math.max(longSL, na) // базовый стоп
tStop = useTrailLong ? trailLong : longSL
// Выход по стопу/трейлу и ТП
strategy.exit("L-Exit", from_entry="Long", stop=tStop, limit=longTP)
// Для шорта
if strategy.position_size < 0
stopS = math.min(shortSL, na)
tStopS = useTrailShort ? trailShort : shortSL
strategy.exit("S-Exit", from_entry="Short", stop=tStopS, limit=shortTP)
// ===== Visuals
plot(ema1, "EMA1", display=display.all, linewidth=1)
plot(ema2, "EMA2", display=display.all, linewidth=1)
plot(ema3, "EMA3", display=display.all, linewidth=2)
plot(ema4, "EMA4", display=display.all, linewidth=1)
plot(ema5, "EMA5", display=display.all, linewidth=1)
plot(riverTop, "River Top", style=plot.style_linebr, linewidth=1)
plot(riverBot, "River Bot", style=plot.style_linebr, linewidth=1)
fill(plot1=plot(riverTop, display=display.none), plot2=plot(riverBot, display=display.none), title="River Fill", transp=80)
plot(longTP, "Long TP", style=plot.style_linebr)
plot(shortTP, "Short TP", style=plot.style_linebr)
plot(useTrailLong ? trailLong : na, "Trail Long", style=plot.style_linebr)
plot(useTrailShort ? trailShort : na, "Trail Short", style=plot.style_linebr)
// Маркеры сигналов
plotshape(longTrig, title="Long Trigger", style=shape.triangleup, location=location.belowbar, size=size.tiny, text="L")
plotshape(shortTrig, title="Short Trigger", style=shape.triangledown, location=location.abovebar, size=size.tiny, text="S")
// ===== Alerts
alertcondition(longTrig, title="Long Signal", message="Long signal: trend aligned + pullback + momentum")
alertcondition(shortTrig, title="Short Signal", message="Short signal: trend aligned + pullback + momentum")
COT-App//the COT-App generates potential trading signals for commodities and currencies futures based on the weekly COT data of the CFTC
//the COT data commercial netto, commercial short, non commercial short, non commercial long, a commercial netto oscillator, the ratio of commercial short tot he open interest and the open interest (types of COT data) can be shown as chart
//for each type of COT data you can define and set an extreme long and short level
//the COT types commercial netto, commercial short and commercial netto generate potential trading signals if the curve of type of COT data runs into the defined long or short extreme area
//a potential trading signal will be stronger if in additon further types of COT data runs in the same extreme area long or short
//
Futubull VWAPTo apply Futubull’s VWAP (Volume Weighted Average Price) indicator to TradingView, the key is to understand Futubull’s VWAP calculation logic and features, then replicate them using TradingView’s Pine Script language. Below are detailed steps and methods, incorporating the provided context and prior discussions, to help you create a custom VWAP indicator in TradingView that mirrors Futubull’s functionality. The script will be tailored for day trading CIEN (Ciena Corporation) on September 4, 2025, during pre-market (Hong Kong time 11:25 PM, equivalent to US Eastern Time 11:25 AM), leveraging its earnings-driven breakout ($115.50, +21.81%).
SESSIONS Golden Team SESSIONS — Multi-Session Forex Box & Range Analysis
This indicator displays the major Forex market sessions — London, New York, Tokyo, Sydney, and Frankfurt — directly on the chart. Each session is shown as a customizable colored box with optional Fibonacci levels and opening range markers.
It also calculates and displays the average pip range of each session over a user-defined number of past days, allowing traders to analyze volatility patterns for each trading period.
Key Features:
Configurable session times and time zones
Individual on/off toggle for each session
Custom colors, box transparency, and border styles
Optional Opening Range and Fibonacci retracement levels for each session
Average pip range table for quick volatility reference
Works on any intraday timeframe
How It Works:
The script identifies the start and end times of each session based on user settings.
A box is drawn around the high/low of the session period.
At the end of each session, the pip range is recorded, and an average is calculated over the last N sessions (default: 20).
The results are displayed in a statistics table showing average pips and whether the session is currently active.
Suggested Use:
Identify high-volatility sessions for breakout trading
Filter trades to active trading hours
Study historical volatility to refine entry timing
Current Trade Value DisplayThis indicator gives a large display of the current trade value at the bottom of the screen.
FRXFORTUNE GOLD ADVANCEThis indicator helps traders analyze gold price reaction after economic news releases.
You can manually input the Actual and Forecast values from news data.
Based on the difference, it shows a side box signal:
- If USD is strong → Gold sell signal
- If USD is weak → Gold buy signal
It also provides alerts when strong reactions are detected.
Consolidated 9-Indicator Buy/Sell Zones & TriggersALL important inductors combined for long term position holders and short term guys...use it to enter trade and exit ...backgroud colour will give you the indication of the market mood..
swapstrategy-Reversal StrategyGenerate buy and sell signals and reverses position when chart turn buy or sell side
ComboBearCustom indicator for identifying stocks that meet the Stockbee's ComboBear criteria. This can be used as a standalone indicator or use it to screen for stocks in Pine Screener.
Previous Week High/Low Fib Levelsautomatic fib with previous week high and low with custom retracement input
Multi-Timeframe HTS Retest Strategy v6Multi-Timeframe HTS Retest Strategy v6 is a trend-following tool designed to detect high-probability retest entries aligned with higher timeframe direction. The indicator applies HTS bands (short & long) on both the current and higher timeframe (4x–8x multiplier) to confirm market bias.
A strong trend is validated when HTS bands separate on the higher timeframe. On the lower timeframe, the strategy tracks price behavior relative to the bands: after breaking outside, price must retest either the fast (blue) or slow (red) band, confirmed by a rejection candle. This generates precise BUY or SELL retest signals.
Features include flexible average methods (RMA, EMA, SMA, etc.), customizable cross detection (final cross, 4 crosses, or both), volume-based retest conditions, and clear visual signals (dots for trend start, triangles for retests). Alerts are integrated for automation.
This strategy is suitable for forex, crypto, indices, and stocks, supporting both scalping and swing trading.
Sequential Pattern Strength [QuantAlgo]🟢 Overview
The Sequential Pattern Strength indicator measures the power and sustainability of consecutive price movements by tracking unbroken sequences of up or down closes. It incorporates sequence quality assessment, price extension analysis, and automatic exhaustion detection to help traders identify when strong trends are losing momentum and approaching potential reversal or continuation points.
🟢 How It Works
The indicator's key insight lies in its sequential pattern tracking system, where pattern strength is measured by analyzing consecutive price movements and their sustainability:
if close > close
upSequence := upSequence + 1
downSequence := 0
else if close < close
downSequence := downSequence + 1
upSequence := 0
The system calculates sequence quality by measuring how "perfect" the consecutive moves are:
perfectMoves = math.max(upSequence, downSequence)
totalMoves = math.abs(bar_index - ta.valuewhen(upSequence == 1 or downSequence == 1, bar_index, 0))
sequenceQuality = totalMoves > 0 ? perfectMoves / totalMoves : 1.0
First, it tracks price extension from the sequence starting point:
priceExtension = (close - sequenceStartPrice) / sequenceStartPrice * 100
Then, pattern exhaustion is identified when sequences become overextended:
isExhausted = math.abs(currentSequence) >= maxSequence or
math.abs(priceExtension) > resetThreshold * math.abs(currentSequence)
Finally, the pattern strength combines sequence length, quality, and price movement with momentum enhancement:
patternStrength = currentSequence * sequenceQuality * (1 + math.abs(priceExtension) / 10)
enhancedSignal = patternStrength + momentum * 10
signal = ta.ema(enhancedSignal, smooth)
This creates a sequence-based momentum indicator that combines consecutive movement analysis with pattern sustainability assessment, providing traders with both directional signals and exhaustion insights for entry/exit timing.
🟢 Signal Interpretation
Positive Values (Above Zero): Sequential pattern strength indicating bullish momentum with consecutive upward price movements and sustained buying pressure = Long/Buy opportunities
Negative Values (Below Zero): Sequential pattern strength indicating bearish momentum with consecutive downward price movements and sustained selling pressure = Short/Sell opportunities
Zero Line Crosses: Pattern transitions between bullish and bearish regimes, indicating potential trend changes or momentum shifts when sequences break
Upper Threshold Zone: Area above maximum sequence threshold (2x maxSequence) indicating extremely strong bullish patterns approaching exhaustion levels
Lower Threshold Zone: Area below negative threshold (-2x maxSequence) indicating extremely strong bearish patterns approaching exhaustion levels