Quasimodo (QML) Pattern [UAlgo]Quasimodo (QML) Pattern is a market structure pattern detector that identifies Quasimodo formations using confirmed swing pivots and then visualizes the full structure directly on the chart. The Quasimodo concept is often described as a stop run and reversal model where price first violates a prior swing point, then breaks structure in the opposite direction. This script formalizes that idea into a strict pivot sequence and draws the key structural components so the pattern can be reviewed consistently.
The indicator maintains a rolling history of pivot highs and pivot lows, then checks the most recent four pivots for a valid Quasimodo sequence. When a bullish or bearish QML is confirmed, the script draws a connected structure, highlights the pattern area with a fill, plots a Market Structure Break reference line, and marks a QML zone derived from the left shoulder and the head. The most recent pattern zone is extended forward to keep it visible for potential retests.
This tool is intended to support structured analysis of reversal setups, with visual anchors that make it easy to locate left shoulder, reaction, head, and MSB points without manual drawing.
🔹 Features
1) Pivot Based Swing Engine
The script uses pivot highs and pivot lows to define swings. Left Bars and Right Bars control how many bars are required to confirm each pivot. This creates stable swing points and reduces noise compared to raw candle comparisons.
Confirmed pivots are stored as PivotPoint objects with price, bar index, and direction (high or low). The pivot history is capped to keep memory efficient while retaining enough context for detection.
2) Strict Four Pivot Pattern Validation
Detection uses the most recent four pivots, enforcing an alternating sequence so the structure follows a zig zag pattern. Only sequences that alternate high and low consistently are eligible for classification.
This avoids false detections where multiple highs or multiple lows occur in a row.
3) Bullish QML Detection Logic
The bullish model requires:
Left shoulder is a low
Reaction is a high
Head is a lower low than the left shoulder
MSB is a higher high than the reaction
This represents a liquidity grab below the prior swing low followed by a break above the reaction high, which is treated as the structure break confirmation.
4) Bearish QML Detection Logic
The bearish model requires:
Left shoulder is a high
Reaction is a low
Head is a higher high than the left shoulder
MSB is a lower low than the reaction
This represents a liquidity grab above the prior swing high followed by a break below the reaction low.
5) Full Pattern Visualization with Structural Labels
When a pattern is detected, the script draws:
Three visible connector lines linking left shoulder to reaction, reaction to head, and head to MSB
A filled highlight over the core structure area to emphasize the liquidity grab geometry
Point labels at left shoulder, head, and MSB for quick reading
A descriptive pattern label showing Bullish QML or Bearish QML
Visual styling, colors, and label sizing are user configurable.
6) MSB Break Reference Line
A dotted horizontal line is drawn from the reaction point to the MSB point at the reaction price level. This acts as a clear market structure break reference and helps validate that the break level was actually exceeded in the required direction.
7) QML Zone Projection
The script draws a QML zone box that spans the price range between the left shoulder and the head. This zone is extended forward in time so it remains visible for potential retests and reactions.
8) Efficient Execution and Update Behavior
Pattern checks run only when a new pivot is confirmed, reducing repeated evaluation. The script also extends the most recent QML zone and repositions the main label forward for better ongoing visibility.
🔹 Calculations
1) Pivot Detection
Pivot highs and pivot lows are confirmed using Left Bars and Right Bars:
float ph = ta.pivothigh(leftLen, rightLen)
float pl = ta.pivotlow(leftLen, rightLen)
When a pivot is confirmed, the bar index is aligned to the pivot location using the rightLen offset:
if not na(ph)
pivotArray.pushPivot(ph, bar_index , true)
if not na(pl)
pivotArray.pushPivot(pl, bar_index , false)
Each pivot is stored as:
price
index
isHigh flag
2) Alternating Sequence Requirement
The script evaluates the last four pivots p0 through p3 and requires strict alternation:
bool correctSequence =
(p0.isHigh != p1.isHigh) and (p1.isHigh != p2.isHigh) and (p2.isHigh != p3.isHigh)
This ensures the sequence forms a valid zig zag structure.
3) Bullish Quasimodo Conditions
Bullish QML is evaluated when p0 is a low:
if not p0.isHigh
if p2.price < p0.price and p3.price > p1.price
Quasimodo qml = Quasimodo.new(p0, p1, p2, p3, true)
Interpretation:
Head is a lower low relative to the left shoulder
MSB is a higher high relative to the reaction
This produces a sweep and reversal structure with confirmation
4) Bearish Quasimodo Conditions
Bearish QML is evaluated when p0 is a high:
if p0.isHigh
if p2.price > p0.price and p3.price < p1.price
Quasimodo qml = Quasimodo.new(p0, p1, p2, p3, false)
Interpretation:
Head is a higher high relative to the left shoulder
MSB is a lower low relative to the reaction
5) Pattern Drawing Components
When a pattern is confirmed, the script draws connecting lines:
line.new(LS.index, LS.price, R.index, R.price)
line.new(R.index, R.price, H.index, H.price)
line.new(H.index, H.price, MSB.index, MSB.price)
It also draws a horizontal MSB reference at the reaction price:
line.new(reaction.index, reaction.price, msb.index, msb.price, style=line.style_dotted)
A QML zone box is created using left shoulder and head prices and extended forward:
qml.qmlZone := box.new(LS.index, LS.price, bar_index + 10, H.price, bgcolor=color.new(col, 85))
On each bar, the most recent zone is extended further to remain visible:
box.set_right(lastQml.qmlZone, bar_index + 5)
label.set_x(lastQml.lbl, bar_index + 5)
6) Pivot History Management
To keep execution efficient, the pivot array is capped:
if pivots.size() > 50
pivots.shift()
Pattern checking is triggered only when a new pivot is found, which reduces redundant processing on bars where no structural update occurred. インジケーター

Wedge Pattern [UAlgo]Overview
Wedge Pattern is a chart overlay that detects rising and falling wedge formations using strict pivot based rules and a validation engine that enforces classic technical analysis requirements. The script builds two trendlines from confirmed pivot highs and pivot lows, verifies that both boundaries converge toward an apex in the future, and ensures that price remains contained within the wedge until a valid breakout occurs.
The indicator is designed to reduce subjective pattern drawing. It requires a minimum number of touches on each boundary, checks that no candle closes outside the wedge during formation, and treats the wedge as invalid if price breaks in the wrong direction or if the two boundaries collapse into each other. When a breakout is confirmed, the script updates the wedge label and can project a measured target based on the initial wedge width.
This tool is meant for traders who want automatic, rules driven wedge identification with clear status states, breakout confirmation, and optional target projection on the chart.
🔹 Features
1) Pivot Based Wedge Construction
The script identifies swing highs and swing lows using pivot detection. Each confirmed pivot is stored as a Coordinate containing bar index and price. When enough pivots exist, the script forms:
An upper trendline from the earliest required pivot high to the most recent pivot high
A lower trendline from the earliest required pivot low to the most recent pivot low
Pivot Left and Pivot Right control swing sensitivity. Larger values produce fewer but stronger pivots. Smaller values react faster but may include minor swings.
2) Minimum Touch Requirement Per Boundary
A wedge is only considered valid when there are at least a user defined number of pivot touches for both the upper and lower boundary. This aligns with standard charting practice where two points draw a line, but three points validate it.
Min Touches per Line controls the minimum pivot count required before a wedge can be formed.
3) Objective Wedge Type Classification
After calculating slopes for the upper and lower trendlines, the script classifies wedge type using slope direction and relative steepness:
Rising wedge requires both slopes to be positive and the lower slope to be steeper than the upper slope
Falling wedge requires both slopes to be negative and the upper slope to be steeper than the lower slope in the negative direction
This ensures convergence and distinguishes wedges from simple channels.
4) Apex Projection and Future Convergence Rule
The wedge apex is computed as the intersection point of the two trendlines. A valid wedge requires the apex index to be in the future. This confirms that the boundaries are converging and that the pattern is not already expired at detection time.
5) Mandatory Containment Rule During Formation
A core validation rule enforces that no closes occur outside the wedge boundaries while the wedge is forming. If any close is above the upper boundary or below the lower boundary by at least one tick, the candidate wedge is rejected. This prevents premature breakouts from being treated as valid patterns.
6) Live Updating Boundaries
Once a wedge becomes active, the script extends both boundary lines on every bar by updating their end coordinates using the trendline slope. This keeps the wedge aligned with current time and allows breakout checks to remain accurate.
7) Breakout Detection and Status Labeling
The script defines correct breakouts by wedge type:
Rising wedge is bearish biased, so a valid breakout is a close below the lower boundary
Falling wedge is bullish biased, so a valid breakout is a close above the upper boundary
When a valid breakout occurs, the wedge status is updated to BROKEOUT and the label color reflects direction. If price breaks the opposite boundary, or if boundaries collapse, the wedge is marked FAILED.
8) Target Projection Using Measured Move
If enabled, the script projects a target line after breakout. The target distance is based on the wedge width measured near the start of the pattern, then projected from the breakout boundary:
For a rising wedge breakdown, the target is placed below the lower boundary by the measured width
For a falling wedge breakout, the target is placed above the upper boundary by the measured width
A target label prints the projected price level.
🔹 Calculations
1) Pivot Detection and Coordinate Storage
Swing points are detected using symmetric pivots:
float ph = ta.pivothigh(high, INPUT_PIVOT_LEFT, INPUT_PIVOT_RIGHT)
float pl = ta.pivotlow(low, INPUT_PIVOT_LEFT, INPUT_PIVOT_RIGHT)
Confirmed pivots are stored using the pivot right offset so the bar index matches where the pivot actually formed:
if not na(ph)
pivot_highs.push(Coordinate.new(bar_index - INPUT_PIVOT_RIGHT, ph))
if not na(pl)
pivot_lows.push(Coordinate.new(bar_index - INPUT_PIVOT_RIGHT, pl))
Arrays are capped to keep only recent pivot history.
2) Trendline Construction and Slope Calculation
When enough pivots exist, the script picks the earliest required touch and the most recent touch for both highs and lows, then builds trendlines:
Coordinate p1h = pivot_highs.get(pivot_highs.size() - MIN_TOUCHES_PER_LINE)
Coordinate pNh = pivot_highs.get(pivot_highs.size() - 1)
Trendline tl_up = Trendline.new(p1h, pNh, 0.0, na)
tl_up.slope := tl_up.calc_slope()
Slope is defined as:
(this.end.price - this.start.price) / (this.end.index - this.start.index)
The same logic is used for the lower trendline from pivot lows.
3) Wedge Type Rules
Wedge type is derived from slope sign and convergence:
Rising wedge:
if tl_up.slope > 0 and tl_lo.slope > 0 and tl_lo.slope > tl_up.slope
w_type := 1
Falling wedge:
if tl_up.slope < 0 and tl_lo.slope < 0 and tl_up.slope < tl_lo.slope
w_type := 2
This ensures both boundaries move in the same direction while converging.
4) Apex Index Calculation
The apex index is calculated from the line intersection of the two trendlines:
float apex_x = (y2 - y1 + m1 * x1 - m2 * x2) / (m1 - m2)
math.round(apex_x)
A candidate wedge is only accepted if apex index is greater than the current bar index.
5) Containment Validation Using Close Prices
The script checks each bar from the wedge start to the current bar to ensure that close remains within boundaries:
float up_p = this.upper.get_price_at(i)
float lo_p = this.lower.get_price_at(i)
float c_p = close
if c_p > up_p + syminfo.mintick or c_p < lo_p - syminfo.mintick
violated := true
If violated is true, the wedge is rejected.
6) Live Boundary Update and Breakout Checks
For active wedges, end coordinates are updated each bar using the projected boundary price:
line.set_y2(w.upper.line_id, w.upper.get_price_at(bar_index))
line.set_y2(w.lower.line_id, w.lower.get_price_at(bar_index))
Breakout checks use the current close against projected boundary prices:
bool b_up = close > u_p
bool b_dn = close < l_p
Correct breakout:
Rising wedge requires b_dn
Falling wedge requires b_up
Invalidation:
Rising wedge fails if b_up
Falling wedge fails if b_dn
Any wedge fails if upper boundary price is less than or equal to lower boundary price
7) Target Projection
Measured width is derived from the initial distance between boundaries near the start of the wedge, then projected from the breakout side:
float m = math.abs(w.upper.start.price - w.lower.get_price_at(w.upper.start.index))
float t = w.is_rising ? l_p - m : u_p + m
The target line and label are drawn forward a fixed number of bars to provide a clear reference after breakout. インジケーター

Auto Harmonic Pattern Recognition [UAlgo]Auto Harmonic Pattern Recognition is an overlay indicator that automatically scans price action for classical harmonic structures using a ZigZag style pivot engine. It continuously builds swing points, validates Fibonacci relationships across the last five pivots, and prints a confirmed pattern as soon as a valid X A B C D sequence is detected.
The script is engineered for practical chart use. It prioritizes clear geometry, a visible Potential Reversal Zone around point D, and an RR focused projection set that includes stop placement and multiple take profit levels. A compact dashboard also tracks how many patterns have been confirmed during the session, helping you understand how active the market has been for harmonic setups.
This tool is best used as a structure and planning layer. It provides harmonic recognition and a consistent measurement framework so you can focus on confirmation, execution timing, and risk management.
Features
1) Pivot Engine With Depth Control
The foundation of detection is a pivot system that identifies local swing highs and lows using a user defined Pivot Depth. Depth controls how strict the swing points are. Lower values react faster and produce more pivots. Higher values react slower and produce cleaner swings.
The engine maintains an internal pivot list, updates the last pivot when a more extreme value appears in the same direction, and keeps the stored history lightweight by limiting the array size.
2) Fully Automated Harmonic Recognition
Once at least five pivots exist, the script evaluates the most recent X A B C D sequence and checks it against multiple harmonic templates. The current build includes:
Gartley
Bat
Butterfly
Crab
Deep Crab
Cypher
Shark
5 0
Nen Star
Leonardo
Bullish and bearish variants are supported. The direction is decided by the high low sequence of X A B C D, so the same ratio logic can be applied to either side of the market.
3) Ratio Tolerance Control
Harmonics require ratios to land within acceptable bounds rather than exact values. Ratio Tolerance allows you to define how strict the matching is. A tighter tolerance reduces pattern count and increases selectivity. A wider tolerance increases pattern frequency and is more permissive.
The tolerance rule is applied as a symmetric band around target ratios where appropriate.
4) Elite Visualization Suite
The renderer draws a premium style structure that emphasizes readability:
Neon geometry lines connecting X A B C D
Soft internal fills to visually frame the legs
A PRZ glow zone around point D to highlight the decision area
Optional live ratio tags placed near relevant legs
A pattern label at point D with bull or bear styling
You can toggle PRZ, ratios, glow geometry, and the stats panel independently.
5) RR Focused Trade Projection
When a pattern prints, the script projects a complete planning scaffold:
A tight stop level placed slightly beyond the extreme point
Three take profit levels derived from AD expansion factors
Live RR values for each take profit based on the computed risk distance
This approach standardizes structure based exits and allows you to compare opportunities objectively across symbols and timeframes.
6) Performance Dashboard
A compact table panel can be displayed on the chart. It shows system status and the total number of patterns detected. This is useful for quickly verifying the script is active and for tracking how often the engine has confirmed structures in the current run.
Calculations
1) Pivot Detection Using Depth Window
A pivot is confirmed when the candle at index is the highest high or lowest low within a symmetric window:
Window size equals depth times 2 plus 1
float h = ta.highest(high, zz_depth * 2 + 1)
float l = ta.lowest(low, zz_depth * 2 + 1)
bool is_h = high == h
bool is_l = low == l
If a pivot is found, the engine pushes a new Pivot object containing bar index, price, and direction. If the direction has not changed, it upgrades the last pivot when a more extreme price appears.
2) X A B C D Selection
Detection always uses the most recent five pivots:
D is the latest pivot
C is the pivot before D
B is the pivot before C
A is the pivot before B
X is the pivot before A
Pivot d = zz_points.get(sz - 1)
Pivot c = zz_points.get(sz - 2)
Pivot b = zz_points.get(sz - 3)
Pivot a = zz_points.get(sz - 4)
Pivot x = zz_points.get(sz - 5)
3) Leg Length Measurements
All harmonic ratios are derived from absolute swing distances:
XA is distance from X to A
AB is distance from A to B
BC is distance from B to C
CD is distance from C to D
XD is distance from X to D
AC is distance from A to C
float xa = math.abs(a.price - x.price)
float ab = math.abs(b.price - a.price)
float bc = math.abs(c.price - b.price)
float cd = math.abs(d.price - c.price)
float xd = math.abs(d.price - x.price)
float ac = math.abs(c.price - a.price)
4) Ratio Set Computation
The script computes key ratios used by harmonic templates. Divisions are protected so a zero leg does not break the logic.
r_xb measures AB relative to XA
r_ac measures BC relative to AB
r_bd measures CD relative to BC
r_xd measures XD relative to XA
r_xa_c measures AC relative to XA
float r_xb = ab / (xa == 0 ? 1 : xa)
float r_ac = bc / (ab == 0 ? 1 : ab)
float r_bd = cd / (bc == 0 ? 1 : bc)
float r_xd = xd / (xa == 0 ? 1 : xa)
float r_xa_c = ac / (xa == 0 ? 1 : xa)
5) Bull and Bear Structure Validation
Before applying template ratios, the script verifies the pivot sequence forms a valid alternating swing structure.
Bullish sequence requires:
X low, A high, B low, C high, D low
Bearish sequence requires:
X high, A low, B high, C low, D high
bool is_bull = not x.is_high and a.is_high and not b.is_high and c.is_high and not d.is_high
bool is_bear = x.is_high and not a.is_high and b.is_high and not c.is_high and d.is_high
6) Tolerance Based Ratio Check
For ratios with a target value, the script uses a tolerance band:
actual must be within target times 1 minus tol and target times 1 plus tol
method check(float actual, float target, float tol) =>
actual >= target * (1 - tol) and actual <= target * (1 + tol)
7) Template Matching Logic
After structure is confirmed, the script assigns a pattern name when the ratio set fits known templates. Examples:
Gartley uses r_xb near 0.618 and r_xd near 0.786
Bat uses r_xb between 0.382 and 0.5 and r_xd near 0.886
Butterfly uses r_xb near 0.786 and r_xd between 1.27 and 1.618
Crab uses r_xb between 0.382 and 0.618 and r_xd near 1.618
Deep Crab uses r_xb near 0.886 and r_xd near 1.618
Additional templates are evaluated with their own ratio windows, including Cypher, Shark, 5 0, Nen Star, and Leonardo.
8) PRZ Glow Zone Construction
PRZ is rendered as a small box centered around point D. Its size is a percentage of the X to A amplitude, which scales the zone to market volatility:
float prz_size = math.abs(h_p.x.price - h_p.a.price) * 0.05
float prz_h = h_p.d.price + prz_size
float prz_l = h_p.d.price - prz_size
This creates a consistent glow zone width that adapts to the pattern’s overall magnitude.
9) RR Focused Stop and Take Profit Projection
The script calculates AD length and XA length to derive risk and targets.
Stop is placed beyond the extreme point by a small fraction of XA:
Extreme is min of X and D for bullish structures
Extreme is max of X and D for bearish structures
Stop offset equals XA length times 0.02
float ad_len = math.abs(h_p.a.price - h_p.d.price)
float xa_len = math.abs(h_p.a.price - h_p.x.price)
float extreme = h_p.bull ? math.min(h_p.x.price, h_p.d.price) : math.max(h_p.x.price, h_p.d.price)
float sl = h_p.bull ? extreme - (xa_len * 0.02) : extreme + (xa_len * 0.02)
float risk = math.max(math.abs(h_p.d.price - sl), syminfo.mintick)
Targets are projected from point D using AD expansion factors:
0.786
1.272
1.618
float tp1 = h_p.bull ? h_p.d.price + (ad_len * 0.786) : h_p.d.price - (ad_len * 0.786)
float tp2 = h_p.bull ? h_p.d.price + (ad_len * 1.272) : h_p.d.price - (ad_len * 1.272)
float tp3 = h_p.bull ? h_p.d.price + (ad_len * 1.618) : h_p.d.price - (ad_len * 1.618)
RR values are computed as reward divided by risk for each target:
float rr1 = math.abs(tp1 - h_p.d.price) / risk
float rr2 = math.abs(tp2 - h_p.d.price) / risk
float rr3 = math.abs(tp3 - h_p.d.price) / risk
10) Duplicate Print Prevention and Alerts
To prevent repeated drawings on the same D pivot, the script tracks the last D index and only renders when a new D is confirmed. When a new pattern prints, an alert is fired once per bar.
11) Analytics Panel Update
When enabled and on the last bar, the table updates with status and the total pattern count. This keeps the UI lightweight and avoids unnecessary per bar table writes. インジケーター

インジケーター

Harmonic Confluence Wave Detector [JOAT]Harmonic Confluence Wave Detector
Introduction
The Harmonic Confluence Wave Detector is an open-source oscillator-based indicator that combines WaveTrend, Money Flow Index (MFI), RSI, MACD, and Stochastic RSI into a unified momentum analysis system. This mashup creates a multi-layered oscillator framework designed to identify momentum shifts, overbought/oversold conditions, and divergence patterns across multiple timeframes and calculation methods.
The indicator addresses a common trading challenge: single oscillators can give conflicting or premature signals. By synthesizing five different momentum calculations that use distinct mathematical approaches, this tool provides confluence-based signals that occur when multiple momentum indicators align, significantly reducing false signals compared to using any single oscillator alone.
Chart showing WaveTrend oscillator, MACD histogram, and multi-signal system on 1H timeframe
Why This Mashup Exists
This indicator combines five oscillators that complement each other through different calculation methodologies:
WaveTrend: Smoothed momentum oscillator based on price deviation from exponential moving average
Money Flow Index (MFI): Volume-weighted RSI showing buying/selling pressure
RSI: Classic momentum oscillator measuring speed and magnitude of price changes
MACD: Trend-following momentum indicator showing relationship between two EMAs
Stochastic RSI: Stochastic calculation applied to RSI for enhanced sensitivity
Each oscillator has unique strengths: WaveTrend excels at identifying wave-like momentum cycles, MFI incorporates volume for institutional flow analysis, RSI provides reliable overbought/oversold readings, MACD shows trend strength and direction, and Stochastic RSI catches early momentum shifts. Together, they create a comprehensive momentum picture that no single oscillator can provide.
The mashup is justified because these oscillators use fundamentally different calculations (price-based, volume-weighted, moving average convergence, stochastic) that respond to different market conditions. When they align, it indicates genuine momentum shift rather than noise.
Core Components Explained
1. WaveTrend Oscillator (Primary Signal Generator)
WaveTrend is the primary oscillator, calculated using this methodology:
// Calculate exponential average of HLC3
esa = ta.ema(hlc3, channelLength)
// Calculate deviation
d = ta.ema(abs(hlc3 - esa), channelLength)
// Calculate channel index
ci = (hlc3 - esa) / (0.015 * d)
// Apply smoothing to create WaveTrend 1
wt1 = ta.ema(ci, averageLength)
// Create WaveTrend 2 as simple moving average of WT1
wt2 = ta.sma(wt1, 4)
WaveTrend oscillates around zero, with:
Values above +60: Overbought zone
Values above +80: Extreme overbought
Values below -60: Oversold zone
Values below -80: Extreme oversold
Crossovers between WT1 and WT2: Momentum shift signals
The indicator plots WT1 and WT2 as lines with dynamic coloring based on momentum direction and strength.
2. Money Flow Index (MFI) - Volume-Weighted Momentum
MFI calculation incorporates both price and volume:
// Calculate typical price
typicalPrice = (high + low + close) / 3
// Calculate raw money flow
rawMoneyFlow = typicalPrice * volume
// Separate positive and negative money flow
positiveFlow = close > close ? rawMoneyFlow : 0
negativeFlow = close < close ? rawMoneyFlow : 0
// Sum over MFI period
positiveSum = sum(positiveFlow, mfiLength)
negativeSum = sum(negativeFlow, mfiLength)
// Calculate MFI
mfi = 100 - (100 / (1 + positiveSum / negativeSum))
MFI ranges from 0-100, with readings above 80 indicating buying pressure and below 20 indicating selling pressure. The indicator plots MFI as a line and uses it for confluence scoring.
3. RSI - Classic Momentum Oscillator
Standard RSI calculation over 14 periods (configurable):
RSI > 70: Overbought
RSI < 30: Oversold
RSI > 65 with other bearish signals: Potential reversal
RSI < 35 with other bullish signals: Potential reversal
RSI provides reliable baseline momentum readings and is used for divergence detection.
4. MACD - Trend Momentum Indicator
MACD uses standard 12/26/9 settings:
= ta.macd(close, 12, 26, 9)
The indicator displays MACD histogram with enhanced width (linewidth 8) for visibility. Histogram color changes based on:
Green: Positive and increasing (bullish momentum)
Light green: Positive but decreasing (weakening bulls)
Red: Negative and decreasing (bearish momentum)
Light red: Negative but increasing (weakening bears)
MACD histogram provides visual confirmation of momentum strength and direction.
5. Stochastic RSI - Enhanced Sensitivity
Stochastic calculation applied to RSI values:
stochRSI = ta.stoch(rsi, rsi, rsi, 14)
Stochastic RSI oscillates between 0-100 and is more sensitive than regular RSI, catching momentum shifts earlier. The indicator plots both K and D lines for crossover analysis.
Example showing all oscillators with divergence markers and signal labels
Multi-Signal System
The indicator generates six tiers of signals based on confluence strength:
BUY Signals:
BUY: WT1 crosses above WT2 in oversold zone (WT1 < -40)
STRONG BUY: BUY + volume above average + MACD histogram positive
MEGA BUY: STRONG BUY + WT1 < -60 (extreme oversold) + RSI < 35
ULTRA BUY: MEGA BUY + MFI < 30 + Stoch RSI oversold + bullish divergence
SELL Signals:
SELL: WT1 crosses below WT2 in overbought zone (WT1 > 40)
STRONG SELL: SELL + volume above average + MACD histogram negative
MEGA SELL: STRONG SELL + WT1 > 60 (extreme overbought) + RSI > 65
ULTRA SELL: MEGA SELL + MFI > 70 + Stoch RSI overbought + bearish divergence
Signal labels appear on chart with size proportional to signal strength (tiny for BUY/SELL, normal for ULTRA).
Divergence Detection System
The indicator detects divergences across multiple oscillators:
RSI Divergence:
Bullish: Price makes lower low, RSI makes higher low
Bearish: Price makes higher high, RSI makes lower high
WaveTrend Divergence:
Bullish: Price makes lower low, WT1 makes higher low
Bearish: Price makes higher high, WT1 makes lower high
MACD Divergence:
Bullish: Price makes lower low, MACD histogram makes higher low
Bearish: Price makes higher high, MACD histogram makes lower high
Divergences are marked with bright orange/yellow "D" labels (color.rgb(255, 200, 0)) with black text for maximum visibility. When multiple oscillators show divergence simultaneously, it signals strong momentum exhaustion and potential reversal.
Confluence Scoring System
The indicator calculates a real-time confluence score (0-100) by evaluating:
Confluence Components:
- WaveTrend Position: Up to 25 points (extreme zones add more weight)
- WaveTrend Momentum: Up to 15 points (WT1-WT2 relationship)
- RSI Level: Up to 15 points (extreme readings add weight)
- MFI Level: Up to 15 points (volume pressure confirmation)
- MACD Histogram: Up to 15 points (trend momentum)
- Stochastic RSI: Up to 10 points (early momentum detection)
- Divergence Presence: Up to 5 points (any divergence detected)
The dashboard displays the current confluence score with color coding:
Green (80-100): Strong bullish confluence
Light green (60-79): Moderate bullish confluence
Yellow (40-59): Neutral/mixed signals
Light red (20-39): Moderate bearish confluence
Red (0-19): Strong bearish confluence
Visual Elements
WaveTrend Lines: WT1 (blue) and WT2 (orange) with dynamic coloring
Overbought/Oversold Zones: Horizontal lines at +60/-60 and +80/-80
Zero Line: Reference line at 0
MACD Histogram: Large bars (linewidth 8) with gradient coloring
MFI Line: Purple line showing volume-weighted momentum
RSI Line: Green line with overbought/oversold reference levels
Stochastic RSI: K (blue) and D (red) lines
Signal Labels: BUY/SELL markers with size based on signal strength
Divergence Labels: Bright orange "D" markers at divergence points
Dashboard: Top-right table showing confluence score and oscillator readings
Chart demonstrating signal hierarchy from BUY to ULTRA BUY with divergence markers
How Components Work Together
The mashup creates a layered momentum analysis:
Layer 1 - Primary Momentum: WaveTrend identifies wave cycles and crossover signals
Layer 2 - Volume Confirmation: MFI validates moves with volume-weighted pressure
Layer 3 - Baseline Momentum: RSI provides reliable overbought/oversold context
Layer 4 - Trend Strength: MACD histogram shows underlying trend momentum
Layer 5 - Early Detection: Stochastic RSI catches momentum shifts before other oscillators
Layer 6 - Exhaustion Signals: Divergences across oscillators indicate momentum exhaustion
Example scenario: WT1 crosses above WT2 in oversold zone (Layer 1), MFI shows buying pressure increasing (Layer 2), RSI is below 35 (Layer 3), MACD histogram turns positive (Layer 4), Stochastic RSI crosses up (Layer 5), and RSI shows bullish divergence (Layer 6). This generates an ULTRA BUY signal with 90+ confluence score.
Input Parameters
WaveTrend Settings:
Channel Length: Period for EMA calculation (default: 10)
Average Length: Smoothing period for WT1 (default: 21)
Overbought Level: Upper threshold (default: 60)
Oversold Level: Lower threshold (default: -60)
Extreme OB Level: Extreme upper threshold (default: 80)
Extreme OS Level: Extreme lower threshold (default: -80)
Oscillator Settings:
RSI Length: Period for RSI calculation (default: 14)
MFI Length: Period for MFI calculation (default: 14)
MACD Fast: Fast EMA period (default: 12)
MACD Slow: Slow EMA period (default: 26)
MACD Signal: Signal line period (default: 9)
Stochastic RSI Length: Period for Stoch RSI (default: 14)
Signal Settings:
Show Signals: Toggle signal labels (default: enabled)
Show Divergences: Toggle divergence markers (default: enabled)
Volume Confirmation: Require volume for STRONG signals (default: enabled)
Min Confluence for Signals: Minimum score to display signals (default: 60)
Display Options:
Show Dashboard: Toggle confluence score table (default: enabled)
Show MACD Histogram: Toggle MACD display (default: enabled)
Show MFI Line: Toggle MFI display (default: enabled)
Show RSI Line: Toggle RSI display (default: enabled)
Show Stochastic RSI: Toggle Stoch RSI display (default: enabled)
Color Theme: Choose between multiple color schemes
How to Use This Indicator
Step 1: Monitor WaveTrend Oscillator
Watch for WT1/WT2 crossovers in extreme zones. Crossovers in oversold zone (< -60) suggest bullish reversals, crossovers in overbought zone (> 60) suggest bearish reversals.
Step 2: Check Confluence Score
Review the dashboard. Scores above 70 indicate strong momentum alignment. Higher scores generally produce more reliable signals.
Step 3: Identify Signal Strength
Pay attention to signal labels. ULTRA signals have highest probability but occur less frequently. STRONG signals offer good balance between frequency and reliability.
Step 4: Look for Divergences
Divergence markers indicate momentum exhaustion. When divergences appear with extreme oscillator readings, reversal probability increases significantly.
Step 5: Confirm with MACD Histogram
Check MACD histogram direction and strength. Large histogram bars confirm strong momentum, shrinking bars suggest momentum loss.
Step 6: Validate with Volume (MFI)
Ensure MFI supports the move. Bullish signals with rising MFI are stronger, bearish signals with falling MFI are stronger.
Best Practices
Use on 15-minute to 4-hour timeframes for optimal signal quality
Wait for STRONG or MEGA signals rather than acting on every BUY/SELL
Divergences work best when combined with extreme oscillator readings
Multiple oscillator divergences (RSI + WT + MACD) are most reliable
Use confluence score as filter - avoid signals below 60 score
MACD histogram size indicates momentum strength - larger bars = stronger moves
MFI divergence from price often precedes reversals (volume leads price)
Combine with price action and support/resistance for best results
Indicator Limitations
Oscillators can remain overbought/oversold longer than expected in strong trends
Divergences can persist for multiple bars before reversal occurs
Multiple signals in choppy markets can lead to whipsaws
Confluence score is mathematical calculation, not prediction of future movement
ULTRA signals are rare - waiting only for these may miss opportunities
Volume data quality varies across markets and can affect MFI reliability
Stochastic RSI is very sensitive and can generate premature signals
No indicator combination eliminates false signals entirely
Requires understanding of oscillator behavior for effective interpretation
Technical Implementation
Built with Pine Script v6 using:
Custom WaveTrend calculation with dual-line system
Proper MFI formula with volume-weighted money flow
Multi-oscillator divergence detection with pivot analysis
Confluence scoring algorithm with weighted components
Enhanced MACD histogram visualization (linewidth 8)
Dynamic color gradients for momentum visualization
Anti-overlap logic for signal labels
Real-time dashboard with oscillator readings
The code is fully open-source and can be modified to adjust oscillator weights, signal thresholds, and visual preferences.
Originality Statement
This indicator is original in its multi-oscillator integration approach. While individual components (WaveTrend, MFI, RSI, MACD, Stochastic RSI) are established oscillators, this mashup is justified because:
It combines five oscillators using fundamentally different calculation methods
The tiered signal system (BUY to ULTRA) provides graduated confidence levels
Multi-oscillator divergence detection catches momentum exhaustion across different timeframes
Confluence scoring quantifies momentum alignment across all oscillators
Volume integration through MFI adds institutional flow perspective
Enhanced visualization (large MACD histogram, bright divergence markers) improves usability
Each oscillator contributes unique information: WaveTrend provides wave-cycle analysis, MFI incorporates volume, RSI offers reliable baseline, MACD shows trend strength, and Stochastic RSI catches early shifts. The mashup's value lies in identifying when these different momentum calculations align, significantly reducing false signals compared to any single oscillator.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
Oscillator-based indicators are lagging tools that analyze past price data. They do not predict future price movement. Overbought conditions can persist in strong uptrends, and oversold conditions can persist in strong downtrends. Divergences can continue for extended periods before reversals occur.
The confluence score is a mathematical calculation, not a guarantee of trade success. High confluence scores do not ensure profitable trades. Past signal performance does not guarantee future results. Market conditions change, and oscillator behavior varies across different market regimes.
Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose. Consider consulting with a qualified financial advisor before making investment decisions.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this tool.
-Made with passion by officialjackofalltrades インジケーター

インジケーター

インジケーター

インジケーター

インジケーター

Folded RSIFolded RSI: Spectral-Adaptive Momentum Oscillator
A cycle-responsive RSI that automatically tunes its calculation period based on real-time spectral correlation analysis, featuring gradient-visualized momentum extremes.
Overview
The Folded RSI revolutionizes traditional momentum analysis by replacing static periods with dynamic, data-driven adaptation. Using phase-invariant spectral correlation , the indicator measures how closely price action aligns with theoretical cyclical patterns, then adjusts the RSI length accordingly. When markets exhibit strong cyclical structure, the RSI compresses to capture rapid oscillations; during chaotic or trendless periods, it expands to filter noise.
Key Features
Phase-Invariant Cycle Detection: Calculates Pearson correlation against pure sine/cosine waves to detect cyclical strength regardless of phase position (uses quadrature sum of sin/cos correlations)
Dual-Harmonic Analysis: Optionally evaluates both the target period and its 2× harmonic, automatically selecting the stronger correlation for optimal adaptation
Nonlinear Length Mapping: Maps correlation magnitude (0-1) to RSI length through a power function—strong cycles produce fast, responsive RSI; weak cycles produce smooth, lagged readings
Pure Mathematical Implementation: Custom Wilder RSI using dynamic smoothing factors (alpha = 1/length) and custom EMA—zero dependency on built-in TA functions
Gradient Visual System: Dynamic color transitions from neutral blue to hot red (overbought) or cool green (oversold) with gradient fills showing momentum intensity
Extreme Level Markers: Automatic visual alerts when RSI crosses above 70 (red markers) or below 30 (green markers)
Real-Time Diagnostics: On-chart table displaying current correlation magnitude, adaptive length, and detected dominant period
How It Works
1. Spectral Analysis
The indicator computes correlation between price returns and synthetic sinusoidal basis functions over the Cycle Window . By testing both sine and cosine components simultaneously, it achieves phase-invariance —detecting cyclical presence regardless of whether the cycle is currently at a peak, trough, or zero-crossing.
2. Harmonic Selection
When enabled, the algorithm compares correlation strength at both the Target Period and its octave (2× length), selecting whichever exhibits stronger statistical alignment with price action.
3. Adaptive Length Calculation
The correlation magnitude determines the RSI period through the formula:
High correlation → Shorter length (minimum setting)
Low correlation → Longer length (maximum setting)
Adjustable nonlinearity (power) curve to emphasize or flatten the response
4. Dynamic RSI Computation
A custom Wilder-style RSI calculates using the adaptive length, with optional post-smoothing EMA to reduce whipsaws.
Settings Guide
Cycle Window: Lookback bars for correlation calculation (40+ recommended for statistical significance)
Target Sine Period: Expected dominant cycle in bars (e.g., 20 for monthly cycles on daily charts)
RSI Length Min/Max: Bounds for adaptive calculation (5-50 standard range)
Nonlinearity (Power): Response curve shape—>1.0 emphasizes strong cycles, <1.0 creates more gradual transitions
Invert Mapping: Reverses logic (strong cycles → longer RSI) for contrarian strategies
Post Smoothing: EMA period applied to raw RSI output (1 = no smoothing)
Visual Interpretation
▼ Red Markers: RSI above 70 (potential overbought)
▲ Green Markers: RSI below 30 (potential oversold)
Diagnostics Table: Top-right display showing:
Current RSI value
Correlation magnitude (higher % = stronger cyclical structure)
Current adaptive length
Best detected period (base or harmonic)
Monitor the correlation magnitude in the diagnostics table to gauge indicator confidence—values above 60% indicate strong cyclical behavior where the adaptive length is optimized for current market conditions. Values below 30% suggest the market is in a non-cyclical state (trending or chaotic), triggering longer, smoother RSI periods.
インジケーター

Adaptive Harmonic Forecast [LuxAlgo]The Adaptive Harmonic Forecast indicator decomposes price action into multiple cyclical components and a linear trend to forecast future market movement.
By extracting the most dominant frequencies from recent price data, the tool projects a multi-harmonic model into the future to identify potential reversal points and trend continuations.
🔶 USAGE
The indicator provides a mathematical projection of price action based on the assumption that markets exhibit cyclical behavior. Users can utilize the forecast to anticipate upcoming shifts in momentum or to identify the underlying trend direction.
It is important to note that the forecast is dynamic and recalculates on the most recent bar; therefore, it is best used to confirm momentum shifts when price action aligns with the projected harmonic direction.
🔹 Historical Fit & Forecast
The script displays a solid line over the historical lookback period, representing how well the harmonic model fits the actual price data. Beyond the current bar, a dotted line extends the forecast. This forecast is color-coded: green represents projected upward movement, while red represents projected downward movement. The forecast should be viewed primarily as a timing tool rather than an exact price target, as it projects where the "rhythm" of the market is heading based on current harmonics.
🔹 Trend Line & Reversal Markers
A linear trend line is calculated alongside the sinusoids to show the overall bias (slope) of the lookback period. Additionally, the indicator can plot reversal markers (dots) at the specific points where the forecasted cycles reach a peak or trough. These markers highlight potential future turning points where the composite cycles converge to create a local maximum or minimum.
🔹 Detected Cycles Table
The "Detected Cycles" dashboard allows traders to identify if current price action is dominated by short-term "noise" cycles or larger "structural" cycles. By observing the period lengths (in bars), users can determine the frequency of market swings. If the detected periods are small relative to the lookback, the market is in a high-frequency state; if they are large, the market is exhibiting more stable, long-term cyclicality.
🔶 DETAILS
The script operates through a two-step mathematical process involving spectral analysis and matrix-based regression:
Periodogram Logic (Cycle Detection): The indicator first detrends the data within the lookback window using a linear fit. It then performs a spectral analysis by scanning a range of periods to calculate "spectral power" (the correlation between price and a specific frequency). It identifies "spectral peaks" where price variance is most concentrated, ensuring that only the most meaningful cycles are selected for modeling rather than random noise.
Multi-Harmonic OLS Regression: Once the dominant periods are identified, the script uses Ordinary Least Squares (OLS) regression to solve for the coefficients of a linear combination of basis functions. Specifically, it constructs a model consisting of multiple sine and cosine waves (representing the cycles) and a first-order polynomial (representing the trend). By solving the normal equation using matrix math, the script finds the optimal amplitudes and phases that minimize the squared error against historical price. This composite model is then solved for future time coordinates to create the extrapolation.
🔶 SETTINGS
🔹 Settings
Fit Lookback (N): Determines the number of historical bars used to analyze cycles and fit the model.
Extrapolation Bars: Sets how many bars into the future the forecast should extend.
Number of Sinusoids: The maximum number of individual cycles to include in the composite model (1-10).
🔹 Automatic Cycle Detection
Min Period: The shortest cycle length (in bars) the algorithm is allowed to detect.
🔹 Visuals
Show Reversal Dots: Toggles the markers at forecasted local highs and lows.
Dot Size: Adjusts the visual scale of the reversal markers.
Show Detected Periods: Toggles the data table showing the lengths of the dominant cycles.
🔹 Trend Line
Show Trend Line: Toggles the display of the underlying linear regression line.
Trend Line Color: Sets the color for the historical and projected trend line.
インジケーター

Harmonic Resonance Oscillator [LuxAlgo]The Harmonic Resonance Oscillator indicator provides a specialized oscillator that decomposes price action into multiple harmonic cycles to identify confluence in market rotations.
By isolating short, medium, and long-term frequencies, the tool aims to pinpoint exhausted price movements and potential reversal zones through the concept of cyclic resonance.
🔶 USAGE
The Harmonic Resonance Oscillator can be used to identify market turning points by observing when the aggregate cycle resonance reaches extreme levels. Unlike standard oscillators that rely on a single lookback period, this tool aggregates multiple filtered cycles to provide a more robust view of market momentum and exhaustion.
When the oscillator enters the dynamic overbought (upper) or oversold (lower) zones, it indicates that the various price cycles are aligning at an extreme, often preceding a corrective move or a trend reversal.
🔹 Harmonic Multipliers
The script uses a Reference Period combined with three multipliers to define the cycles:
The Short Multiplier captures fast, intraday-style fluctuations.
The Medium Multiplier focuses on the primary trend rhythm.
The Long Multiplier tracks broader market cycles.
When all three cycles reach peak or trough levels simultaneously, the oscillator displays a "resonance" peak, which is highlighted by background coloring if the signal exceeds the dynamic thresholds.
🔶 DETAILS
The indicator is built upon three primary technical pillars:
🔹 Ehlers' Bandpass Filter
At its core, the indicator uses John Ehlers' Cycle decomposition method. The bandpass filter is designed to pass only price components within a specific frequency range while attenuating everything else. This allows the script to "tune in" to specific market rhythms without the lag typically associated with moving averages.
🔹 Normalization & Resonance
Each isolated cycle is normalized onto a scale of 0 to 100 using a specific lookback length. The final "Harmonic Resonance" signal is the arithmetic mean of these three normalized cycles. A value of 50 represents a neutral state, while values approaching 0 or 100 represent extreme harmonic alignment.
🔹 Dynamic Volatility-Adjusted Zones
The Overbought and Oversold thresholds are not static. They adjust dynamically based on the standard deviation of the resonance signal. During periods of high cyclic volatility, the bands expand to require stronger confluence for a signal; during low volatility, the bands contract to stay sensitive to smaller market rotations.
🔶 SETTINGS
🔹 Harmonic Settings
Reference Period: The base period used to calculate the harmonic cycles.
Short Multiplier: Multiplier applied to the reference period for the short-term cycle.
Medium Multiplier: Multiplier applied to the reference period for the medium-term cycle.
Long Multiplier: Multiplier applied to the reference period for the long-term cycle.
Bandwidth: Controls the "tightness" of the bandpass filter. Lower values isolate specific cycles more precisely.
🔹 Normalization Settings
Normalization Lookback: The window used to scale the cycles and calculate the volatility of the resonance signal.
🔹 Overbought / Oversold Control
Overbought Threshold: The base level for the upper dynamic zone (default 80).
Oversold Threshold: The base level for the lower dynamic zone (default 20).
🔹 Style
Bullish Color: Color of the oscillator when above the 50 midpoint.
Bearish Color: Color of the oscillator when below the 50 midpoint.
Overbought Color: Color of the upper dynamic threshold.
Oversold Color: Color of the lower dynamic threshold.
Show Background Highlighting: Toggles the background coloring when resonance reaches extreme levels.
インジケーター

インジケーター

Harmonic Frequency Visualizer [BackQuant]Harmonic Frequency Visualizer
Overview
Harmonic Frequency Visualizer is a cycle-analysis and cross-asset resonance tool that uses a simplified Discrete Fourier Transform (DFT) to measure how strongly specific cycle periods are present in price. It is not a “trend indicator” and it is not trying to predict direction by itself. Its job is to quantify rhythm: which repeating periods (in bars) are currently dominant, whether those cycles are expanding or contracting (phase direction), and whether multiple instruments are sharing the same dominant periods at the same time (resonance).
This indicator has two main output modes:
Spectrum : a frequency “snapshot” showing amplitude at each tested period for up to five instruments.
Spectrogram : a history heatmap showing how the spectrum evolves through time (for the chart instrument).
Spectrum
Spectrogram
On top of that, it produces a Dominant Cycle Oscillator derived from the dominant cycle’s phase, which gives a continuous cycle position metric (peak/trough style zones) without repainting.
This is designed for traders who want cycle context the same way they want volatility context: not as a magic signal, but as structure.
What “frequency” and “cycles” mean in trading terms
A cycle period (say 21 bars) means: “a repeating pattern that tends to complete one full oscillation every 21 bars.” If price contains such a pattern, the DFT will detect a strong correlation between price and a 21-bar sine/cosine wave.
Markets do not have perfectly stable periodic motion, but they often show:
Mean-reverting swings around value.
Trend pulses with pullback cadence.
Volatility clustering that creates rhythmic expansions and contractions.
Cycle tools are trying to measure those repeating components, and DFT is the standard mathematical way to do it.
Where DFT comes from (the core idea)
The Discrete Fourier Transform comes from Fourier analysis, a foundational signal processing concept:
Fourier’s idea : any sufficiently well-behaved signal can be expressed as a sum of sine and cosine waves at different frequencies, each with:
An amplitude (how strong that wave is).
A phase (where you are within the wave cycle).
In continuous math you get the Fourier Transform. In sampled data (like candles) you use the Discrete Fourier Transform. It converts a time series (price over time) into a frequency description (strength of different cycles).
In markets:
Time domain: candles and price series.
Frequency domain: cycle periods and their strengths.
Why sine and cosine, not just sine
A sine wave alone cannot represent every phase alignment cleanly. DFT uses both cosine and sine components because together they form an orthogonal basis that can represent any phase shift.
You can think of it like this:
Cosine component captures “in-phase” alignment with the cycle.
Sine component captures “quadrature” (90-degree shifted) alignment.
Combining them gives full information: amplitude + phase.
Mathematically, a single frequency component can be written as:
A * cos(ωt + φ)
But DFT estimates A and φ by separately accumulating cosine and sine projections.
How this script implements the DFT (and what it is actually measuring)
This is not a full-spectrum FFT across every frequency. It is a targeted DFT across a fixed set of cycle periods:
Tested periods
The script tests 8 predefined periods:
5, 8, 13, 21, 34, 55, 89, 120
These are Fibonacci-like cycle candidates commonly used in cycle/market structure work. The point is not that Fibonacci is magic. The point is that these represent a reasonable spread from short to long rhythms without needing hundreds of frequencies (which would be heavy in Pine).
Normalization step (important)
Before computing the DFT, the script normalizes the series:
mn = SMA(src, lookback)
sd = stdev(src, lookback)
norm = (src - mn) / sd (if sd != 0)
Why normalize:
DFT amplitude depends on the scale of the input series.
If you compare BTC and TLT raw prices, the magnitude is meaningless.
Z-score normalization makes amplitude more comparable across instruments and regimes.
So the spectrum is measuring “cyclical structure in standardized deviations,” not raw dollars.
Projection onto cosine and sine
For each tested period P:
ω = 2π / P (angular frequency for that period)
Compute:
- sCos = Σ(norm * cos(ωk))
- sSin = Σ(norm * sin(ωk))
Interpretation:
You are correlating the last window of normalized price with a cosine wave of period P.
And also correlating it with a sine wave of period P.
If the price has a strong P-bar rhythm, these sums grow in magnitude.
Window length detail
The script uses:
window = min(lookback - 1, 99)
So even if lookback is 200, the internal DFT accumulation caps at 100 bars for performance stability. This is a deliberate trade: stable computation in Pine, while still letting you define normalization lookback and overall context.
Amplitude computation
Once sCos and sSin are computed:
raw magnitude = sqrt(sCos² + sSin²)
This is the length of the vector (sCos, sSin). That vector length is the standard way to combine the orthogonal components into one strength metric.
Then it scales it into a 0–100 “display amplitude”:
amp = sqrt(sCos² + sSin²) / lookback * 100 * sensitivity
amp is capped to 100
So:
Higher amplitude means stronger alignment with that cycle period.
Sensitivity is a user control to amplify or damp the display scaling.
Important: amplitude here is not a probability, and it is not guaranteed “signal quality.” It is a standardized “how much of that cycle exists in the recent window” metric.
Phase computation
Phase is computed using atan2(sSin, sCos). That matters because:
A simple atan(sin/cos) fails in different quadrants.
atan2 correctly resolves the angle from -π to +π.
Phase tells you where you are within the cycle:
Two cycles can have same amplitude but opposite phase.
Phase is what lets you infer “approaching peak vs trough” behavior.
Dominant cycle selection
The script chooses the dominant cycle as the period with the highest amplitude among the tested periods:
domIdx = argmax(amp )
domAmp = max amplitude
domPhase = phase at domIdx
This dominant cycle is used for:
Spectrogram history matrix (chart symbol).
Dominant cycle oscillator.
Data window outputs (dominant period, oscillator value).
Spectrum View: what you see and how to read it
In Spectrum mode, the indicator draws a frequency snapshot for up to five instruments. Each instrument gets a spectrum line (or bars/area depending on style) plotted across the 8 periods on the x-axis, with amplitude (0–100) on the y-axis.
X-axis meaning
Each x position corresponds to a period (5 → 120 bars). You are not looking at “frequency in Hz.” You are looking at “period in bars,” which is more intuitive in trading.
Y-axis meaning
Amplitude is a scaled measure of how strongly that period is present in the recent normalized data. Higher means stronger.
Plot styles
Waveform: connects amplitude points into a continuous shape, best for seeing spectrum shape.
Bars: draws vertical bars per period, best for quick comparison.
Area: similar to waveform but filled toward baseline for emphasis.
Dominant peaks and phase direction labels
The script highlights dominant cycles per symbol (if enabled):
If max amplitude > 20, it labels that peak with the symbol name.
If Show Phase Direction is enabled, it appends ▲ or ▼.
Phase direction logic:
rising = sin(phase) < 0
▲ means cycle is in a “rising” phase segment
▼ means cycle is in a “falling” phase segment
This is not “price will rise now.” It is “the dominant cycle’s instantaneous phase suggests you are on the upward vs downward half of that oscillation.” In real markets, you use this as context, not as a standalone trade trigger.
It also draws small ▲/▼ markers on secondary peaks (amp > 15) to show phase direction of other meaningful cycles, giving you a richer picture than “one dominant period.”
Resonance Zones: cross-asset harmonic alignment
Resonance is where this tool becomes more than a single-chart curiosity.
What resonance means here
A resonance zone is flagged when at least 3 out of 5 instruments have strong amplitude at the same tested period. Mechanically:
For each period i:
- Count instruments with amp > 30
- If count >= 3, mark resonance at that period
When resonance is detected:
A vertical highlight box is drawn behind that period.
A ⚡ marker is printed at the top.
Interpretation:
Multiple assets are expressing a similar cycle length at the same time.
This can indicate macro rhythm, shared liquidity timing, or cross-market synchronization.
This is especially useful when your instrument set includes:
Rates proxy (TLT), commodities (oil, gold), and crypto indices.
You can visually spot when markets are “vibrating” together at a shared period.
Resonance is not automatically bullish or bearish. It is telling you “cycle length agreement,” which can help with timing models and contextual trade planning.
Spectrogram View: frequency over time
Spectrum mode is a snapshot. Spectrogram mode adds time evolution.
What a spectrogram is
A spectrogram is a 2D heatmap where:
Rows = different periods (frequency bands).
Columns = time history (bars ago → now).
Color = amplitude strength.
This allows you to see:
Which cycles are persistent vs fleeting.
When dominant cycle shifts occur (energy moves from one period to another).
Cycle regime transitions (short cycles dominating in chop vs longer cycles dominating in trend).
How the script builds the spectrogram matrix
It maintains a matrix with:
NUM_PERIODS rows (8 periods)
histBars columns (history length)
Each bar:
Remove the oldest column.
Append the newest amplitude array from chartSpec.
So the spectrogram is always a rolling history of the chart symbol’s cycle amplitudes. It does not attempt to store five symbols (too heavy), it focuses on the active chart for time evolution.
Heat coloring
Amplitude values map to a custom gradient:
Low = dark blue
Mid = blue/cyan to orange
High = yellow
This makes dominant energy bands visually obvious. A stable bright band means persistent cycle dominance.
Dominant Cycle Oscillator: phase mapped to a 0–100 oscillator
The oscillator is derived from the dominant cycle phase (chart symbol):
oscRaw = cos(domPhase)
oscValue = 50 + 50 * oscRaw (maps -1..1 into 0..100)
Interpretation:
When cos(phase) ≈ +1, oscillator near 100 (cycle peak zone).
When cos(phase) ≈ -1, oscillator near 0 (cycle trough zone).
Midline 50 corresponds to the quarter-cycle transition points.
It also colors the oscillator by phase direction:
oscRising = sin(domPhase) < 0
Rising phase = green-ish
Falling phase = red-ish
This gives you a clean timing reference:
The dominant period tells you the cycle length.
The oscillator tells you where you are within that cycle.
It is not forecasting price. It is telling you the current phase position of the strongest detected cycle component.
Alerts and practical timing usage
Alerts are based on the oscillator:
Cross above 80: dominant cycle entering peak zone.
Cross below 20: dominant cycle entering trough zone.
Cross 50: midline cross (phase transition).
In practice, you use these as “timing context” alerts, for example:
If your trend model is bullish and cycle oscillator enters trough zone, it can hint at a favorable pullback timing window.
If you are mean-reversion trading and cycle peak zone aligns with resistance, that confluence matters.
Again: cycle timing needs structure confirmation. The oscillator alone is not a trade system.
Multi-instrument design and non-repaint behavior
The indicator requests five external instruments via request.security. It uses:
close with lookahead_on
This forces the data to be “previous confirmed close” so the spectral calculations do not repaint intra-bar. That matters because cycle measures can change drastically within a bar if you let them use live values.
So:
Spectra for external symbols are based on confirmed historical closes.
Chart symbol spectrogram and oscillator are also stable in the sense they depend on confirmed series values (dominant phase updates bar-to-bar).
Key parameters and how they change behavior
Analysis Lookback
Affects normalization and the DFT window cap:
Higher lookback stabilizes mean/stdev normalization and reduces random shifts.
Lower lookback makes the tool more reactive but more prone to regime noise.
Because the inner DFT accumulation caps at 100 bars, very high lookback mostly affects normalization rather than the raw projection length.
Sensitivity
Scales displayed amplitude:
Higher sensitivity makes peaks stand out more.
Lower sensitivity compresses amplitude.
It is a display control, not a physics constant.
View Mode
Spectrum: cross-asset snapshot comparison, resonance detection.
Spectrogram: time evolution of cycle energy for chart symbol.
Show Phase Direction
Adds ▲/▼ markers derived from sin(phase). Useful for quick cycle position intuition, but do not treat ▲ as “buy.”
Show Resonance Zones
Marks periods where many instruments share strong energy. Useful for macro rhythm alignment.
Highlight Dominant Cycles
Labels peaks. If you disable it, the chart becomes cleaner but less informative.
Spectrogram History
Controls how many columns are stored. Higher makes a longer heatmap but costs more drawing.
Limitations and what not to assume
This tool is honest DSP applied to market data, but market data is not a stationary sine wave generator. Key limitations:
Cycles drift. Dominant period can shift as regime changes.
The tool only tests 8 candidate periods. If the true dominant period is 30, it will express as energy near 34 or distributed across neighbors.
Normalization helps comparability, but does not make amplitude “absolute truth.”
DFT assumes a stable frequency over the window. Markets often violate that.
Phase-based oscillators are timing aids, not predictors.
This is why the indicator is best used as:
Context for entries/exits, not a standalone system.
A way to see when cycle energy concentrates or disperses.
A way to detect when multiple markets share a timing rhythm.
How to use it properly (workflows)
1) Cycle regime identification
If short periods (5–13) dominate, market is often choppy, reactive, and mean-reverting.
If mid periods (21–55) dominate, market often shows swing structure.
If long periods (89–120) dominate, market can be in slower macro drift, trend legs, or compressed volatility regimes.
2) Timing layer for an existing strategy
Use your trend model to decide direction.
Use dominant cycle oscillator to decide timing within that direction.
Use spectrogram to avoid trading when dominant period is unstable or flipping rapidly.
3) Cross-asset confirmation
If you see resonance at a period, watch whether your main instrument is also showing strength there.
Resonance can justify holding a cycle-based timing thesis with more confidence because it is not isolated.
4) Expectation management
If the spectrum is flat (no peaks above threshold), that is information:
No clean dominant cycle, randomness dominates.
Cycle-based timing will be unreliable.
Summary
Harmonic Frequency Visualizer uses a targeted Discrete Fourier Transform across predefined cycle periods to measure amplitude and phase of cyclical components in price. It supports multi-instrument spectrum comparison, resonance detection when several markets share strong energy at the same periods, and a spectrogram heatmap for the chart instrument showing how cycle dominance evolves over time. A dominant cycle oscillator maps phase into a 0–100 timing readout with alerts for peak/trough/midline transitions. It is a cycle context engine designed to complement trend, structure, and risk models, not replace them. インジケーター

TS Pressure OscillatorThis indicator is a TS Pressure Oscillator. Its job is to turn a lot of small “TS events” (liquidity sweeps + rejection) into a single, easy-to-read curve that helps you spot short-term exhaustion and possible trend shifts.
What it detects (TS events)
A “TS” here means a candle that:
briefly breaks the previous candle’s high and then closes back below it (bearish rejection), or
briefly breaks the previous candle’s low and then closes back above it (bullish rejection).
In simple words: price tried to continue, failed, and got rejected.
What the oscillator measures
Instead of counting every TS equally, this version gives each event a score based on its quality:
Wick size vs ATR (how meaningful the sweep was)
Body size vs ATR (how strong the rejection candle was)
Then it filters events by context:
bearish TS only matter most near the top of a recent range
bullish TS only matter most near the bottom of a recent range
After that, it combines multiple timeframes (M15 / M5 / M1) into one curve:
If bearish TS pressure dominates, the oscillator tends to move up (more rejection from above).
If bullish TS pressure dominates, the oscillator tends to move down (more rejection from below).
Why there are two lines (Main vs EMA)
Main line shows the current pressure.
EMA line is the smoothed version (the “trend” of the pressure).
The gap between them is useful: when the Main line pulls away from the EMA, it often means pressure is accelerating.
The most important part: parameters
This indicator is only as good as its tuning. The key settings control what it considers “relevant” TS events:
Zone lookback (HH/LL): defines what “top” and “bottom” mean
Zone thresholds (zoneHi / zoneLo): how strict the “extreme area” filter is
Window lengths per timeframe: how much history you’re measuring
ATR length + caps: how sensitive the scoring is
Baseline: prevents the oscillator from sticking at extremes
If your parameters are too loose, you’ll get noise.
If they’re too strict, you’ll miss opportunities.
Dialing them in for each asset/session is the difference between a “nice curve” and a useful signal.
If you want, tell me the asset (e.g., XAUUSD) and your main chart timeframe, and I’ll suggest a solid starting preset for the parameters. インジケーター

インジケーター

インジケーター

ストラテジー

Time Cycles# Time Cycles Indicator
**Time Cycles Indicator** is a time-based visualization tool designed to map repeating market rhythms as smooth arches in a separate pane.
Rather than reacting to price, the script focuses purely on **time cycles**, helping you visualize potential **liquidity flow, expansion, and contraction phases** across the chart.
---
## 🔁 What This Indicator Does
- Translates a user-defined **time cycle (in days)** into repeating **semi-circular arches**
- Anchors cycles to a **fixed start date**
- Displays cycles in a **clean, price-independent pane**
- **Projects cycles forward into the future** (e.g. 6 months) so you can anticipate upcoming time windows
- Designed to complement **structure, liquidity, and narrative-based analysis**
---
## 🧠 How It Works
Each cycle is mathematically modeled as a **semicircle**:
- Start of cycle → low energy
- Mid-cycle → peak / expansion
- End of cycle → decay / reset
This produces a smooth “arch” that visually represents **temporal momentum**, independent of market volatility.
---
## ⚙️ Key Settings
### Cycle Settings
- **Start Date (UTC)** – Anchor point for all cycles
- **Period (Days)** – Length of each cycle (supports decimals)
- **Phase Shift (Days)** – Slide cycles forward or backward in time
- **Plot Only After Start Date** – Ignore cycles before the anchor
### Visual Controls
- **Amplitude** – Vertical scale of the arches
- **Baseline** – Vertical offset for positioning
- **Invert** – Flip arches into valleys
- **Baseline Guide** – Optional reference line
- **Shaded Fill** – Visual emphasis of cycle energy
### Forward Projection
- **Project Forward** – Enable future cycle rendering
- **Forward Distance (Days)** – How far into the future to extend (default ≈ 6 months)
- **Step Size (Days)** – Smoothness vs performance control
---
## 📈 How to Use It
- Pair with **market structure**, **VWAP**, **HTF levels**, or **liquidation maps**
- Watch for **confluence** between cycle peaks/troughs and price events
- Use forward projections to anticipate **time-based inflection zones**
- Works across all markets and timeframes
---
## ⚠️ Important Notes
- This is **not a price predictor**
- Cycles represent **time windows**, not directional bias
- Best used as a **contextual overlay**, not a standalone signal
---
## 🧩 Ideal For
- Liquidity & narrative traders
- Time-cycle analysts
- Macro rhythm mapping
- Traders who believe *“time reveals structure before price does”*
---
*Time does not repeat — but it often rhymes.*
インジケーター

Hyperfork Matrix🔱 Hyperfork Matrix 🔱 A manual Andrews Pitchfork tool with action/reaction propagation lines and lattice matrix functionality. This indicator extends Dr. Alan Andrews' and Patrick Mikula's median line methodology by automating the projection of reaction and action lines at equidistant intervals, creating a time-price grid that highlights where pivot levels intersect the matrix.
Three pitchfork variants are supported: Original, Schiff, and Modified Schiff. Each variant adjusts the anchor point position to accommodate different trend angles.
═══════════════════════════════════════════════════════════════
█ THE METHOD
Andrews Pitchfork
Dr. Alan Andrews developed the pitchfork as a trend channel tool. The core principle: price tends to return to the median line roughly 80% of the time. When it fails to reach the median, a reversal may be developing.
A pitchfork requires three pivot points:
• Point A — The anchor (starting pivot)
• Point B — First swing in the opposite direction
• Point C — Second swing, same direction as A
The median line runs from Point A through the midpoint of B-C. Parallel lines through B and C form the channel boundaries.
Action/Reaction Principle
Based on Newton's third law ("action and reaction are equal and opposite"), this principle suggests that price movements elicit proportional reactions in the future. By projecting lines at equal intervals along the pitchfork's slope, we anticipate where these reactions may occur.
Lattice Matrix
The lattice squares pivot price levels to the matrix structure. A horizontal from your selected pivot intersects the pitchfork and propagation lines, with verticals drawn at each intersection. These verticals mark time points where price-time geometry converges—potential areas to watch for trend changes.
═══════════════════════════════════════════════════════════════
█ HOW THE INDICATOR WORKS
This section explains the calculation flow from your inputs to the final drawing.
Step 1 — Pivot Selection
You click on the chart to select three timestamps. The indicator retrieves the high or low price at each timestamp based on your starting pivot type selection:
• Starting with "Low" creates a Low-High-Low pattern
• Starting with "High" creates a High-Low-High pattern
Step 2 — Anchor Calculation
The anchor position depends on your pitchfork variant:
• Original — Anchor stays at Point A
• Schiff — Anchor shifts 50% toward B in price (Y-axis only)
• Modified Schiff — Anchor shifts 50% toward B in both time and price
Step 3 — Median Line
A line is drawn from the anchor through the midpoint of the B-C segment. This median line defines the channel's slope and center.
Step 4 — Parallel Tines
Parallel lines are drawn through Points B and C, maintaining the median line's slope. These form the upper and lower channel boundaries.
Step 5 — Extra Parallels
If configured, additional parallel lines are drawn at equal spacing beyond B and C. The spacing equals the distance from the median to each tine.
Step 6 — Handle Length
The "handle" is the segment from the anchor to the B-C midpoint. This length becomes the unit of measurement for propagation.
Step 7 — Propagation Points
Points are placed along the median line at handle-length intervals:
• Forward points extend into the future
• Backward points extend into the past
Step 8 — Reaction Lines
Through each propagation point, a line is drawn parallel to B-C (the transversal slope). These reaction lines mark time-price zones based on the original swing rhythm, where trend changes may occur.
Step 9 — Action Lines
Through each propagation point, a line is drawn parallel to A-B (the initial move slope). These action lines project the original momentum into future price zones.
Step 10 — Lattice Grid
If enabled, a horizontal line is drawn at the price level of your selected pivot. Vertical lines are then drawn at every intersection between this horizontal and the selected line type (pitchfork, reaction, or action lines).
Step 11 — Alert Monitoring
On each bar, the indicator checks if the price has crossed any of the drawn lines. Crossings trigger alerts based on your configuration.
═══════════════════════════════════════════════════════════════
█ PITCHFORK VARIANTS
Original (Andrews)
The classic pitchfork. The anchor remains at Point A. Best suited for strong trending markets where price respects steep channels.
Schiff
Named after Jerome Schiff, a student of Andrews. The anchor shifts halfway toward Point B in price only—same time position as A, but price is the midpoint of A and B.
This produces a less steep channel, better suited for:
• Shallow trends
• Corrective phases
• Markets where the original pitchfork angle is too aggressive
Modified Schiff
The anchor shifts halfway toward Point B in both time and price—positioned at the midpoint of the A-B segment.
This creates an even gentler slope than the standard Schiff variant. Use when:
• Trends are weak or ranging
• Price doesn't respect steeper channel angles
• You need a middle ground between Original and Schiff
═══════════════════════════════════════════════════════════════
█ ACTION & REACTION LINES
Reaction Lines
These run parallel to the B-C segment (the "transversal"). They represent the market's response rhythm—the swing from B to C sets a pattern that may repeat at predictable intervals.
Action Lines
These run parallel to the A-B segment (the initial impulse). They project the original momentum forward, suggesting where similar price movements may begin or end.
Forward vs Backward
• Forward Lines — Project into the future beyond the B-C midpoint
• Backward Lines — Project into the past before Point A
Most analysis focuses on forward lines, but backward lines can reveal historical confluence with past pivots.
Propagation Spacing
Lines are spaced at equal intervals defined by the handle length (anchor to B-C midpoint). This creates a rhythmic structure where each segment equals the original pitchfork's core measurement.
Action Lines
Reaction Lines
Extra Parallels with/ both Action & Reactions Line extended within the grid
═══════════════════════════════════════════════════════════════
█ LATTICE MATRIX
The lattice creates a grid overlay within the pitchfork structure.
Horizontal Line
A horizontal line is drawn at the price level of your selected pivot (A, B, or C). This squares the pivot's price level to find where it aligns with the matrix structure. These confluences may represent higher-probability reaction points in time.
Vertical Lines
Vertical lines are drawn at every point where the horizontal intersects your selected line source. These verticals mark time points—potential areas to watch for trend changes.
• Pitchfork & Parallels — Intersections with median and all parallel tines
• Action Lines — Intersections with action transversals
• Reaction Lines — Intersections with reaction transversals
• Action & Reaction — Both types combined
Envelope Clamping
Lattice lines are automatically clamped to stay within the pitchfork's channel envelope (bounded by the outermost parallels). This keeps the grid visually clean and focused on relevant areas.
═══════════════════════════════════════════════════════════════
█ ALERTS
The indicator monitors price crossings and triggers alerts when the price moves through any drawn line type.
Available Alert Types
• Pitchfork Lines — Crossing the median or any parallel
• Action Lines — Crossing any action transversal (when action lines are drawn)
• Reaction Lines — Crossing any reaction transversal (when reaction lines are drawn)
• Lattice Horizontal — Crossing the horizontal price level (when lattice is enabled)
• Any Line Crossing — Combined alert for all of the above
Setting Up Alerts
1. Right-click on the indicator or use the alert menu
2. Select "Create Alert."
3. Choose the desired condition from the dropdown
4. Configure notification preferences (pop-up, email, webhook, etc.)
Alert Timing
Alerts trigger once per bar close when a crossing is detected between the previous and current bar's close prices.
═══════════════════════════════════════════════════════════════
█ HOW TO USE
Basic Setup
1. Add the indicator to your chart
2. When prompted, click on three pivot points in sequence: A, B, C
3. Choose starting pivot type: Auto (detects pattern), Low (LHL), or High (HLH)
4. The pitchfork draws automatically
Adjusting the Pitchfork
• Change the variant (Original/Schiff/Modified Schiff) if the angle doesn't suit your trend
• Add extra parallel levels to see where price might react beyond the main channel
• Disable or Adjust price range min/max to hide parallels outside your focus area
Adding Propagation Lines
• Adjust forward offset to add/remove lines beyond auto-extend (0 = to current bar)
• Choose which line types to display: Reaction Only, Action Only, or Both
• Customize colors to distinguish line types visually
Using the Lattice
• Enable "Draw Lattice" in the Lattice settings group
• Select which pivot's price level to use for the horizontal
• Choose the intersection source that matches your analysis style
• Look for time zones where verticals cluster—these may be significant dates
Log Scale Charts
If your chart uses logarithmic scale, enable "Logarithmic Scale" in Pitchfork Settings. This ensures all calculations transform correctly for log price axes.
═══════════════════════════════════════════════════════════════
█ SETTINGS REFERENCE
1. Pivot Points
• Starting Pivot Type — Auto (detect pattern), Low (force LHL), or High (force HLH)
• Pivot A/B/C Time — Timestamps for your three pivots (click to select)
• Show Pivot Labels — Display A, B, C labels at pivot locations
• Pivot Colors — Customize high/low label colors
• Label Size — Tiny, Small, Normal, or Large
2. Pitchfork Settings
• Logarithmic Scale — Enable for log charts
• Pitchfork Type — Original, Schiff, or Modified Schiff
• Extra Parallel Levels — Additional parallels beyond B and C
• Line styling (color, width, style)
• Extend Direction — Right only or Both directions
• Enable Price Range Filter — Toggle filtering of extra parallels
• Price Range Min/Max — Hide extra parallels outside this range
3. Action / Reaction Lines
• Draw Type — None, Reaction Only, Action Only, or Both
• Forward Lines Offset — Adjust from auto-extend (0 = to current bar, positive adds more)
• Backward Lines Count — Number of lines projected before Point A
• Separate styling for reaction and action lines
4. Lattice
• Draw Lattice — Master toggle
• Select Pivot for Horizontal — A, B, or C price level
• Intersection Source — Which lines to use for vertical placement
• Lattice styling
═══════════════════════════════════════════════════════════════
█ LIMITATIONS
• Maximum 500 lines — TradingView limits line objects; complex setups with many parallels and propagation lines may approach this limit
• Manual pivot selection — Pivots must be selected manually via timestamp inputs; no auto-detection
• Log scale requires toggle — You must enable "Logarithmic Scale" manually if your chart uses log axes
• Minor visual drift — Action/Reaction lines may shift slightly when toggling between odd and even extra parallel counts (cosmetic only)
• Backward lines visibility — When adding backward propagation lines, you may need to scroll the chart left for them to render
═══════════════════════════════════════════════════════════════
█ FURTHER READING
For deeper study of pitchfork analysis and action/reaction methodology:
• Patrick Mikula's "The Best Trendline Methods of Alan Andrews and Five New Trendline Techniques"
No affiliation implied. Referenced for educational context only.
═══════════════════════════════════════════════════════════════
█ RELATED
For a video walkthrough of the Super Pitchfork methodology that inspired this indicator:
How to Build a Super Pitchfork with Reaction & Trigger Lines
This tutorial covers manual pitchfork construction, reaction line projection, and timing techniques.
インジケーター

Photon Price Action Scanner [JOAT]Photon Price Action Scanner - Multi-Pattern Recognition with Adaptive Filtering
Introduction and Purpose
Photon Price Action Scanner is an open-source overlay indicator that automates the detection of 15+ candlestick patterns while filtering them through multiple confirmation layers. The core problem this indicator solves is pattern noise: raw candlestick pattern detection produces too many signals, most of which fail because they lack context. This indicator addresses that by combining pattern recognition with trend alignment, volume-weighted strength scoring, velocity confirmation, and an adaptive neural bias filter.
The combination of these components is not arbitrary. Each filter addresses a specific weakness in standalone pattern detection:
Trend alignment ensures patterns appear in favorable market structure
Volume-weighted strength filters out weak patterns with low conviction
Velocity confirmation identifies momentum behind the pattern
Neural bias filter adapts to recent price behavior to avoid counter-trend signals
What Makes This Indicator Original
While candlestick pattern scanners exist, this indicator's originality comes from:
1. Multi-Layer Filtering System - Patterns must pass through trend, strength, velocity, and neural bias filters before generating signals. This dramatically reduces false positives compared to simple pattern detection.
2. Adaptive Neural Bias Filter - A custom momentum-adjusted EMA that learns from recent price action using a configurable learning rate. This is not a standard moving average but an adaptive filter that accelerates during trends and smooths during consolidation.
3. Pattern Strength Scoring - Each pattern receives a strength score based on volume ratio and body size, allowing traders to focus on high-conviction setups rather than every pattern occurrence.
4. Smart Cooldown System - Prevents signal overlap by enforcing minimum bar spacing between pattern labels, keeping charts clean even when "Show All Patterns" is enabled.
How the Components Work Together
Step 1: Pattern Detection
The indicator scans for 15 candlestick patterns using precise mathematical definitions:
// Example: Bullish Engulfing requires the current bullish candle to completely
// engulf the previous bearish candle with a larger body
isBullishEngulfing() =>
bool pattern = close < open and close > open and
open <= close and close >= open and
close - open > open - close
pattern
// Example: Three White Soldiers requires three consecutive bullish candles
// with each opening within the previous body and closing higher
isThreeWhiteSoldiers() =>
bool pattern = close > open and close > open and close > open and
close < close and close < close and
open > open and open < close and
open > open and open < close
pattern
Step 2: Strength Calculation
Each detected pattern receives a strength score combining volume and body size:
float volRatio = avgVolume > 0 ? volume / avgVolume : 1.0
float bodySize = math.abs(close - open) / close
float baseStrength = (volRatio + bodySize * 100) / 2
This ensures patterns with above-average volume and large bodies score higher than weak patterns on low volume.
Step 3: Trend Alignment
Patterns are checked against the trend direction using an EMA:
float trendEMA = ta.ema(close, i_trendPeriod)
int trendDir = close > trendEMA ? 1 : close < trendEMA ? -1 : 0
Bullish patterns in uptrends and bearish patterns in downtrends receive priority.
Step 4: Neural Bias Filter
The adaptive filter uses a momentum-adjusted EMA that responds to price changes:
neuralEMA(series float src, simple int period, simple float lr) =>
var float neuralValue = na
var float momentum = 0.0
if na(neuralValue)
neuralValue := src
float error = src - neuralValue
float adjustment = error * lr
momentum := momentum * 0.9 + adjustment * 0.1
neuralValue := neuralValue + adjustment + momentum
neuralValue
The learning rate (lr) controls how quickly the filter adapts. Higher values make it more responsive; lower values make it smoother.
Step 5: Velocity Confirmation
Price velocity (rate of change) must exceed the average velocity for strong signals:
float velocity = ta.roc(close, i_trendPeriod)
float avgVelocity = ta.sma(velocity, i_trendPeriod)
bool velocityBull = velocity > avgVelocity * 1.5
Step 6: Signal Classification
Signals are classified based on how many filters they pass:
Strong Pattern : Pattern + strength threshold + trend alignment + neural bias + velocity
Ultra Pattern : Strong pattern + gap in same direction + velocity confirmation
Watch Pattern : Pattern detected but not all filters passed
Detected Patterns
Classic Reversal Patterns:
Bullish/Bearish Engulfing - Complete body engulfment with larger body
Hammer - Long lower wick (2x body), small upper wick, bullish context
Shooting Star - Long upper wick (2x body), small lower wick, bearish context
Morning Star - Three-bar bullish reversal with small middle body
Evening Star - Three-bar bearish reversal with small middle body
Piercing Line - Bullish candle closing above midpoint of previous bearish candle
Dark Cloud Cover - Bearish candle closing below midpoint of previous bullish candle
Bullish/Bearish Harami - Small body contained within previous larger body
Doji - Body less than 10% of total range (indecision)
Advanced Patterns (Optional):
Three White Soldiers - Three consecutive bullish candles with rising closes
Three Black Crows - Three consecutive bearish candles with falling closes
Tweezer Top - Equal highs with reversal candle structure
Tweezer Bottom - Equal lows with reversal candle structure
Island Reversal - Gap isolation creating reversal structure
Dashboard Information
The dashboard displays real-time analysis:
Pattern - Current detected pattern name or "SCANNING..."
Bull/Bear Strength - Volume-weighted strength scores
Trend - UPTREND, DOWNTREND, or SIDEWAYS based on EMA
RSI - 14-period RSI for momentum context
Momentum - 10-period momentum reading
Volatility - ATR as percentage of price
Neural Bias - BULLISH, BEARISH, or NEUTRAL from adaptive filter
Action - ULTRA BUY/SELL, BUY/SELL, WATCH BUY/SELL, or WAIT
Visual Elements
Pattern Labels - Abbreviated codes (BE=Engulfing, H=Hammer, MS=Morning Star, etc.)
Neural Bias Line - Adaptive trend line showing filter direction
Gap Boxes - Cyan boxes highlighting price gaps
Action Zones - Dashed boxes around strong pattern areas
Velocity Markers - Small circles when velocity confirms direction
Ultra Signals - Large labels for highest conviction setups
How to Use This Indicator
For Reversal Trading:
1. Wait for a pattern to appear at a key support/resistance level
2. Check that the Action shows "BUY" or "SELL" (not just "WATCH")
3. Confirm the Neural Bias aligns with your trade direction
4. Use the strength score to gauge conviction (higher is better)
For Trend Continuation:
1. Identify the trend using the Trend row in the dashboard
2. Look for patterns that align with the trend (bullish patterns in uptrends)
3. Ultra signals indicate the strongest continuation setups
For Filtering Noise:
1. Keep "Show All Patterns" disabled to see only filtered signals
2. Increase "Pattern Strength Filter" to see fewer, higher-quality patterns
3. Enable "Velocity Confirmation" to require momentum behind patterns
Input Parameters
Scan Sensitivity (1.0) - Overall detection sensitivity multiplier
Pattern Strength Filter (3) - Minimum strength score for strong signals
Trend Period (20) - EMA period for trend determination
Show All Patterns (false) - Display all patterns regardless of filters
Advanced Patterns (true) - Enable soldiers/crows/tweezer detection
Gap Analysis (true) - Enable gap detection and boxes
Velocity Confirmation (true) - Require velocity for strong signals
Neural Bias Filter (true) - Enable adaptive trend filter
Neural Period (50) - Lookback for neural bias calculation
Neural Learning Rate (0.12) - Adaptation speed (0.01-0.5)
Timeframe Recommendations
1H-4H: Best balance of signal frequency and reliability
Daily: Fewer but more significant patterns
15m-30m: More signals, requires tighter filtering (increase strength threshold)
Limitations
Pattern detection is mechanical and does not consider fundamental context
Neural bias filter may lag during rapid trend reversals
Gap detection requires clean price data without after-hours gaps
Strength scoring favors high-volume patterns, which may miss valid low-volume setups
- Made with passion by officialjackofalltrades
インジケーター

Cosmic Volume Analyzer [JOAT]
Cosmic Volume Analyzer - Astrophysics Edition
Overview
Cosmic Volume Analyzer is an open-source oscillator indicator that applies astrophysics-inspired concepts to volume analysis. It classifies volume into buy/sell categories, calculates volume flow, detects accumulation/distribution phases, identifies climax volume events, and uses gravitational and stellar mass analogies to visualize volume dynamics.
What This Indicator Does
The indicator calculates and displays:
Volume Classification - Categorizes each bar as CLIMAX_BUY, CLIMAX_SELL, HIGH_BUY, HIGH_SELL, NORMAL_BUY, or NORMAL_SELL
Volume Flow - Percentage showing buy vs sell pressure over a lookback period
Buy/Sell Volume - Separated volume based on candle direction
Accumulation/Distribution - Phase detection using Money Flow Multiplier
Volume Oscillator - Fast vs slow volume EMA comparison
Gravitational Pull - Volume-weighted price attraction metric
Stellar Mass Index - Volume ratio combined with price momentum
Black Hole Detection - Identifies extremely low volume periods (liquidity voids)
Supernova Events - Detects extreme volume with extreme price movement
Orbital Cycles - Sine-wave based cyclical visualization
How It Works
Volume classification uses volume ratio and candle direction:
classifyVolume(series float vol, series float close, series float open) =>
float avgVol = ta.sma(vol, 20)
float volRatio = avgVol > 0 ? vol / avgVol : 1.0
if volRatio > 1.5
if close > open
classification := "CLIMAX_BUY"
else
classification := "CLIMAX_SELL"
else if volRatio > 1.2
// HIGH_BUY or HIGH_SELL
else
// NORMAL_BUY or NORMAL_SELL
Volume flow separates buy and sell volume over a period:
calculateVolumeFlow(series float vol, series float close, simple int period) =>
float currentBuyVol = close > open ? vol : 0.0
float currentSellVol = close < open ? vol : 0.0
// Accumulate in buffers
float flow = (buyVolume - sellVolume) / totalVol * 100
Accumulation/Distribution uses the Money Flow Multiplier:
float mfm = ((close - low) - (high - close)) / (high - low)
float mfv = mfm * vol
float adLine = ta.cum(mfv)
if adLine > adEMA and ta.rising(adLine, 3)
phase := "ACCUMULATION"
else if adLine < adEMA and ta.falling(adLine, 3)
phase := "DISTRIBUTION"
Gravitational pull uses volume-weighted price distance:
gravitationalPull(series float vol, series float price, simple int period) =>
float massCenter = ta.vwma(price, period)
float distance = math.abs(price - massCenter)
float mass = vol / ta.sma(vol, period)
float gravity = distance > 0 ? mass / (distance * distance) : 0.0
Signal Generation
Signals are generated based on volume conditions:
Buy Climax: Volume exceeds 2 standard deviations above average on bullish candle
Sell Climax: Volume exceeds 2 standard deviations above average on bearish candle
Strong Buy Flow: Volume flow exceeds positive threshold (default 45%)
Strong Sell Flow: Volume flow exceeds negative threshold (default -45%)
Supernova: Volume 3x average AND price change 3x average
Black Hole: Volume 2 standard deviations below average
Dashboard Panel (Top-Right)
Volume Class - Current volume classification
Volume Flow - Buy/sell flow percentage
Buy Volume - Accumulated buy volume
Sell Volume - Accumulated sell volume
A/D Phase - ACCUMULATION/DISTRIBUTION/NEUTRAL
Volume Strength - Normalized volume strength
Gravity Pull - Current gravitational metric
Stellar Mass - Current stellar mass index
Cosmic Field - Combined cosmic field strength
Black Hole - Detection status and void strength
Signal - Current actionable status
Visual Elements
Volume Ratio Columns - Colored bars showing normalized volume
Volume Flow Line - Main oscillator showing flow direction
Flow EMA - Smoothed flow for trend reference
Volume Oscillator - Area plot showing fast/slow comparison
Gravity Field - Area plot showing gravitational pull
Orbital Cycle - Circle plots showing cyclical pattern
Stellar Mass Line - Line showing mass index
Climax Markers - Fire emoji for buy climax, snowflake for sell climax
Supernova Markers - Diamond shapes for extreme events
Black Hole Markers - X-cross for liquidity voids
A/D Phase Background - Subtle background color based on phase
Input Parameters
Volume Period (default: 20) - Period for volume calculations
Distribution Levels (default: 5) - Granularity of distribution analysis
Flow Threshold (default: 1.5) - Multiplier for flow significance
Accumulation Period (default: 14) - Period for A/D calculation
Gravitational Analysis (default: true) - Enable gravity metrics
Black Hole Detection (default: true) - Enable void detection
Stellar Mass Calculation (default: true) - Enable mass index
Orbital Cycles (default: true) - Enable cyclical visualization
Supernova Detection (default: true) - Enable extreme event detection
Suggested Use Cases
Identify accumulation phases for potential long entries
Watch for distribution phases as potential exit signals
Use climax volume as potential exhaustion indicators
Monitor volume flow for directional bias
Avoid trading during black hole (low liquidity) periods
Watch for supernova events as potential trend acceleration
Timeframe Recommendations
Best on 15m to Daily charts. Volume analysis requires sufficient trading activity for meaningful readings.
Limitations
Volume data quality varies by exchange and instrument
Buy/sell separation is based on candle direction, not actual order flow
Astrophysics concepts are analogies, not literal physics
A/D phase detection may lag during rapid transitions
Open-Source and Disclaimer
This script is published as open-source under the Mozilla Public License 2.0 for educational purposes. It does not constitute financial advice. Past performance does not guarantee future results. Always use proper risk management.
- Made with passion by officialjackofalltrades
インジケーター

Harmonic Liquidity Waves [JOAT]Harmonic Liquidity Waves
Overview
Harmonic Liquidity Waves is an open-source oscillator indicator that combines multiple volume-based analysis techniques into a unified liquidity flow framework. It integrates VWAP calculations, Chaikin Money Flow (CMF), Money Flow Index (MFI), and Klinger Volume Oscillator (KVO) with custom harmonic wave calculations to provide a comprehensive view of volume dynamics and money flow.
What This Indicator Does
The indicator calculates and displays:
Liquidity Flow - Volume-weighted price movement accumulated over a lookback period
Harmonic Wave - Multi-depth smoothed oscillator derived from liquidity flow
Chaikin Money Flow (CMF) - Classic accumulation/distribution indicator
Money Flow Index (MFI) - Volume-weighted RSI showing buying/selling pressure
Klinger Volume Oscillator (KVO) - Trend-volume relationship indicator
Wave Interference - Combined constructive/destructive wave patterns
Volume Profile POC - Point of Control from simplified volume distribution
How It Works
The core liquidity flow calculation tracks volume-weighted price changes:
calculateLiquidityFlow(series float vol, series float price, simple int period) =>
float priceChange = ta.change(price)
float volumeFlow = vol * math.sign(priceChange)
// Accumulated over period using buffer array
float avgFlow = flowSum / period
avgFlow
The harmonic oscillator applies multi-depth smoothing:
harmonicOscillator(series float flow, simple int depth, simple int period) =>
float harmonic = 0.0
for i = 1 to depth
float wave = ta.ema(flow, period * i) / i
harmonic += wave
harmonic / depth
CMF measures accumulation/distribution using the Money Flow Multiplier:
float mfm = ((close - low) - (high - close)) / (high - low)
float mfv = mfm * vol
float cmf = ta.sum(mfv, period) / ta.sum(vol, period) * 100
Signal Generation
Liquidity shift signals occur when:
Bullish Shift: Smoothed wave crosses above signal line
Bearish Shift: Smoothed wave crosses below signal line
Strong signals require volume indicator confirmation:
Strong Bull: Bullish shift + CMF > 0 + MFI > 50 + KVO > 0
Strong Bear: Bearish shift + CMF < 0 + MFI < 50 + KVO < 0
Divergence detection compares price pivots with liquidity wave pivots to identify potential reversals.
Dashboard Panel (Bottom-Right)
Wave Strength - Normalized wave magnitude
Volume Pressure - Current volume vs average percentage
Flow Direction - BUYING or SELLING based on wave sign
Histogram - Wave minus signal line value
CMF - Chaikin Money Flow reading
MFI - Money Flow Index value (0-100)
KVO - Klinger oscillator value
Vol Confluence - Combined volume indicator score
Signal - Current actionable status
Visual Elements
Liquidity Wave - Main oscillator line
Wave Signal - Smoothed signal line for crossover detection
Wave Histogram - Difference between wave and signal
Wave Interference - Area plot showing combined wave patterns
CMF/KVO/MFI Lines - Individual volume indicator plots
Divergence Labels - BULL DIV / BEAR DIV markers
Shift Markers - Triangles for basic shifts, labels for strong shifts
Input Parameters
Wave Period (default: 21) - Base period for liquidity calculations
Volume Weight (default: 1.5) - Multiplier for volume emphasis
Harmonic Depth (default: 3) - Number of smoothing layers
Smoothing (default: 3) - Final wave smoothing period
Suggested Use Cases
Identify accumulation/distribution phases using CMF and wave direction
Confirm momentum with MFI overbought/oversold readings
Watch for divergences between price and liquidity flow
Use strong signals when multiple volume indicators align
Timeframe Recommendations
Best on 15m to Daily charts. Volume-based indicators require sufficient trading activity for meaningful readings.
Limitations
Volume data quality varies by exchange and instrument
Divergence detection uses pivot-based lookback and may lag
Volume Profile POC is simplified and not a full profile analysis
Open-Source and Disclaimer
This script is published as open-source under the Mozilla Public License 2.0 for educational purposes. It does not constitute financial advice. Past performance does not guarantee future results. Always use proper risk management.
- Made with passion by officialjackofalltrades インジケーター
