NW Volume Profile - Kernel-Smoothed [Dots3Red]📊 NW VOLUME PROFILE - KERNEL-SMOOTHED
A volume profile answers a different question than a normal chart. Instead of "how much traded today," it asks "how much traded at each price." This version applies Nadaraya-Watson kernel smoothing to that profile before reading any level off it — turning a jagged, noisy histogram into the actual underlying distribution of where volume concentrated.
🎯 WHY THIS MATTERS
A raw volume profile is built from independent price bins — each one only knows its own volume, nothing about its neighbors. That makes it noisy: a single oversized candle can create a spike that looks like an important level but is really just where one bar happened to land. Reading real structure off a raw histogram means squinting past that noise.
This script smooths the profile before drawing anything. Every bin's displayed value becomes a weighted average of its neighborhood — nearby bins count heavily, distant bins barely at all, following a Gaussian curve. The lumps from individual candles melt away, and what's left is the true shape of the distribution that was underneath the noise the whole time. All the levels described below — POC, Value Area, HVN, LVN — are read from that smoothed curve, not the raw one.
🧮 HOW THE SMOOTHING WORKS
Each price bin's raw volume gets replaced by:
smoothed(i) = Σⱼ w(i,j) · raw / Σⱼ w(i,j)
where w(i,j) is a Gaussian weight based on how many bins apart i and j are, controlled by the Bandwidth setting. A small bandwidth stays close to the raw histogram; a large one produces one broad, simplified hump. This is genuine kernel regression applied across the price axis, not a moving average or a visual blur — it's the same mathematical technique used in the smoothed lines several Dots3Red scripts already use for slope/trend estimation, applied here to a distribution instead of a time series.
Toggle "Show Raw Histogram Behind" to see the original jagged bars faintly displayed underneath the smoothed profile — a direct before/after comparison on your own chart.
📏 WHAT EACH LEVEL MEANS
🟡 POC (Point of Control) — the single price with the highest smoothed volume. The market's center of gravity for the current window; price tends to be pulled back toward it.
🔵 Value Area — the price region around the POC containing a configurable share of total volume (default 70%). Price trading inside it is trading at a level the market recently agreed was fair — chop and rotation are common here. Price breaking out of it is the market rejecting that agreement, which is often when moves extend rather than stall.
🟢 HVN (High Volume Node) — a secondary local peak in the smoothed distribution. Acts like a sticky zone; price tends to slow down or pause when revisiting one.
🔴 LVN (Low Volume Node) — a local trough where very little volume ever traded. Acts like a thin spot; price tends to move through it quickly rather than lingering, since few positions were ever opened there.
HVN and LVN are drawn as full-width dotted lines across the chart (not just labels at the profile edge), specifically so they stay visible and trackable even after price has moved well away from where the profile itself was drawn.
🧭 HOW TO USE
👀 Start with where price sits relative to the Value Area. Inside it: expect rotation and two-way trade. Outside it: the move has already broken from recent consensus, which historically has more follow-through than reversion.
🧲 Treat POC as a magnet, not a wall. It is the level most likely to be revisited, not a guaranteed reversal point. How price behaves when it gets there — accepted or rejected — is the actual signal, not the level itself.
🐌 Expect hesitation at HVNs. A move approaching an HVN from your prior window is approaching a zone where the market has previously done a lot of business — some slowing or consolidation there is common.
⚡ Expect speed through LVNs. A thin zone with very little historical volume tends to get crossed quickly rather than acting as support or resistance. If price is moving toward one, a fast move through it before finding real support/resistance at the next node is a reasonable expectation.
🔧 Adjust Bandwidth to match what you're looking for. A tighter bandwidth reveals more granular structure (closer to raw); a wider one collapses the profile into its dominant, unmistakable levels. There's no universally correct setting — it depends on whether you want detail or clarity.
💡 EXAMPLE
Say the profile shows POC at 61,200, a Value Area from 60,400 to 62,100, and an LVN line sitting at 59,800. Price later drops to 60,450 — right at the edge of the Value Area. Two distinct scenarios are now readable from the profile: if price holds and turns back up, the 61,200 POC above is the natural target the market has repeatedly gravitated toward. If instead price breaks below 60,400, the empty LVN at 59,800 offers little historical volume to slow the decline — a fast move through that zone before finding the next real level is the more likely path. Same chart, two different expectations, both read directly off the same profile without any additional indicator.
⚙️ SETTINGS
📊 Profile
• Lookback (bars) — size of the rolling window the profile is built from
• Price Bins — vertical resolution of the profile
• Body Volume Only — distribute volume across the candle body instead of the full high-low range
🧮 Kernel Smoothing
• Bandwidth — width of the Gaussian kernel in bin units; controls detail vs. simplification
📏 Levels
• Value Area % — share of total volume the Value Area is expanded to contain
• Node Detection Leg — how many neighboring bins define a local peak/trough
• LVN Max Ratio of POC — how thin a trough must be, relative to POC, to count as an LVN
🎨 Visualization
• Show Raw Histogram Behind, POC Line, Value Area, HVN/LVN Marks — each independently toggleable
• Profile Width — how far the profile extends horizontally
🖥️ Dashboard
• Show/hide, position — displays current POC, Value Area bounds, node counts, and the active window/bandwidth settings
📝 NOTES
This profile is a rolling window — its levels update as the window slides forward with each new bar, which is expected behavior for a volume profile rather than a repainting signal (nothing appears and then vanishes; the underlying window is simply moving). Thin-volume symbols will produce a ragged profile regardless of smoothing settings — this tool is most informative on liquid instruments with consistent volume.
⚠️ DISCLAIMER
This is an analytical and visualization tool. It does not generate trade signals and does not constitute financial advice. Historical volume concentration at a given level does not guarantee how price will behave there in the future. Indicator

Vector Coherence Moving Average (VCMA)Vector Coherence Moving Average (VCMA)
Vector Coherence Moving Average (VCMA) is an adaptive moving average based on the directional alignment of recent price-change vectors. It is intentionally presented as a thin, fixed-color line.
VCMA adjusts its smoothing speed according to two questions: Are recent price changes pointing in a consistent direction? Is that consistency supported by several meaningful moves rather than one isolated event? Strong, well-supported alignment makes the average more responsive. Weak or poorly supported alignment keeps it closer to its slow response.
How VCMA Is Calculated
1. Delay-Coordinate Price Path
VCMA first calculates the bar-to-bar change in the selected Source:
d(t) = Source(t) - Source(t-1)
It then represents price as a point on a two-dimensional delay-coordinate path:
X(t) =
Moving from X(t-1) to X(t) creates the lag vector:
z(t) = X(t) - X(t-1) =
Magnitude(t) = sqrt
During persistent movement, these vectors tend to point in similar directions. During back-and-forth movement, they point in conflicting directions and cancel when summed.
2. Vector Coherence
Over the selected Coherence Length, VCMA compares the straight-line displacement of this path with the total distance it traveled. Equivalently, it compares the length of the summed vector with the sum of all individual vector lengths:
rho = sqrt / Sum sqrt
In this form, rho is a two-dimensional path-efficiency, or straightness, ratio.
The triangle inequality keeps rho between 0 and 1:
• rho near 1 - recent lag vectors are strongly aligned
• rho near 0 - vector directions largely cancel
Both parts of the ratio scale with price movement, so vector coherence is independent of the instrument's nominal price level.
3. Effective-Move Support
A single large move can produce high coherence simply because little else opposes it. VCMA therefore calculates an effective sample size from vector magnitudes:
Effective Moves = (Sum Magnitude)^2 / Sum Magnitude^2
This is a participation measure rather than a literal count of bars. It is low when one move dominates and rises when several moves contribute meaningful magnitude.
Support = Clamp
With the default target of 3, VCMA requires broader support before using the full coherence signal. This reduces immediate maximum-speed reactions to an isolated gap, spike, or wick.
4. Adaptive Alpha
The Fast and Slow periods define the response limits of the recursive average. The script automatically treats the shorter input as Fast and the longer input as Slow:
Fast Alpha = 2 / (Fast Period + 1)
Slow Alpha = 2 / (Slow Period + 1)
Speed Gate = rho^Coherence Power x Support
Adaptive Alpha = Slow Alpha + (Fast Alpha - Slow Alpha) x Speed Gate
Raw VCMA = Previous Raw VCMA + Adaptive Alpha x (Source - Previous Raw VCMA)
Alpha always remains between the selected Slow and Fast values. Coherence Power shapes the transition: higher values require rho to move closer to 1 before VCMA accelerates substantially.
5. Output WMA
The displayed line is a weighted moving average of the raw adaptive result:
VCMA = WMA(Raw VCMA, Output WMA Length)
The default 3-period WMA reduces small residual turns while adding only modest lag. Set the length to 1 to display the unsmoothed adaptive core.
The Mathematical Idea
VCMA introduces a distinctive adaptive-moving-average construction that extends one-dimensional price-path efficiency into a two-dimensional delay-coordinate path and adds an effective-move gate to reduce acceleration caused by isolated shocks.
The delayed price points X(t) = form a path whose steps are the vectors . The coherence ratio is the path's net displacement divided by its total traveled distance. It therefore measures how straight and directionally consistent the recent delayed path has been. Unlike a one-dimensional ratio, it can also respond to irregular relationships between adjacent price changes, even when those changes share the same sign.
The effective-move gate adds an additional test for concentration. Vector coherence measures directional agreement; effective-move support measures whether that agreement is distributed across enough movement. VCMA accelerates only when both conditions support the change.
This gives VCMA a causal, scale-free, and bounded adaptive core. It does not project price forward, and the final WMA uses only positive weights. Like every moving average, VCMA still has lag. Its purpose is to vary that lag according to the observed structure of the price path.
Characteristics and Advantages
• Clean fixed-color presentation with no embedded trend classification
• Scale-free vector-coherence measurement
• Bounded response between interpretable Fast and Slow periods
• Reduced sensitivity to isolated high-coherence shocks
• Adjustable nonlinear response through Coherence Power
• Optional short WMA for a steadier final line
• Internal diagnostics available in PulseWire's Data Window
How to Read VCMA
VCMA uses one fixed color; color carries no directional or regime meaning. Read the line through its slope, its position relative to price, and the way price behaves around it.
Slope
A rising VCMA indicates that the adaptive baseline is moving higher. A falling VCMA indicates that it is moving lower. A flattening line suggests that recent directional progress is weakening or becoming less consistent.
Price Position
Price holding above a rising VCMA supports a bullish trend interpretation. Price holding below a falling VCMA supports a bearish interpretation. The combination of price position and slope is more informative than either observation alone.
Distance and Crossings
A widening distance between price and VCMA can reflect strong momentum, but it may also indicate extension from the adaptive baseline. Pullbacks toward VCMA can provide trend context when market structure remains intact. Repeated crossings usually indicate unsettled or range-bound movement where a moving-average baseline has less value.
Data Window Diagnostics
• VCMA Coherence Score - raw vector coherence multiplied by move support
• VCMA Raw Vector Coherence - directional alignment before the support gate
• VCMA Effective-Move Support - how broadly vector magnitude is distributed
• VCMA Adaptive Alpha - the smoothing coefficient used by the raw core
High raw coherence with low support often means that one dominant event has not yet received enough support from other moves. High coherence and high support allow alpha to move toward its Fast limit.
Understanding the Settings
Source
Selects the price series used by VCMA. The default is Close.
Coherence Length
Controls the window used to measure vector alignment. Shorter values adapt sooner; longer values evaluate a broader path and usually change more gradually.
Fast Period and Slow Period
Define the fastest and slowest possible responses. A shorter Fast Period increases maximum responsiveness. A longer Slow Period makes VCMA more conservative when coherence or support is weak.
Coherence Power
Higher values suppress medium coherence more strongly and reserve fast responses for readings closer to 1. Lower values produce a softer, earlier acceleration.
Effective Moves for Full Speed
Sets how much distributed movement is required for full support. Higher values reject isolated movement more strongly but may delay acceleration at the beginning of a genuine trend.
Output WMA Length
Controls final smoothing. Higher values produce a steadier line with more lag. A value of 1 disables this stage.
Practical Use
VCMA can serve as an adaptive trend baseline, a pullback reference, a directional filter, or a mathematical building block beside other indicators. Its minimal presentation is useful when the trader wants to interpret the average directly rather than rely on built-in state colors or crossover logic.
VCMA does not predict future price or eliminate whipsaws. Settings should be matched to the instrument, timeframe, and intended holding period, with price structure, volatility, volume, and higher-timeframe context used as additional evidence.
---
Vector Coherence Moving Average (VCMA)
Vector Coherence Moving Average (向量一致性移動平均線) 是以近期價格變化向量之方向一致性為基礎的自適應移動平均線。它刻意保持簡潔,使用固定顏色的細線。
VCMA 會根據兩個問題調整平滑速度:近期價格變化是否朝向一致方向?這種一致性是否得到多個具實質幅度的移動支持,而不是只來自單一事件?方向一致而且支持充分時,VCMA 會提高反應速度;任何一項偏弱,反應便會靠近 Slow 設定。
VCMA 如何計算
1. 延遲座標價格路徑
VCMA 先計算所選 Source 每根 K 線的價格變化:
d(t) = Source(t) - Source(t-1)
然後把價格表示為二維延遲座標路徑上的一個點:
X(t) =
由 X(t-1) 移動至 X(t) 時,便會形成滯後向量:
z(t) = X(t) - X(t-1) =
Magnitude(t) = sqrt
方向持續時,這些向量通常朝向相近方向;價格來回移動時,向量方向互相矛盾,加總後便會抵消。
2. 向量一致性
在 Coherence Length 所設定的週期內,VCMA 比較這條路徑的直線位移與實際行走總距離。等價地說,就是比較「向量總和的長度」與「所有個別向量長度的總和」:
rho = sqrt / Sum sqrt
以這種形式理解,rho 就是二維路徑效率,亦即路徑直線度的比率。
根據三角不等式,rho 會保持在 0 至 1 之間:
• rho 接近 1 - 近期滯後向量方向高度一致
• rho 接近 0 - 向量方向大部分互相抵消
分子與分母都會隨價格變化幅度按比例改變,因此向量一致性不受商品名義價格水平影響。
3. 有效移動支持度
單一大幅移動也可能產生偏高的一致性,因為沒有其他向量與它抵消。VCMA 因此利用向量幅度計算有效樣本數:
Effective Moves = (Sum Magnitude)^2 / Sum Magnitude^2
這是參與程度的量度,不是 K 線數量的直接計數。當一個移動佔據大部分幅度時,數值偏低;當多個移動都有實質貢獻時,數值便會上升。
Support = Clamp
預設目標為 3,VCMA 需要較廣泛的支持才會完整採用一致性訊號。這可減少單一裂口、急升急跌或影線令平均線立即切換至最高速度的情況。
4. 自適應 Alpha
Fast 與 Slow 週期定義遞迴平均線的反應上下限。程式會自動把較短輸入視為 Fast,較長輸入視為 Slow:
Fast Alpha = 2 / (Fast Period + 1)
Slow Alpha = 2 / (Slow Period + 1)
Speed Gate = rho^Coherence Power x Support
Adaptive Alpha = Slow Alpha + (Fast Alpha - Slow Alpha) x Speed Gate
Raw VCMA = Previous Raw VCMA + Adaptive Alpha x (Source - Previous Raw VCMA)
Alpha 始終保持在所選的 Slow 與 Fast 數值之間。Coherence Power 控制轉換曲線;數值越高,rho 越需要接近 1,VCMA 才會明顯加速。
5. 輸出 WMA
圖表上的線條是原始自適應結果的加權移動平均:
VCMA = WMA(Raw VCMA, Output WMA Length)
預設的 3 週期 WMA 可減少細微轉折,同時只加入有限延遲。設為 1,即可顯示未經額外平滑的自適應核心。
數學設計
VCMA 採用一種具辨識度的自適應移動平均線結構:把一維價格路徑效率延伸為二維延遲座標路徑,並加入有效移動閘門,以降低孤立價格衝擊造成的加速。
延遲價格點 X(t) = 形成一條路徑,而 就是路徑上的每一步。向量一致性比率等於路徑的淨位移除以實際行走總距離,因此可衡量近期延遲路徑有多筆直,以及方向有多一致。與一維比率不同,即使價格變化方向相同,若相鄰變化之間的關係反覆而不規則,這個二維比率仍可作出區分。
有效移動閘門再加入集中度檢查。向量一致性衡量方向是否配合;有效移動支持度則衡量這種配合是否分布於足夠的移動。只有兩項條件同時成立,VCMA 才會加快。
這個自適應核心只使用當前及過往資料,不受價格尺度影響,而且 Alpha 有明確上下限。它不會向前投射價格,最後的 WMA 亦只使用正權重。VCMA 仍然是移動平均線,因此必然存在延遲;它的作用是根據已觀察到的價格路徑結構調整延遲。
特性與優點
• 固定顏色的簡潔顯示,不加入內置趨勢分類
• 不受價格尺度影響的向量一致性量度
• 反應速度受具體 Fast 與 Slow 週期限制
• 降低孤立而高一致性的價格衝擊所造成的影響
• 可用 Coherence Power 調整非線性反應
• 可選用短週期 WMA 整理最終線條
• 在 PulseWire Data Window 提供內部診斷數值
如何閱讀 VCMA
VCMA 使用單一固定顏色,顏色不代表方向或市場狀態。閱讀時應觀察線條斜率、價格相對位置,以及價格在 VCMA 附近的行為。
斜率
VCMA 上升,表示自適應基準正在提高;VCMA 下跌,表示基準正在降低。線條逐漸走平,通常代表近期方向進展正在減弱,或價格移動的一致性下降。
價格位置
價格維持在上升 VCMA 之上,可支持多頭趨勢判斷;價格維持在下降 VCMA 之下,可支持空頭判斷。價格位置與線條斜率配合使用,比單獨觀察任何一項更有參考價值。
距離與穿越
價格與 VCMA 的距離擴大,可能反映動能增強,也可能表示價格已偏離自適應基準。當市場結構仍然完整,回調至 VCMA 附近可提供趨勢背景。價格反覆穿越 VCMA,通常表示市況反覆或橫行,此時移動平均線基準的參考價值會下降。
Data Window 診斷數值
• VCMA Coherence Score - 原始向量一致性乘以移動支持度
• VCMA Raw Vector Coherence - 未加入支持閘門前的方向一致性
• VCMA Effective-Move Support - 向量幅度的分布廣度
• VCMA Adaptive Alpha - 原始核心實際使用的平滑係數
Raw Vector Coherence 偏高但 Support 偏低,通常代表一次主導事件尚未得到其他移動充分配合。一致性與支持度同時偏高時,Alpha 才可向 Fast 上限移動。
設定說明
Source
選擇 VCMA 使用的價格序列,預設為 Close。
Coherence Length
控制衡量向量一致性的週期。較短數值適應更快;較長數值會評估更廣的價格路徑,變化通常較慢。
Fast Period 與 Slow Period
定義最快及最慢反應。較短的 Fast Period 會提高最大靈敏度;較長的 Slow Period 則會在一致性或支持度偏弱時令 VCMA 更保守。
Coherence Power
較高數值會更強地壓低中等一致性的作用,只在 rho 接近 1 時採用較快反應。較低數值會較早及較平順地提高速度。
Effective Moves for Full Speed
設定完整支持所需的分布程度。較高數值能更強地抑制孤立移動,但也可能延遲真實趨勢初段的加速。
Output WMA Length
控制最終平滑程度。數值越高,線條越穩定,但延遲亦會增加。設為 1 可停用這一層。
實際應用
VCMA 可作為自適應趨勢基準、回調參考、方向過濾器,亦可配合其他指標作為數學基礎線。它不提供內置狀態顏色或交叉邏輯,適合希望直接判讀平均線本身的交易者。
VCMA 不會預測未來價格,也不能消除所有來回穿越。設定應配合商品、時間週期與預計持倉時間,並以價格結構、波動性、成交量及較高時間週期背景作為補充證據。
---
Vector Coherence Moving Average(VCMA)
Vector Coherence Moving Average(ベクトル・コヒーレンス移動平均線、VCMA)は、直近の価格変化ベクトルがどの程度同じ方向にそろっているかを基準に、反応速度を調整する適応型移動平均線です。チャート上では、細い単色ラインでシンプルに表示されます。
VCMAは、次の2点をもとに平滑化の速度を調整します。直近の価格変化は一貫した方向を向いているか。その一貫性は単発の値動きではなく、複数の意味のある変動によって支えられているか。方向がそろい、かつ十分な裏付けがあるときは反応を速め、どちらかが弱いときはSlow側の穏やかな反応に近づきます。
VCMAの計算方法
1. 遅延座標上の価格経路
VCMAはまず、選択したSourceについて、各バー間の価格変化を計算します。
d(t) = Source(t) - Source(t-1)
次に、価格を2次元の遅延座標上にある点として表します。
X(t) =
X(t-1)からX(t)への移動によって、次の遅延ベクトルが得られます。
z(t) = X(t) - X(t-1) =
Magnitude(t) = sqrt
方向性のある値動きが続くと、これらのベクトルは似た方向を向く傾向があります。一方、価格が往復するとベクトルの方向が食い違い、合計したときに互いを打ち消します。
2. ベクトル・コヒーレンス
設定したCoherence Lengthの範囲で、VCMAはこの経路の直線変位と、実際にたどった総距離を比較します。これは、合成ベクトルの長さと、各ベクトルの長さの合計を比較することと同じです。
rho = sqrt / Sum sqrt
この形で見ると、rhoは2次元の経路効率、つまり経路の直進性を表す比率です。
三角不等式により、rhoは0から1の範囲に収まります。
• rhoが1に近い - 直近の遅延ベクトルが高い精度で同じ方向にそろっている
• rhoが0に近い - ベクトルの方向が互いに大きく打ち消し合っている
分子と分母はどちらも価格変動の大きさに比例するため、ベクトル・コヒーレンスは銘柄の名目価格水準に左右されません。
3. 有効変動の支持度
単発の大きな変動は、それに逆らう動きがほとんどないだけで、高いコヒーレンスを生む場合があります。そこでVCMAは、ベクトルの大きさから有効サンプルサイズを計算します。
Effective Moves = (Sum Magnitude)^2 / Sum Magnitude^2
これはバー数そのものではなく、どれだけ多くの値動きが実質的に寄与しているかを表す指標です。1つの変動が全体を支配していると低くなり、複数の変動が十分な大きさで寄与すると高くなります。
Support = Clamp
初期設定の目標値は3です。VCMAがコヒーレンス信号を完全に反映するには、複数の値動きによる十分な裏付けが必要になります。これにより、単発のギャップ、急騰・急落、長いヒゲに反応して、ただちに最高速度へ切り替わる動きを抑えます。
4. 適応型Alpha
Fast PeriodとSlow Periodは、再帰型平均線の反応速度の上限と下限を定めます。入力順が逆でも、短い方をFast、長い方をSlowとして自動的に扱います。
Fast Alpha = 2 / (Fast Period + 1)
Slow Alpha = 2 / (Slow Period + 1)
Speed Gate = rho^Coherence Power x Support
Adaptive Alpha = Slow Alpha + (Fast Alpha - Slow Alpha) x Speed Gate
Raw VCMA = Previous Raw VCMA + Adaptive Alpha x (Source - Previous Raw VCMA)
Alphaは常に、選択したSlowとFastの範囲内に収まります。Coherence Powerは速度変化のカーブを調整します。値を大きくするほど、rhoが1に近づかない限り、VCMAは大きく加速しにくくなります。
5. 出力WMA
チャートに表示されるラインは、生の適応結果に加重移動平均を適用したものです。
VCMA = WMA(Raw VCMA, Output WMA Length)
初期設定の3期間WMAは、わずかな追加遅延に抑えながら、小さな折り返しを滑らかにします。Output WMA Lengthを1に設定すると、この追加平滑化を無効にし、生の適応コアを表示できます。
数学的な考え方
VCMAは、1次元の価格経路効率を2次元の遅延座標経路へ拡張し、さらに単発のショックによる過度な加速を抑える有効変動ゲートを組み合わせた、特徴的な適応型移動平均線です。
遅延価格点 X(t) = が1本の経路を形成し、その各ステップがベクトル になります。コヒーレンス比率は、経路の正味変位を実際に移動した総距離で割ったものです。これにより、直近の遅延経路がどれだけ直線的で、方向がどれだけ一貫しているかを測定します。1次元の比率とは異なり、価格変化の符号が同じであっても、隣り合う変化の関係が不規則なら、その違いを捉えることができます。
有効変動ゲートは、さらに寄与の集中度を確認します。ベクトル・コヒーレンスは方向の整合性を測り、有効変動の支持度は、その整合性が十分な数の値動きに分散しているかを評価します。VCMAが加速するのは、両方の条件がそろった場合だけです。
その結果、VCMAの適応コアは現在および過去のデータだけで計算され、価格尺度に依存せず、反応速度にも明確な上下限があります。将来の価格を先取りして投影することはなく、最後のWMAも正の重みだけを使用します。VCMAも移動平均線である以上、遅延そのものは残ります。その目的は、観測された価格経路の構造に応じて、反応遅延の度合いを調整することです。
特徴と利点
• トレンド分類を組み込まない、シンプルな単色表示
• 価格尺度に依存しないベクトル・コヒーレンス測定
• 解釈しやすいFast PeriodとSlow Periodの範囲内で反応
• 単発の価格ショックによる過度な加速を抑制
• Coherence Powerによる非線形反応の調整
• 短期WMAによる任意の最終平滑化
• PulseWireのデータウィンドウで内部診断値を確認可能
チャート上でのVCMAの見方
VCMAは常に1つの固定色で表示され、色そのものに方向や相場状態の意味はありません。ラインの傾き、価格との位置関係、そしてVCMA付近での価格の動きを読み取ります。
傾き
VCMAが上昇している場合は、適応型の基準線が切り上がっていることを示します。下降している場合は、基準線が切り下がっていることを示します。ラインが横ばいに近づく場合は、直近の方向性が弱まっているか、値動きの一貫性が低下している可能性があります。
価格との位置関係
上向きのVCMAより上で価格が推移していれば、強気トレンドの解釈を補強します。下向きのVCMAより下で価格が推移していれば、弱気トレンドの解釈を補強します。価格の位置とラインの傾きを組み合わせる方が、どちらか一方だけを見るよりも有用です。
距離とクロス
価格とVCMAの距離が広がる動きは、強いモメンタムを表す一方で、適応型の基準線から価格が行き過ぎている可能性も示します。市場構造が維持されている場合、VCMA付近への押し目や戻りはトレンド判断の参考になります。価格がVCMAを何度も往復する場合は、方向感が定まっていないかレンジ相場であることが多く、移動平均線を基準にする有効性は低下します。
データウィンドウの診断値
• VCMA Coherence Score - 生のベクトル・コヒーレンスに変動支持度を掛けた値
• VCMA Raw Vector Coherence - 支持ゲートを適用する前の方向整合性
• VCMA Effective-Move Support - ベクトルの大きさがどの程度広く分散しているか
• VCMA Adaptive Alpha - 生の適応コアが実際に使用した平滑化係数
Raw Vector Coherenceが高くてもSupportが低い場合、1つの支配的なイベントに対して、ほかの値動きによる裏付けがまだ不足していることが多いと考えられます。コヒーレンスと支持度がともに高くなると、AlphaはFast側の上限へ近づくことができます。
設定項目
Source
VCMAの計算に使用する価格系列を選択します。初期設定はCloseです。
Coherence Length
ベクトルの整合性を測定する期間を設定します。短くすると適応が速くなり、長くするとより広い価格経路を評価するため、通常は変化が緩やかになります。
Fast PeriodとSlow Period
最速時と最遅時の反応を定めます。Fast Periodを短くすると最大反応速度が上がります。Slow Periodを長くすると、コヒーレンスまたは支持度が弱い場面でVCMAがより慎重に反応します。
Coherence Power
値を大きくすると、中程度のコヒーレンスによる影響をより強く抑え、rhoが1に近い場合にだけ速い反応を許します。値を小さくすると、より早い段階から滑らかに加速します。
Effective Moves for Full Speed
完全な支持度に達するために必要な、値動きの分散度を設定します。値を大きくすると単発の変動をより強く抑えられますが、本物のトレンドが始まった直後の加速も遅れる可能性があります。
Output WMA Length
最終平滑化の強さを設定します。値を大きくするとラインは安定しますが、遅延も増えます。1に設定すると、この平滑化を無効にできます。
実践的な使い方
VCMAは、適応型のトレンド基準線、押し目・戻りの参考線、方向フィルター、またはほかのインジケーターと組み合わせる数学的なベースラインとして利用できます。状態ごとの色分けやクロス判定を内蔵しないため、移動平均線そのものを直接読み取りたい場合に適しています。
VCMAは将来の価格を予測するものではなく、頻繁な往復やダマシを完全に排除することもできません。設定は銘柄、時間足、想定する保有期間に合わせて調整し、価格構造、ボラティリティ、出来高、上位時間足の状況も補足材料として利用してください。
Indicator

Indicator

Iteratively Reweighted Least Squares (IRLS) [Jamallo]Author's Note: This script is published as a unique mathematical contribution to PulseWire's open-source public library. It is intended to introduce a novel application of a robust statistical method for the community and developers to study, adapt, and build upon, rather than to serve as a standalone, out-of-the-box trading strategy.
Introduction
Almost all moving averages and smoothing filters in technical analysis treat historical price data equally or apply a fixed mathematical decay (like an EMA). The problem? A massive, anomalous wick or a sudden volatility spike will inevitably drag the average away from the true underlying market consensus.
Enter Iteratively Reweighted Least Squares (IRLS) .
IRLS is a robust statistical method that calculates a "consensus" price by actively identifying and down-weighting outliers. Instead of letting a large wick distort the line, the algorithm assigns less weight to prices that deviate furthest from the current estimate. The result is a filter that cuts through noise, ignores price-distant spikes, and naturally locks onto the dominant, high-density price levels.
How It Works
The indicator uses the Hardy weight function to determine how heavily each historical candle influences the current estimate. On every bar, the algorithm checks the distance of each sample from the current consensus and iteratively refines the line until it converges on a robust mean. Epsilon — the outlier rejection scale — is derived dynamically from the average High–Low range, keeping the filter dimensionless and consistent across all instruments and timeframes.
Parameters
Window Size (N) : The rolling lookback window of historical samples the kernel considers. Larger values produce a smoother, slower-responding line.
Sparsity (s/N) : The core behavioral control. Dictates the fraction of the window allowed to "vote" on the estimate.
Low Sparsity (e.g., 0.1) : Only the 10% of samples closest to the current estimate participate. Produces a snappy, selective line that locks tightly onto the most dominant price cluster.
High Sparsity (e.g., 1.0) : All samples participate, resulting in a smoother, more conventional robust mean.
Gamma (ε scale) : Controls the strength of outlier rejection. Lower values enforce harsh, median-like rejection. Higher values soften the rejection toward a standard weighted mean.
Iterations : The number of reweighting convergence passes per bar. 2–3 is sufficient for practical convergence.
Potential Applications
The Hardy IRLS filter provides a unique lens into market structure by shifting the focus from simple time-averaged prices to spatial price consensus. Because it rejects price-distant wicks and noise spikes by design, it can serve as a foundation for:
Custom trailing stops
Dynamic support and resistance trackers
Baseline trend or regime filters
Feel free to inspect the open-source code, experiment with extreme sparsity and gamma settings, and integrate the IRLS core into your own quantitative projects.
References
Li Shuang, "Sparse Representation of Hardy Function by Iteratively Reweighted Least Squares," 2020 International Symposium on Computer Engineering and Intelligent Communications (ISCEIC), IEEE, 2020. DOI: 10.1109/ISCEIC51027.2020.00020
Indicator

Iterative Rational Quadratic ChannelThe Iterative Rational Quadratic Channel is a kernel-based smoothing and state estimation framework that applies a Rational Quadratic kernel regression to price data, combined with a rolling standard deviation envelope to construct adaptive dynamic channel boundaries.
Unlike exponential kernel methods that prioritize recent data at the expense of historical context, the rational quadratic kernel introduces a heavy-tailed weighting structure that preserves multi-scale memory in price dynamics. This enables the channel to reflect not only short-term fluctuations, but also broader structural regime context.
The resulting channel is less reactive to micro-noise and more representative of persistent market structure, making it particularly effective for trend continuity analysis, regime modeling, and reducing sensitivity to false reversals.
Its primary utility is as a state estimation and regime-filtering tool for price behavior, rather than a pure high-frequency signal isolation tool.
TRADING USES
The Rational Quadratic Channel is best interpreted as a regime-aware structural filter rather than a purely reactive trading band.
Trend Continuity
The channel basis line (RQ smoothed price) provides a stable representation of underlying market direction. Sustained movement above or below the basis reflects trend persistence rather than short-lived fluctuations, making it useful for maintaining directional bias.
Regime Persistence
Due to the heavy-tailed memory of the rational quadratic kernel, historical price structure continues to influence current valuation. This produces smoother transitions between market phases and reduces sensitivity to short-term reversals, improving regime stability.
False Reversal Filtering
Compared to exponentially weighted kernels, the RQ channel reduces overreaction to transient volatility spikes. This helps filter out low-quality reversals driven by noise rather than structural change.
State Estimation
The channel functions as a continuous estimator of market state:
- The basis represents the inferred latent price state
- The envelope represents dynamic volatility dispersion around that state
This makes it well-suited for manual, semi-automated, and automated trading systems requiring a stable structural representation of price rather than raw responsiveness. Gradual shifts in the basis line and channel position can also serve as a framework for monitoring changes in trend direction and regime transitions over time.
Volatility & Risk Context
The rolling standard deviation envelope expands and contracts based on realized volatility, providing a contextual risk framework. Wider channels indicate increased uncertainty and dispersion, while tighter channels indicate compression and lower variance conditions.
THEORY
The rational quadratic kernel is a member of the scale-mixture family of Gaussian kernels and can be interpreted as a superposition of Gaussian processes operating at multiple length scales. This allows it to capture both local and global structure in time series data.
It is defined as:
k(i)=(1+i22αℓ2)−αk(i) = \left(1 + \frac{i^2}{2\alpha \ell^2}\right)^{-\alpha}k(i)=(1+2αℓ2i2)−α
Where:
---> α\alphaα controls tail heaviness (relativeWeight)
---> ℓ\ellℓ defines the characteristic scale (lookback)
Unlike Gaussian kernels, which enforce exponential decay and emphasize locality, the rational quadratic kernel follows a power-law decay. This allows older observations to retain influence over the estimator for longer periods, producing a smoothing effect that is inherently multi-scale and well-suited for modeling persistent structural behavior.
The rolling standard deviation complements this by measuring dispersion around the estimated state, forming a volatility-adaptive envelope. Rather than acting as a strict statistical confidence interval, it provides a dynamic representation of market expansion and contraction.
The iterative implementation processes data sequentially (bar-by-bar), ensuring computational efficiency and making the indicator suitable for real-time use without repainting.
CALIBRATION
Calibration determines the balance between responsiveness, structural memory, and regime stability.
Length (Lookback)
Lower (50–100): More responsive, increased sensitivity to short-term structure
Medium (150–250): Balanced for swing trading and intermediate regimes
Higher (300+): Strong regime persistence, reduced sensitivity to noise
Relative Weight (Tail Sensitivity)
Controls how quickly historical influence decays:
Lower values (≈ 0.5 – 1.0):
- Behavior approaches Gaussian
- More responsive to recent price action
- Faster detection of trend changes
- Slightly more sensitive to noise
Higher values (≈ 2.0+):
- Stronger heavy-tail behavior
- Increased influence of older price data
- Smoother output and stronger regime anchoring
- Improved false reversal filtering
Start At Bar (Lag / Structural Anchoring)
Controls how much recent price data is excluded from the kernel calculation:
Lower values (0–10):
- Uses most recent data
- Faster reaction to price changes
- More sensitive to short-term volatility
Moderate values (10–30):
- Balanced responsiveness and stability
- Reduces noise without excessive lag
- Suitable for most trading environments
Higher values (30+):
- Strong structural anchoring
- Significantly reduced sensitivity to recent fluctuations
- Enhanced regime persistence
- Slower response to turning points
This parameter effectively introduces a controlled lag, allowing users to tune the tradeoff between responsiveness and regime stability.
MARKET USAGE
Stock, Forex, Crypto, Commodities, and Indices. Indicator

Indicator

LOWESS Channel & Extrapolation [LuxAlgo]The LOWESS Channel & Extrapolation indicator calculates a Locally Weighted Scatterplot Smoothing (LOWESS) curve to define a non-linear trend and projects it into future bars using local regression slopes. It provides a dynamic channel based on the standard deviation of residuals, helping traders identify overextended price levels and potential mean-reversion points.
The LOWESS Channel & Extrapolation indicator is subject to repainting and displayed retrospectively.
🔶 USAGE
This tool is primarily designed for trend analysis and identifying exhaustion points. Because the LOWESS algorithm recalculates based on the most recent data window, the entire historical curve can adjust, making it a powerful tool for backtesting and analyzing past market structures rather than for real-time signal generation without confirmation.
🔹 Trend Identification
The central fit line represents the smoothed local trend. When the curve is sloping upward, the local market sentiment is considered bullish; conversely, a downward slope indicates bearish sentiment.
🔹 Overbought/Oversold Conditions
The dashed outer channels represent a volatility-adjusted boundary. When price moves outside these boundaries, it is statistically overextended relative to the local trend, often preceding a move back toward the mid-line.
🔹 Extrapolation
The indicator extends the most recent local regression slope into the future. This provides a "path of least resistance" projection based on the current momentum of the smoothed curve.
🔶 DETAILS
The LOWESS (Locally Weighted Scatterplot Smoothing) algorithm works by performing a separate weighted linear regression for every data point in the window.
It uses a "tricube" weighting function, which ensures that data points closer to the focal point have a higher influence on the fit than points further away. This results in a curve that is much more flexible than a simple moving average and can adapt to complex price cycles without the lag associated with traditional filters.
The channel width is determined by calculating the Standard Deviation of the residuals (the difference between the actual price and the LOWESS fit). This ensures the channel expands during high volatility and contracts during consolidation.
🔶 SETTINGS
Length : Determines the number of historical observations used to fit the LOWESS curve. Larger values result in a smoother, more macro trend. Span : The fraction of data points used for each local regression. A higher span (closer to 1.0) creates a smoother line, while a lower span allows the curve to follow price more tightly. Channel Multiplier : Multiplier applied to the standard deviation of residuals to define the distance of the upper and lower bands from the mid-line. Extrapolation Bars : The number of bars to project the current trend into the future. Fit Color : Sets the color and transparency of the central LOWESS line. Channel Color : Sets the color of the dashed outer bands and the background fill. Line Width : Adjusts the thickness of the central fit line. Indicator

Adaptive Centric Moving Average [LuxAlgo]The Adaptive Centric Moving Average indicator provides a dynamic smoothing tool that adjusts its reactivity based on where the price sits relative to its recent trading range midpoint.
🔶 USAGE
The Adaptive Centric Moving Average (AMA) is designed to filter out noise during periods of consolidation while remaining highly responsive during trending moves. When the price is near the center of its recent high-low range, the indicator becomes flatter and less prone to "whipsaws." As price moves toward the extremes of its range, the indicator accelerates to catch the emerging trend.
Users can utilize the AMA for trend identification and trailing stop-loss levels. The visual gradient fill between the source price and the AMA line helps traders quickly identify the current trend strength and the distance between price and the smoothed average.
🔶 DETAILS
The core logic of the script relies on a normalized relative position (similar to a Stochastic calculation) to determine how far the price is from its range midpoint.
🔹 Adaptive Smoothing Logic
The indicator calculates a smoothing factor (alpha) based on the absolute distance from the 50% level of the range.
When price is at the midpoint (50%), the alpha is zero, causing the moving average to stay flat.
As price moves toward the upper or lower boundaries (0% or 100%), the alpha increases, making the average more reactive.
🔹 The Centric Calculation
Unlike standard moving averages that track the source price directly, this indicator centers its target around the range midpoint. The Attenuation Factor scales the distance between the source and the midpoint, while the Power Factor applies an exponent to the smoothing factor, allowing for non-linear reactivity.
🔶 SETTINGS
🔹 Price Settings
Source: The price series used for calculations (default is Close).
Length: The window size used for pre-smoothing the source and determining the highest highs and lowest lows for the range.
🔹 Adaptive Settings
Attenuation Factor: Controls the intensity of the price input relative to the midpoint. Lower values increase reactivity, while higher values provide a more stable, base smoothing speed.
Power Factor: Exponents the smoothing factor. Higher values make the moving average significantly flatter when the price is near the range midpoint, requiring stronger moves to trigger a reaction.
🔹 Colors
AMA Color: The color of the main Adaptive Centric Moving Average line.
Bullish Fill: The color used for the gradient fill when the price is above the AMA.
Bearish Fill: The color used for the gradient fill when the price is below the AMA.
Indicator

Gaussian Volume Profile [LuxAlgo]The Gaussian Volume Profile indicator is a sophisticated volume analysis tool that uses the Levenberg-Marquardt optimization algorithm to fit a Sum of Gaussians model to historical volume distribution.
This approach transcends traditional discrete volume profiles by providing a continuous, noise-reduced representation of liquidity clusters, allowing for the precise identification of high-volume nodes and their respective price boundaries.
🔶 USAGE
The indicator projects a lateral volume density map to the right of the current price action. Users can utilize this tool to identify "fair value" zones where the Gaussian peaks are most concentrated. Unlike standard profiles that show jagged horizontal bars, this tool provides a smooth "fit" line that highlights the true center of gravity for volume at specific price levels.
🔹 Identifying High-Volume Nodes
The script automatically detects local maxima (peaks) within the fitted Gaussian model. These peaks represent the most significant price levels where the highest density of trading occurred. Horizontal dashed lines are drawn at these apexes, color-coded to match the specific Gaussian component that is most dominant at that price.
🔹 Zone Width and Volatility
By observing the width (standard deviation) of the individual Gaussian components (the dotted curves), traders can gauge the "breadth" of a value area. A narrow, sharp peak suggests a very specific price level of agreement, while a wide, shallow curve indicates a broad range where volume was distributed less precisely.
🔶 DETAILS
This tool represents a scientific advancement over regular Volume Profiles by applying a Gaussian Density model to market data:
Noise Reduction: Discrete profiles are often "noisy," with small volume gaps between price ticks. The Sum of Gaussians model acts as a sophisticated filter, smoothing out insignificant variances to reveal the underlying structural liquidity.
Levenberg-Marquardt Optimization: The script utilizes the LM algorithm, a standard in non-linear least squares problems, to iteratively refine the fit of multiple Gaussian pulses. This ensures the model converges on the most mathematically accurate representation of the volume data.
Precise Liquidity Centers: While a standard profile bin might be several ticks wide, the Gaussian apex provides a mathematically derived "center" ($\mu$) for liquidity, often offering more precise support and resistance levels.
Continuous Distribution: Because it models volume as a continuous function, it can estimate volume density between discrete price bins, providing a more fluid view of market interest.
The visual output combines a lateral histogram with a bold Gaussian density curve, color-coded components, and auto-detected peak levels for a comprehensive view of institutional interest.
🔶 SETTINGS
🔹 Profile Settings
Lookback Window: The number of historical bars used to calculate the volume profile distribution.
Number of Bins: Determines the vertical resolution of the profile. More bins provide more detail but require more computation.
🔹 Gaussian Settings
Max Potential Peaks: The maximum number of Gaussian components (nodes) the algorithm will attempt to fit to the data.
Max Iterations: Controls how many times the LM optimizer refines the fit. Higher values improve accuracy but may impact performance.
Initial Lambda: The damping factor for the optimization algorithm, affecting the early steps of the fitting process.
🔹 Visuals
Histogram Resolution: The maximum horizontal length of the projected histogram and fit line, measured in bar widths.
Highlight Window Range: Toggles a visual background box covering the historical lookback area for context.
Highlight Detected Peaks: Detects local maxima in the final fit and draws horizontal dashed levels at those price points.
Fit Color: Sets the static color for the main density curve.
Auto: When enabled, the fit color automatically adapts to your chart's foreground color (e.g., white on dark backgrounds).
Indicator

Indicator

Universal Moving Average🙏🏻 UMA (Universal Moving Average) represents the most natural and prolly ‘the’ final general universal entity for calculating rolling typical value for any type of time-series. Simply via different weighting schemes applied together, it encodes:
Location of each datapoint in corresponding fields (price, time, volume)
Informational relevance of each datapoint via using windowing functions that are fundamental in nature and go beyond DSP inventions & approximations
Innovation in state space (in our case = volatility)
The real beauty of this development: being simply a weighting scheme that can be applied to anything: be it weighted median , weighted quantile regression, or weighted KDE , or a simple weighted mean (like in this script). As long as a method accepts weights, you can harness the power of this entity. It means that final algorithmic complexity will match your initial tool.
As a moving ‘average’ it beats ALMA, KAMA, MAMA, VIDYA and all others because it is a simple and general entity, and all it does is encoding ‘all’ available information. I think that post might anger a lot of people, because lotta things will be realized as legacy and many paywalls gonna be ignored, specially for the followers of DSP cult, the ones who yet don’t understand that aggregated tick data is not a signal omg, it’s a completely different type of time series where your methods simply don’t fit even closely. I am also sorry to inform y’all, that spectral analysis is much closer to state-space methods in spirit than to DSP. But in fact DSP is cool and I love it, well for actual signals xD
...
Weights explained & how to use them: as I already said, the whole thing is based on combining different set of weights, and you can turn them on/off in script settings. Btw I've set em up defaults so you can use the thing on price data out of the box right away.
Price, Time, Volume weights: encode location of every datapoint in Price & TIme & Volume field
Howtouse: u have to disable one weight that corresponds to the field you apply UMA to. E.g if you apply UMA to prices, you turn off price weighting And turn on time and volume weighting. Or if you apply UMA to volume delta, you turn off volume weighting And turn on price and time weighting.
Higher prices are more important, this asymmetry is confirmed and even proved by the fact that prices can’t be negative (don’t even mention that incorrect rollover on CL contract in 2k20...).
Signal weights: encode actuality/importance/relevance of datapoints.
Howtouse: in DSP terms, it provides smoothing, but also compensates for the lag it introduces. This smoothness is useful if you use slope reversals for signal generation aka watching peaks and valleys in a moving average shape. It's also better to perturb smoothed outputs with this , this way you inject high freq content back, But in controlled way!
Signal = information.
The fundamental universal entity behind so-called “smoothing” in DSP has nothing to do with signals and goes eons beyond DSP. This is simply about measuring the relevance of data in time.
First, new datapoints need some time to be “embedded” into the timeline, you can think of it as time proof, kinda stuff needs time to be proved, accepted; while earliest datapoints lose relevance in time.
Second, along with the first notion, at the same time there’s the counter notion that simply weights new data more, acting as a counterweight from the down-weighting of the latest datapoints introduced by the first notion.
The first part can be represented as PDF of beta(2, 2) window (a set of weights in our case). It’s actually well known as the Welch window, that lives in between so called statistical and DSP worlds, emerges in multiple contexts. Mainstream DSP users tho mostly don’t use this one, they use primitive legacy windowing function, you can find all kinds on this wiki page.
Now the second part, where DSP adepts usually stop, is to introduce the second compensating windowing function. Instead they try to reduce window size, or introduce other kinds of volatility weights, do some tricks, but it ain’t provides obviously. The natural step here is to simply use the integral of the initial window; if the initial window is beta(2, 2) then what we simply need is CDF of beta(2, 2), in fact the vertically inverted shape of it aka survival function . That’s it bros. Simply as that.
When both of these are applied you have smth magical, your output becomes smooth and yet not lagging. No arbitrary windowing functions, tricks with data modification etc
Why beta(2, 2)? It naturally arises in many contexts, it’s based on one of the most fundamental functions in the universe: x^2. It has finite support. I can talk more bout it on request, but I am absolutely sure this is it.
^^ impulse response of the resulting weighs together (green) compared with uniform weights aka boxcar (red). Made with this script .
Weighing by state: encodes state-space innovation of each datapoint, basically magnitude of changes, strength of these changes, aka volatility.
Howtouse: this makes your moving average volatility aware in proper math ways. The influence of datapoints will be stronger when changes are stronger. This is weighting by innovations, or weighting by volatility by using squared returns.
Why squared returns? They encode state‑space innovations properly because the innovation of any continuous‑time semimartingale is about its quadratic variation, and quadratic variation is built from squared increments, not absolute increments.
Adaptive length is not the right way to introduce adaptivity by volatility xD. When you weight datapoints by squared returns you’re already dynamically varying ‘effective’ data size, you don’t need anything else.
...
It’s all good, progress happens, that’s how the Universe works, that's how Universal Moving Average works. Time to evolve. I might update other scripts with this complete weighting scheme, either by my own desire or your request.
...
∞ Indicator

Dynamic Laguerre Filter Bands | OttoThis indicator combines trend-following and volatility analysis by enhancing the traditional Laguerre filter with a dynamic, volatility-adjusted band system. Instead of using fixed thresholds, the bands adapt in real-time to changing market conditions by applying smoothed standard deviation calculations. This design keeps the indicator responsive to significant price movements while effectively filtering out short-term market noise, resulting in more accurate trend identification and breakout signals.
Core Concept
The indicator is built around the following key components:
Laguerre Filter:
The Laguerre filter is designed to smooth out price data by reducing market noise while still being quick enough to detect real changes in price direction. Its goal is to create a clear, smooth trend line that helps traders/investors focus on the overall market trend without getting distracted by small, random price swings.
It uses a parameter called gamma to control how it balances smoothness and responsiveness:
A lower gamma gives more weight to recent price data, making the filter react faster to new price changes. This means the trend line is more sensitive but may also be less smooth and more prone to small fluctuations.
A higher gamma gives more weight to past price data, making the filter smoother and less sensitive to quick changes. This helps reduce noise and produces a steadier trend line, but it also introduces more lag, meaning the filter reacts slower to new price moves.
By adjusting gamma, the Laguerre filter lets you choose the balance between following price changes quickly and having a stable, noise-free trend signal.
Standard Deviation:
shows how much price varies from the mean. In this indicator, it’s used to measure market volatility.
Volatility Bands: The upper and lower bands are based on an EMA-smoothed standard deviation of price. The EMA reduces sudden jumps in volatility, creating smoother and more stable bands that still respond to changing market conditions. These bands are plotted around the Laguerre filter line, expanding and contracting in a controlled way to stay aligned with real market movement while avoiding short-term noise.
Signal Logic:
A long signal is triggered when the close price crosses above the upper band.
A short signal occurs when the close price falls below the lower band.
⚙️ Inputs
Source: Price source used in calculations
Gamma: Adjusts how much the Laguerre filter responds to price changes. Lower gamma values make the filter react more to recent prices, while higher values give more influence to older data, making the line smoother but slower to respond.
Volatility Length: Period used to calculate standard deviation
Volatility Smoothing Length: EMA smoothing length for standard deviation
Multiplier: Scales the width of the bands based on volatility
📈 Visual Output
Laguerre Filter Line: Plots the laguerre filter line, colored dynamically based on signal direction (green for bullish, purple for bearish)
Upper & Lower Bands: Volatility-based bands that adjust with market conditions. (green for bullish, purple for bearish)
Glow Effect: Optional glow layer to enhance visibility of the laguerre filter trend line (green for bullish, purple for bearish)
Bar Coloring: Candlesticks and bar colors reflect the active signal state for fast visual interpretation (green for bullish, purple for bearish)
How to Use
Apply the indicator to your chart and monitor for signal events:
Long Signal: When price closes above the upper band
Short Signal: When price closes below the lower band
🔔 Alerts
This indicator supports optional alert conditions you can enable for:
Long Signal: Close price crossing above the upper band
Short Signal: Close price crossing below the lower band
⚠️ Disclaimer:
This indicator is intended for educational and informational purposes only. Trading/investing involves risk, and past performance does not guarantee future results. Always test and evaluate indicators/strategies before applying them in live markets. Use at your own risk.
Indicator

FVG Trailing Stop [LuxAlgo]The FVG Trailing Stop indicator tracks unmitigated Fair Value Gaps (FVG) data to produce a Trailing Stop indicator able to determine if the market is uptrending or downtrending easily.
🔶 USAGE
The FVG Trailing Stop is intended to identify trend directions through its position relative to the closing price:
Bullish: Price is located above the Trailing Stop, indicating that all Bearish FVGs have been mitigated and the trend is anticipated to continue upwards.
Bearish State: Price is located below the Trailing Stop, indicating that all Bullish FVGs have been mitigated and the trend is anticipated to continue downwards.
The Trailing Stop originates from two extremities obtained from the average of respective unmitigated FVGs. The specific directional average is also displayed as a more transparent secondary line, however, the trailing stop is derived from this value and a new trend will not be detected until the opposite directional average is crossed.
Price reaching the Trailing Stop is caused by retracements and can lead to the following scenarios:
Outcome 1: The directional average is crossed next, indicating a new trend direction.
Outcome 2: The directional average is held as support or resistance, leading to a new impulse and a continuation of the trend.
🔹 Reset on Cross
While price crossing the Trailing Stop should be considered as a sign of an upcoming trend change; it is possible for the price to still evolve outside it.
As a solution, we have included the "Reset on Cross" feature, which (as the name suggests) hides and resets the Trailing Stop each time it is crossed, leading to a "Neutral" state.
This opens the opportunity for the Trailing Stop to be displayed again once the price moves again in the direction of the pre-established trend. A trader might use this to accumulate positions within a specific trend.
🔶 DETAILS
The script uses a typical identification method for FVGs. Once identified, the script collects the point of the FVG farthest from the current price when formed.
For Upwards FVGs this is the bottom of the FVG.
For Downwards FVGs this is the top of the FVG.
The data is managed only to use the last input lookback of FVGs. If an FVG is mitigated, it frees up a spot in the memory for a new FVG, however, if the lookback is full, the oldest will be deleted.
From there, it uses a "trailing" logic only to move the Trailing Stop in one direction until the trailing stop resets or the direction flips.
The extremities used to calculate the Trailing Stop are created from 2 calculation steps, the first step involves taking the raw average of the FVG mitigation levels, and the second step applies a simple moving average (SMA) smoothing of the precedent-obtained averages.
🔶 SETTINGS
Unmitigated FVG Lookback: Sets the maximum number of Unmitigated FVGs that the script will use.
Smoothing Length: Sets the smoothing length for the Trailing Stop to reduce erratic results.
Reset on Cross: When enabled, hide and reset the Trailing Stop until the price starts moving in the pre-established trend direction again.
Indicator

Candle Breakout Oscillator [LuxAlgo]The Candle Breakout Oscillator tool allows traders to identify the strength and weakness of the three main market states: bullish, bearish, and choppy.
Know who controls the market at any given moment with an oscillator display with values ranging from 0 to 100 for the three main plots and upper and lower thresholds of 80 and 20 by default.
🔶 USAGE
The Candle Breakout Oscillator represents the three main market states, with values ranging from 0 to 100. By default, the upper and lower thresholds are set at 80 and 20, and when a value exceeds these thresholds, a colored area is displayed for the trader's convenience.
This tool is based on pure price action breakouts. In this context, we understand a breakout as a close above the last candle's high or low, which is representative of market strength. All other close positions in relation to the last candle's limits are considered weakness.
So, when the bullish plot (in green) is at the top of the oscillator (values above 80), it means that the bullish breakouts (close below the last candle low) are at their maximum value over the calculation window, indicating an uptrend. The same interpretation can be made for the bearish plot (in red), indicating a downtrend when high.
On the other hand, weakness is indicated when values are below the lower threshold (20), indicating that breakouts are at their minimum over the last 100 candles. Below are some examples of the possible main interpretations:
There are three main things to look for in this oscillator:
Value reaches extreme
Value leaves extreme
Bullish/Bearish crossovers
As we can see on the chart, before the first crossover happens the bears come out of strength (top) and the bulls come out of weakness (bottom), then after the crossover the bulls reach strength (top) and the bears weakness (bottom), this process is repeated in reverse for the second crossover.
The other main feature of the oscillator is its ability to identify periods of sideways trends when the sideways values have upper readings above 80, and trending behavior when the sideways values have lower readings below 20. As we just saw in the case of bullish vs. bearish, sideways values signal a change in behavior when reaching or leaving the extremes of the oscillator.
🔶 DETAILS
🔹 Data Smoothing
The tool offers up to 10 different smoothing methods. In the chart above, we can see the raw data (smoothing: None) and the RMA, TEMA, or Hull moving averages.
🔹 Data Weighting
Users can add different weighting methods to the data. As we can see in the image above, users can choose between None, Volume, or Price (as in Price Delta for each breakout).
🔶 SETTINGS
Window: Execution window, 100 candles by default
🔹 Data
Smoothing Method: Choose between none or ten moving averages
Smoothing Length: Length for the moving average
Weighting Method: Choose between None, Volume, or Price
🔹 Thresholds
Top: 80 by default
Bottom: 20 by default
Indicator

Half Causal EstimatorOverview
The Half Causal Estimator is a specialized filtering method that provides responsive averages of market variables (volume, true range, or price change) with significantly reduced time delay compared to traditional moving averages. It employs a hybrid approach that leverages both historical data and time-of-day patterns to create a timely representation of market activity while maintaining smooth output.
Core Concept
Traditional moving averages suffer from time lag, which can delay signals and reduce their effectiveness for real-time decision making. The Half Causal Estimator addresses this limitation by using a non-causal filtering method that incorporates recent historical data (the causal component) alongside expected future behavior based on time-of-day patterns (the non-causal component).
This dual approach allows the filter to respond more quickly to changing market conditions while maintaining smoothness. The name "Half Causal" refers to this hybrid methodology—half of the data window comes from actual historical observations, while the other half is derived from time-of-day patterns observed over multiple days. By incorporating these "future" values from past patterns, the estimator can reduce the inherent lag present in traditional moving averages.
How It Works
The indicator operates through several coordinated steps. First, it stores and organizes market data by specific times of day (minutes/hours). Then it builds a profile of typical behavior for each time period. For calculations, it creates a filtering window where half consists of recent actual data and half consists of expected future values based on historical time-of-day patterns. Finally, it applies a kernel-based smoothing function to weight the values in this composite window.
This approach is particularly effective because market variables like volume, true range, and price changes tend to follow recognizable intraday patterns (they are positive values without DC components). By leveraging these patterns, the indicator doesn't try to predict future values in the traditional sense, but rather incorporates the average historical behavior at those future times into the current estimate.
The benefit of using this "average future data" approach is that it counteracts the lag inherent in traditional moving averages. In a standard moving average, recent price action is underweighted because older data points hold equal influence. By incorporating time-of-day averages for future periods, the Half Causal Estimator essentially shifts the center of the filter window closer to the current bar, resulting in more timely outputs while maintaining smoothing benefits.
Understanding Kernel Smoothing
At the heart of the Half Causal Estimator is kernel smoothing, a statistical technique that creates weighted averages where points closer to the center receive higher weights. This approach offers several advantages over simple moving averages. Unlike simple moving averages that weight all points equally, kernel smoothing applies a mathematically defined weight distribution. The weighting function helps minimize the impact of outliers and random fluctuations. Additionally, by adjusting the kernel width parameter, users can fine-tune the balance between responsiveness and smoothness.
The indicator supports three kernel types. The Gaussian kernel uses a bell-shaped distribution that weights central points heavily while still considering distant points. The Epanechnikov kernel employs a parabolic function that provides efficient noise reduction with a finite support range. The Triangular kernel applies a linear weighting that decreases uniformly from center to edges. These kernel functions provide the mathematical foundation for how the filter processes the combined window of past and "future" data points.
Applicable Data Sources
The indicator can be applied to three different data sources: volume (the trading volume of the security), true range (expressed as a percentage, measuring volatility), and change (the absolute percentage change from one closing price to the next).
Each of these variables shares the characteristic of being consistently positive and exhibiting cyclical intraday patterns, making them ideal candidates for this filtering approach.
Practical Applications
The Half Causal Estimator excels in scenarios where timely information is crucial. It helps in identifying volume climaxes or diminishing volume trends earlier than conventional indicators. It can detect changes in volatility patterns with reduced lag. The indicator is also useful for recognizing shifts in price momentum before they become obvious in price action, and providing smoother data for algorithmic trading systems that require reduced noise without sacrificing timeliness.
When volatility or volume spikes occur, conventional moving averages typically lag behind, potentially causing missed opportunities or delayed responses. The Half Causal Estimator produces signals that align more closely with actual market turns.
Technical Implementation
The implementation of the Half Causal Estimator involves several technical components working together. Data collection and organization is the first step—the indicator maintains a data structure that organizes market data by specific times of day. This creates a historical record of how volume, true range, or price change typically behaves at each minute/hour of the trading day.
For each calculation, the indicator constructs a composite window consisting of recent actual data points from the current session (the causal half) and historical averages for upcoming time periods from previous sessions (the non-causal half). The selected kernel function is then applied to this composite window, creating a weighted average where points closer to the center receive higher weights according to the mathematical properties of the chosen kernel. Finally, the kernel weights are normalized to ensure the output maintains proper scaling regardless of the kernel type or width parameter.
This framework enables the indicator to leverage the predictable time-of-day components in market data without trying to predict specific future values. Instead, it uses average historical patterns to reduce lag while maintaining the statistical benefits of smoothing techniques.
Configuration Options
The indicator provides several customization options. The data period setting determines the number of days of observations to store (0 uses all available data). Filter length controls the number of historical data points for the filter (total window size is length × 2 - 1). Filter width adjusts the width of the kernel function. Users can also select between Gaussian, Epanechnikov, and Triangular kernel functions, and customize visual settings such as colors and line width.
These parameters allow for fine-tuning the balance between responsiveness and smoothness based on individual trading preferences and the specific characteristics of the traded instrument.
Limitations
The indicator requires minute-based intraday timeframes, securities with volume data (when using volume as the source), and sufficient historical data to establish time-of-day patterns.
Conclusion
The Half Causal Estimator represents an innovative approach to technical analysis that addresses one of the fundamental limitations of traditional indicators: time lag. By incorporating time-of-day patterns into its calculations, it provides a more timely representation of market variables while maintaining the noise-reduction benefits of smoothing. This makes it a valuable tool for traders who need to make decisions based on real-time information about volume, volatility, or price changes. Indicator

[GYTS] FiltersToolkit LibraryFiltersToolkit Library
🌸 Part of GoemonYae Trading System (GYTS) 🌸
🌸 --------- 1. INTRODUCTION --------- 🌸
💮 What Does This Library Contain?
This library is a curated collection of high-performance digital signal processing (DSP) filters and auxiliary functions designed specifically for financial time series analysis. It includes a shortlist of our favourite and best performing filters — each rigorously tested and selected for their responsiveness, minimal lag and robustness in diverse market conditions. These tools form an integral part of the GoemonYae Trading System (GYTS), chosen for their unique characteristics in handling market data.
The library contains two main categories:
1. Smoothing filters (low-pass filters and moving averages) for e.g. denoising, trend following
2. Detrending tools (high-pass and band-pass filters, known as "oscillators") for e.g. mean reversion
This collection is finely tuned for practical trading applications and is therefore not meant to be exhaustive. However, will continue to expand as we discover and validate new filtering techniques. I welcome collaboration and suggestions for novel approaches.
🌸 ——— 2. ADDED VALUE ——— 🌸
💮 Unified syntax and comprehensive documentation
The FiltersToolkit Library brings together a wide array of valuable filters under a unified, intuitive syntax. Each function is thoroughly documented, with clear explanations and academic sources that underline the mathematical rigour behind the methods. This level of documentation not only facilitates integration into trading strategies but also helps underlying the underlying concepts and rationale.
💮 Optimised performance and readability
The code prioritizes computational efficiency while maintaining readability. Key optimizations include:
- Minimizing redundant calculations in recursive filters
- Smart coefficient caching
- Efficient state management
- Vectorized operations where applicable
💮 Enhanced functionality and flexibility
Some filters in this library introduce extended functionality beyond the original publications. For instance, the MESA Adaptive Moving Average (MAMA) and Ehlers’ Combined Bandpass Filter incorporate multiple variations found in the literature, thereby providing traders with flexible tools that can be fine-tuned to different market conditions.
🌸 ——— 3. THE FILTERS ——— 🌸
💮 Hilbert Transform Function
This function implements the Hilbert Transform as utilised by John Ehlers. It converts a real-valued time series into its analytic signal, enabling the extraction of instantaneous phase and frequency information—an essential step in adaptive filtering.
Source: John Ehlers - "Rocket Science for Traders" (2001), "TASC 2001 V. 19:9", "Cybernetic Analysis for Stocks and Futures" (2004)
💮 Homodyne Discriminator
By leveraging the Hilbert Transform, this function computes the dominant cycle period through a Homodyne Discriminator. It extracts the in-phase and quadrature components of the signal, facilitating a robust estimation of the underlying cycle characteristics.
Source: John Ehlers - "Rocket Science for Traders" (2001), "TASC 2001 V. 19:9", "Cybernetic Analysis for Stocks and Futures" (2004)
💮 MESA Adaptive Moving Average (MAMA)
An advanced dual-stage adaptive moving average, this function outputs both the MAMA and its companion FAMA. It combines adaptive alpha computation with elements from Kaufman’s Adaptive Moving Average (KAMA) to provide a responsive and reliable trend indicator.
Source: John Ehlers - "Rocket Science for Traders" (2001), "TASC 2001 V. 19:9", "Cybernetic Analysis for Stocks and Futures" (2004)
💮 BiQuad Filters
A family of second-order recursive filters offering exceptional control over frequency response:
- High-pass filter for detrending
- Low-pass filter for smooth trend following
- Band-pass filter for cycle isolation
The quality factor (Q) parameter allows fine-tuning of the resonance characteristics, making these filters highly adaptable to different market conditions.
Source: Robert Bristow-Johnson's Audio EQ Cookbook, implemented by @The_Peaceful_Lizard
💮 Relative Vigor Index (RVI)
This filter evaluates the strength of a trend by comparing the closing price to the trading range. Operating similarly to a band-pass filter, the RVI provides insights into market momentum and potential reversals.
Source: John Ehlers – “Cybernetic Analysis for Stocks and Futures” (2004)
💮 Cyber Cycle
The Cyber Cycle filter emphasises market cycles by smoothing out noise and highlighting the dominant cyclical behaviour. It is particularly useful for detecting trend reversals and cyclical patterns in the price data.
Source: John Ehlers – “Cybernetic Analysis for Stocks and Futures” (2004)
💮 Butterworth High Pass Filter
Inspired by the classical Butterworth design, this filter achieves a maximally flat magnitude response in the passband while effectively removing low-frequency trends. Its design minimises phase distortion, which is vital for accurate signal interpretation.
Source: John Ehlers – “Cybernetic Analysis for Stocks and Futures” (2004)
💮 2-Pole SuperSmoother
Employing a two-pole design, the SuperSmoother filter reduces high-frequency noise with minimal lag. It is engineered to preserve trend integrity while offering a smooth output even in noisy market conditions.
Source: John Ehlers – “Cybernetic Analysis for Stocks and Futures” (2004)
💮 3-Pole SuperSmoother
An extension of the 2-pole design, the 3-pole SuperSmoother further attenuates high-frequency noise. Its additional pole delivers enhanced smoothing at the cost of slightly increased lag.
Source: John Ehlers – “Cybernetic Analysis for Stocks and Futures” (2004)
💮 Adaptive Directional Volatility Moving Average (ADXVma)
This adaptive moving average adjusts its smoothing factor based on directional volatility. By combining true range and directional movement measurements, it remains exceptionally flat during ranging markets and responsive during directional moves.
Source: Various implementations across platforms, unified and optimized
💮 Ehlers Combined Bandpass Filter with Automated Gain Control (AGC)
This sophisticated filter merges a highpass pre-processing stage with a bandpass filter. An integrated Automated Gain Control normalises the output to a consistent range, while offering both regular and truncated recursive formulations to manage lag.
Source: John F. Ehlers – “Truncated Indicators” (2020), “Cycle Analytics for Traders” (2013)
💮 Voss Predictive Filter
A forward-looking filter that predicts future values of a band-limited signal in real time. By utilising multiple time-delayed feedback terms, it provides anticipatory coupling and delivers a short-term predictive signal.
Source: John Ehlers - "A Peek Into The Future" (TASC 2019-08)
💮 Adaptive Autonomous Recursive Moving Average (A2RMA)
This filter dynamically adjusts its smoothing through an adaptive mechanism based on an efficiency ratio and a dynamic threshold. A double application of an adaptive moving average ensures both responsiveness and stability in volatile and ranging markets alike. Very flat response when properly tuned.
Source: @alexgrover (2019)
💮 Ultimate Smoother (2-Pole)
The Ultimate Smoother filter is engineered to achieve near-zero lag in its passband by subtracting a high-pass response from an all-pass response. This creates a filter that maintains signal fidelity at low frequencies while effectively filtering higher frequencies at the expense of slight overshooting.
Source: John Ehlers - TASC 2024-04 "The Ultimate Smoother"
Note: This library is actively maintained and enhanced. Suggestions for additional filters or improvements are welcome through the usual channels. The source code contains a list of tested filters that did not make it into the curated collection. Library

Indicator

Catalyst TrendCatalyst Trend – A Comprehensive Trend and Regime Analyzer
The Catalyst Trend indicator was designed to dynamically and intuitively merge various classic analytical techniques. The goal is to filter out short-term market noise and reveal reliable trend phases or potential turning points. Below is a detailed explanation of its core elements and practical usage.
1. Concept and Idea
Multidimensional Trend Detection
This indicator goes beyond a simple momentum or volatility focus. It factors in multiple measurements to provide a more well-rounded market perspective.
Versatile Indicator Fusion
Linear Regression (LinReg): Multiple LinReg calculations are combined to smooth out price fluctuations and produce a robust trendline—known here as the “Cycle Reduced Line.”
ADX (Average Directional Index): Measures trend strength.
RSI (Relative Strength Index): Flags potential overbought or oversold conditions, in both the current timeframe and a higher timeframe.
ATR (Average True Range): Assesses volatility; used to dynamically adjust calculation lengths.
By weaving these elements together, the indicator adds value beyond simply stacking multiple indicators. It adapts to real-time market conditions, aiming to highlight genuine trends and reduce false signals.
2. Key Functions and Calculations
Dynamic Length & Smoothing
A blend of volatility (ATR), ADX values, and RSI inputs determines how many candles are used in the LinReg calculations and how heavily the data is smoothed.
This allows the indicator to respond promptly during periods of high volatility, while automatically adjusting to filter out unnecessary noise in quieter phases.c
Cycle Reduced Line
The script averages several offset LinReg calculations to produce a cleaner overall signal. Random outliers are thus minimized, making the trend path more visually consistent.
An additional EMA smoothing (“Final Smoothing”) further stabilizes this trendline, reducing the impact of minor price fluctuations.
Channel Bands (Optional)
These bands are derived from the standard deviation of the price residual (the difference between the smoothed price and the trendline).
They highlight potential over-extension zones: the upper band can mark short-term overbought areas, while the lower band might indicate oversold conditions.
Trend and Sideways Determination
Slope Calculation: The slope of the trendline (comparing the current bar to the previous one) helps identify short-term directional shifts.
DX Threshold: Once the ADX surpasses a user-defined threshold and the slope is positive, it may indicate a developing uptrend. Similarly, if the slope is negative and ADX > threshold, it could signal a potential downtrend.
Multi-Level Color Coding
Original Mode: Interpolated colors reflect uptrends, downtrends, and sideways phases, factoring in metrics like ADX and RSI.
Single Color: For a neutral look, the indicator can be displayed in one uniform color.
HTF RSI: This mode uses the higher-timeframe RSI to color the trendline (Long/Short/Neutral), offering a quick gauge of overarching market pressure.
3. Use Cases and Interpretation
Timeframes & Markets
The indicator is versatile and adapts well to different intervals, from 5-minute charts to weekly views.
It can be applied to various markets—crypto, forex, stocks—since volatility and trend strength are universal concepts.
Signal Recognition
Color Swings into a more pronounced upward hue (e.g., green) may signal mounting strength.
Neutral or mixed tones often point to sideways phases, which breakout traders might watch for potential price surges.
A shift to downward colors (e.g., red) may indicate a growing bearish trend.
Channel Bands & Volatility
When the bands spread widely, it’s wise to proceed with caution: abrupt spikes above the upper band or below the lower band can flag rapid short-term extremes.
These bands are more of a reference for potential overextension than a strict buy or sell trigger.
Additional Confirmations
Not a standalone panacea: The Catalyst Trend indicator is an analytical tool, best used alongside other methods such as volume analysis or price action (candlestick patterns, support/resistance levels) to bolster confidence in trading decisions.
4. Practical Tips
Parameter Adjustments
Depending on the market—crypto vs. traditional currency pairs—different ADX, RSI, or smoothing periods may be more effective. Experiment with the settings to tailor the indicator to your preferred timeframe.
Strategic Integration
Trailing Stops: For those riding a trend, the trendline or the channel bands may serve as a reference to trail stop-loss orders.
Trend Confirmation: Using RSI and ADX filters can help traders avoid sideways markets or stay the course when the trend is strong.
5. Important Final Notes
No Guarantee of Profits
No indicator can predict the future. Markets are inherently volatile and often unpredictable.
Responsible Risk Management
Test the indicator in a demo environment or with smaller positions before committing to large trades. Indicator

Hybrid Triple Exponential Smoothing🙏🏻 TV, I present you HTES aka Hybrid Triple Exponential Smoothing, designed by Holt & Winters in the US, assembled by me in Saint P. I apply exponential smoothing individually to the data itself, then to residuals from the fitted values, and lastly to one-point forecast (OPF) errors, hence 'hybrid'. At the same time, the method is a closed-form solution and purely online, no need to make any recalculations & optimize anything, so the method is O(1).
^^ historical OPFs and one-point forecasting interval plotted instead of fitted values and prediction interval
Before the How-to, first let me tell you some non-obvious things about Triple Exponential smoothing (and about Exponential Smoothing in general) that not many catch. Expo smoothing seems very straightforward and obvious, but if you look deeper...
1) The whole point of exponential smoothing is its incremental/online nature, and its O(1) algorithm complexity, making it dope for high-frequency streaming data that is also univariate and has no weights. Consequently:
- Any hybrid models that involve expo smoothing and any type of ML models like gradient boosting applied to residuals rarely make much sense business-wise: if you have resources to boost the residuals, you prolly have resources to use something instead of expo smoothing;
- It also concerns the fashion of using optimizers to pick smoothing parameters; honestly, if you use this approach, you have to retrain on each datapoint, which is crazy in a streaming context. If you're not in a streaming context, why expo smoothing? What makes more sense is either picking smoothing parameters once, guided by exogenous info, or using dynamic ones calculated in a minimalistic and elegant way (more on that in further drops).
2) No matter how 'right' you choose the smoothing parameters, all the resulting components (level, trend, seasonal) are not pure; each of them contains a bit of info from the other components, this is just how non-sequential expo smoothing works. You gotta know this if you wanna use expo smoothing to decompose your time series into separate components. The only pure component there, lol, is the residuals;
3) Given what I've just said, treating the level (that does contain trend and seasonal components partially) as the resulting fit is a mistake. The resulting fit is level (l) + trend (b) + seasonal (s). And from this fit, you calculate residuals;
4) The residuals component is not some kind of bad thing; it is simply the component that contains info you consciously decide not to include in your model for whatever reason;
5) Forecasting Errors and Residuals from fitted values are 2 different things. The former are deltas between the forecasts you've made and actual values you've observed, the latter are simply differences between actual datapoints and in-sample fitted values;
6) Residuals are used for in-sample prediction intervals, errors for out-of-sample forecasting intervals;
7) Choosing between single, double, or triple expo smoothing should not be based exclusively on the nature of your data, but on what you need to do as well. For example:
- If you have trending seasonal data and you wanna do forecasting exclusively within the expo smoothing framework, then yes, you need Triple Exponential Smoothing;
- If you wanna use prediction intervals for generating trend-trading signals and you disregard seasonality, then you need single (simple) expo smoothing, even on trending data. Otherwise, the trend component will be included in your model's fitted values → prediction intervals.
8) Kind of not non-obvious, but when you put one smoothing parameter to zero, you basically disregard this component. E.g., in triple expo smoothing, when you put gamma and beta to zero, you basically end up with single exponential smoothing.
^^ data smoothing, beta and gamma zeroed out, forecasting steps = 0
About the implementation
* I use a simple power transform that results in a log transform with lambda = 0 instead of the mainstream-used transformers (if you put lambda on 2 in Box-Cox, you won't get a power of 2 transform)
* Separate set of smoothing parameters for data, residuals, and errors smoothing
* Separate band multipliers for residuals and errors
* Both typical error and typical residuals get multiplied by math.sqrt(math.pi / 2) in order to approach standard deviation so you can ~use Z values and get more or less corresponding probabilities
* In script settings → style, you can switch on/off plotting of many things that get calculated internally:
- You can visualize separate components (just remember they are not pure);
- You can switch off fit and switch on OPF plotting;
- You can plot residuals and their exponentially smoothed typical value to pick the smoothing parameters for both data and residuals;
- Or you might plot errors and play with data smoothing parameters to minimize them (consult SAE aka Sum of Absolute Errors plot);
^^ nuff said
More ideas on how to use the thing
1) Use Double Exponential Smoothing (data gamma = 0) to detrend your time series for further processing (Fourier likes at least weakly stationary data);
2) Put single expo smoothing on your strategy/subaccount equity chart (data alpha = data beta = 0), set prediction interval deviation multiplier to 1, run your strat live on simulator, start executing on real market when equity on simulator hits upper deviation (prediction interval), stop trading if equity hits lower deviation on simulator. Basically, let the strat always run on simulator, but send real orders to a real market when the strat is successful on your simulator;
3) Set up the model to minimize one-point forecasting errors, put error forecasting steps to 1, now you're doing nowcasting;
4) Forecast noisy trending sine waves for fun.
^^ nuff said 2
All Good TV ∞ Indicator

Normalized Linear Regression (LSMA) OscillatorNormalized Linear Regression (LSMA) Oscillator
By Nathan Farmer
The Normalized LSMA Oscillator is a trend-following indicator that enhances the classic Linear Regression (LSMA) by applying a range of normalization techniques. This indicator allows traders to smooth out and normalize LSMA signals for better trend detection and dynamic market adaptation.
Key Features:
Configurable Normalization Methods:
This indicator offers several normalization techniques, such as Z-Score, Min-Max, Mean Normalization, Robust Scaler, Logistic Function, and Quantile Transformation. Each method helps in refining LSMA outputs to improve clarity in both trending and ranging market conditions.
Smoothing Options:
Smoothing can be applied after normalization, helping to reduce noise in the signals, thus making trend-following strategies that use this indicator more effective.
Recommended Settings:
Logistic Function Normalization: Recommended length of around 12, based on my preferred signal frequency.
Z-Score Normalization: Medium period (close to the default of 50), based on my preferred signal frequency.
Min-Max Normalization: Medium period, based on my preferred signal frequency.
Mean Normalization: Medium period, based on my preferred signal frequency.
Robust Scaler: Medium period, based on my preferred signal frequency.
Quantile Transformation: Medium period, based on my preferred signal frequency.
Usage:
Designed primarily for trend-following strategies, this indicator adapts well to varying market conditions. Traders can experiment with the various normalization and smoothing settings to match the indicator to their specific needs and market preferences.
Recommendation before usage:
Always backtest the indicator for yourself with respect to how you intend to use it. Modify the parameters to suit your needs, over your preferred time frame, on your preferred asset. My preferences are for the assets I happened to be looking at when I made this indicator. Odds are, you're looking at something else, over a different time frame, in a different market environment than what my settings are tailored for.
Indicator

Kalman PSaR [BackQuant]Kalman PSaR
Overview and Innovation
The Kalman PSaR combines the well-known Parabolic SAR (PSaR) with the advanced smoothing capabilities of the Kalman Filter . This innovative tool aims to enhance the traditional PSaR by integrating Kalman filtering, which reduces noise and improves trend detection. The Kalman PSaR adapts dynamically to price movements, making it a highly effective indicator for spotting trend shifts while minimizing the impact of false signals caused by market volatility.
Please Find the Basic Kalman Here:
Kalman Filter Dynamics
The Kalman Filter is a powerful algorithm for estimating the true value of a system amidst noisy data. In the Kalman PSaR, this filter is applied to the high, low, and closing prices, resulting in a smoother and more accurate representation of price action. The filter’s parameters—process noise and measurement noise—are customizable, allowing traders to fine-tune the sensitivity of the indicator to market conditions. By reducing the impact of noise, the Kalman-filtered PSaR offers clearer signals for identifying trend reversals and continuations.
Enhanced PSaR Calculation
The traditional Parabolic SAR is a popular trend-following indicator that highlights potential entry and exit points based on price acceleration. In the Kalman PSaR, this calculation is enhanced by the Kalman-filtered prices, providing a smoother and more reliable signal. The indicator continuously updates based on the acceleration factor and max step values, while the Kalman filter ensures that sudden price spikes or market noise do not trigger false signals.
Min Step and Max Step: These settings control the sensitivity of the PSaR. The Min Step sets the initial acceleration factor, while the Max Step limits how fast the PSaR adapts to price changes, helping traders fine-tune the indicator’s responsiveness.
Optional Smoothing Techniques To further enhance the signal clarity, the Kalman PSaR includes an optional smoothing feature. Traders can choose from various smoothing methods, such as SMA, Hull, EMA, WMA, TEMA, and more, to reduce short-term fluctuations and emphasize the underlying trend. The smoothing period is customizable, allowing traders to adjust the indicator’s behavior according to their preferred trading style and timeframe.
Color-Coded Candle Painting The Kalman PSaR features color-coded candles that change according to the trend direction. When the price is above the PSaR, candles are painted green to indicate a long trend, and when the price is below the PSaR, candles are painted red to signal a short trend. This visual representation makes it easy to interpret market sentiment at a glance, improving decision-making speed during fast-moving markets.
Key Features and Customization
Kalman Filter Customization: The process noise and measurement noise parameters allow traders to adjust how aggressively the filter adapts to price changes, making it suitable for both volatile and stable markets.
Smoothing Options: A variety of moving average types, such as SMA, Hull, EMA, and more, can be applied to smooth the PSaR values, ensuring that the signal remains clear even in choppy markets.
Dynamic Trend Detection: The Kalman PSaR dynamically updates based on price movements, helping traders spot trend reversals early while filtering out false signals caused by short-term volatility.
Bar Coloring and PSaR Plotting: Traders can choose to color candles based on trend direction or plot the PSaR directly on the chart for additional visual clarity.
Practical Applications
Trend-Following Strategies: The Kalman PSaR excels in trend-following strategies by providing timely signals of trend changes. The dynamic nature of the indicator allows traders to capture significant price movements while avoiding market noise.
Reversal Identification: The indicator’s ability to filter out noise and provide smoother signals makes it ideal for identifying reversals in volatile markets.
Risk Management: By plotting clear stop levels based on the PSaR, traders can use this indicator to effectively manage risk, placing stop-loss orders at key points based on the trend direction.
Conclusion
The Kalman PSaR is a fusion of the classic Parabolic SAR and the Kalman filter, offering enhanced trend detection with reduced noise. Its customizable filtering and smoothing options, combined with dynamic trend-following capabilities, make it a versatile tool for traders seeking to improve their timing and signal accuracy. The adaptive nature of the Kalman filter, combined with the robust PSaR logic, helps traders stay on the right side of the market and manage risk more effectively. Indicator

ARIMA Indicator with Optional SmoothingOverview
The ARIMA (AutoRegressive Integrated Moving Average) Indicator is a powerful tool used to forecast future price movements by combining differencing, autoregressive, and moving average components. This indicator is designed to help traders identify trends and potential reversal points by analyzing the historical price data.
Key Features
AutoRegressive Component (AR): Utilizes past values to predict future prices.
Moving Average Component (MA): Averages past price differences to smooth out noise.
Differencing: Reduces non-stationarity in the time series data.
Optional Smoothing: Applies EMA to the ARIMA output for a smoother signal.
Customizable Parameters: Allows users to adjust AR and MA orders, differencing periods, and smoothing lengths.
Concepts Underlying the Calculations
Differencing: Subtracts previous prices from current prices to remove trends and seasonality, making the data stationary.
AutoRegressive Component (AR): Predicts future prices based on a linear combination of past values.
Moving Average Component (MA): Uses past forecast errors to refine future predictions.
Exponential Moving Average (EMA): Applies more weight to recent prices, providing a smoother and more responsive signal.
How It Works
The ARIMA Indicator first calculates the differenced series to achieve stationarity. Then, it computes the simple moving average (SMA) of this differenced series. The indicator uses the AR and MA components to adjust the SMA, creating an approximation of the ARIMA model. Finally, an optional smoothing step using EMA can be applied to the ARIMA approximation to produce a smoother signal.
How Traders Can Use It
Traders can use the ARIMA Indicator to:
Identify Trends: Detect emerging trends by observing the direction of the ARIMA line.
Spot Reversals: Look for divergences between the ARIMA line and the price to identify potential reversal points.
Generate Trading Signals: Use crossovers between the ARIMA line and the price to generate buy or sell signals.
Filter Noise: Enable the optional smoothing to filter out market noise and focus on significant price movements.
Example Usage Instructions
Add the ARIMA Indicator to your chart.
Adjust the input parameters to suit your trading strategy:
Set the SMA Length (e.g., 14).
Choose the Differencing Period (e.g., 1).
Define the AR Order (p) and MA Order (q) (e.g., 1).
Configure the Smoothing Length if smoothing is desired (e.g., 5).
Enable or disable smoothing as needed.
Observe the ARIMA line (blue) and compare it to the price chart.
Use the ARIMA line to identify trends and potential reversals.
Implement trading decisions based on the ARIMA line’s behavior relative to the price.
Indicator

mathLibrary "math"
It's a library of discrete aproximations of a price or Series float it uses Fourier Discrete transform, Laplace Discrete Original and Modified transform and Euler's Theoreum for Homogenus White noice operations. Calling functions without source value it automatically take close as the default source value.
Here is a picture of Laplace and Fourier approximated close prices from this library:
Copy this indicator and try it yourself:
import AutomatedTradingAlgorithms/math/1 as math
//@version=5
indicator("Close Price with Aproximations", shorttitle="Close and Aproximations", overlay=false)
// Sample input data (replace this with your own data)
inputData = close
// Plot Close Price
plot(inputData, color=color.blue, title="Close Price")
ltf32_result = math.LTF32(a=0.01)
plot(ltf32_result, color=color.green, title="LTF32 Aproximation")
fft_result = math.FFT()
plot(fft_result, color=color.red, title="Fourier Aproximation")
wavelet_result = math.Wavelet()
plot(wavelet_result, color=color.orange, title="Wavelet Aproximation")
wavelet_std_result = math.Wavelet_std()
plot(wavelet_std_result, color=color.yellow, title="Wavelet_std Aproximation")
DFT3(xval, _dir)
Discrete Fourier Transform with last 3 points
Parameters:
xval (float) : Source series
_dir (int) : Direction parameter
Returns: Aproxiated source value
DFT2(xval, _dir)
Discrete Fourier Transform with last 2 points
Parameters:
xval (float) : Source series
_dir (int) : Direction parameter
Returns: Aproxiated source value
FFT(xval)
Fast Fourier Transform once. It aproximates usig last 3 points.
Parameters:
xval (float) : Source series
Returns: Aproxiated source value
DFT32(xval)
Combined Discrete Fourier Transforms of DFT3 and DTF2 it aproximates last point by first
aproximating last 3 ponts and than using last 2 points of the previus.
Parameters:
xval (float) : Source series
Returns: Aproxiated source value
DTF32(xval)
Combined Discrete Fourier Transforms of DFT3 and DTF2 it aproximates last point by first
aproximating last 3 ponts and than using last 2 points of the previus.
Parameters:
xval (float) : Source series
Returns: Aproxiated source value
LFT3(xval, _dir, a)
Discrete Laplace Transform with last 3 points
Parameters:
xval (float) : Source series
_dir (int) : Direction parameter
a (float) : laplace coeficient
Returns: Aproxiated source value
LFT2(xval, _dir, a)
Discrete Laplace Transform with last 2 points
Parameters:
xval (float) : Source series
_dir (int) : Direction parameter
a (float) : laplace coeficient
Returns: Aproxiated source value
LFT(xval, a)
Fast Laplace Transform once. It aproximates usig last 3 points.
Parameters:
xval (float) : Source series
a (float) : laplace coeficient
Returns: Aproxiated source value
LFT32(xval, a)
Combined Discrete Laplace Transforms of LFT3 and LTF2 it aproximates last point by first
aproximating last 3 ponts and than using last 2 points of the previus.
Parameters:
xval (float) : Source series
a (float) : laplace coeficient
Returns: Aproxiated source value
LTF32(xval, a)
Combined Discrete Laplace Transforms of LFT3 and LTF2 it aproximates last point by first
aproximating last 3 ponts and than using last 2 points of the previus.
Parameters:
xval (float) : Source series
a (float) : laplace coeficient
Returns: Aproxiated source value
whitenoise(indic_, _devided, minEmaLength, maxEmaLength, src)
Ehler's Universal Oscillator with White Noise, without extra aproximated src.
It uses dinamic EMA to aproximate indicator and thus reducing noise.
Parameters:
indic_ (float) : Input series for the indicator values to be smoothed
_devided (int) : Divisor for oscillator calculations
minEmaLength (int) : Minimum EMA length
maxEmaLength (int) : Maximum EMA length
src (float) : Source series
Returns: Smoothed indicator value
whitenoise(indic_, dft1, _devided, minEmaLength, maxEmaLength, src)
Ehler's Universal Oscillator with White Noise and DFT1.
It uses src and sproxiated src (dft1) to clearly define white noice.
It uses dinamic EMA to aproximate indicator and thus reducing noise.
Parameters:
indic_ (float) : Input series for the indicator values to be smoothed
dft1 (float) : Aproximated src value for white noice calculation
_devided (int) : Divisor for oscillator calculations
minEmaLength (int) : Minimum EMA length
maxEmaLength (int) : Maximum EMA length
src (float) : Source series
Returns: Smoothed indicator value
smooth(dft1, indic__, _devided, minEmaLength, maxEmaLength, src)
Smoothing source value with help of indicator series and aproximated source value
It uses src and sproxiated src (dft1) to clearly define white noice.
It uses dinamic EMA to aproximate src and thus reducing noise.
Parameters:
dft1 (float) : Value to be smoothed.
indic__ (float) : Optional input for indicator to help smooth dft1 (default is FFT)
_devided (int) : Divisor for smoothing calculations
minEmaLength (int) : Minimum EMA length
maxEmaLength (int) : Maximum EMA length
src (float) : Source series
Returns: Smoothed source (src) series
smooth(indic__, _devided, minEmaLength, maxEmaLength, src)
Smoothing source value with help of indicator series
It uses dinamic EMA to aproximate src and thus reducing noise.
Parameters:
indic__ (float) : Optional input for indicator to help smooth dft1 (default is FFT)
_devided (int) : Divisor for smoothing calculations
minEmaLength (int) : Minimum EMA length
maxEmaLength (int) : Maximum EMA length
src (float) : Source series
Returns: Smoothed src series
vzo_ema(src, len)
Volume Zone Oscillator with EMA smoothing
Parameters:
src (float) : Source series
len (simple int) : Length parameter for EMA
Returns: VZO value
vzo_sma(src, len)
Volume Zone Oscillator with SMA smoothing
Parameters:
src (float) : Source series
len (int) : Length parameter for SMA
Returns: VZO value
vzo_wma(src, len)
Volume Zone Oscillator with WMA smoothing
Parameters:
src (float) : Source series
len (int) : Length parameter for WMA
Returns: VZO value
alma2(series, windowsize, offset, sigma)
Arnaud Legoux Moving Average 2 accepts sigma as series float
Parameters:
series (float) : Input series
windowsize (int) : Size of the moving average window
offset (float) : Offset parameter
sigma (float) : Sigma parameter
Returns: ALMA value
Wavelet(src, len, offset, sigma)
Aproxiates srt using Discrete wavelet transform.
Parameters:
src (float) : Source series
len (int) : Length parameter for ALMA
offset (simple float)
sigma (simple float)
Returns: Wavelet-transformed series
Wavelet_std(src, len, offset, mag)
Aproxiates srt using Discrete wavelet transform with standard deviation as a magnitude.
Parameters:
src (float) : Source series
len (int) : Length parameter for ALMA
offset (float) : Offset parameter for ALMA
mag (int) : Magnitude parameter for standard deviation
Returns: Wavelet-transformed series
LaplaceTransform(xval, N, a)
Original Laplace Transform over N set of close prices
Parameters:
xval (float) : series to aproximate
N (int) : number of close prices in calculations
a (float) : laplace coeficient
Returns: Aproxiated source value
NLaplaceTransform(xval, N, a, repeat)
Y repetirions on Original Laplace Transform over N set of close prices, each time N-k set of close prices
Parameters:
xval (float) : series to aproximate
N (int) : number of close prices in calculations
a (float) : laplace coeficient
repeat (int) : number of repetitions
Returns: Aproxiated source value
LaplaceTransformsum(xval, N, a, b)
Sum of 2 exponent coeficient of Laplace Transform over N set of close prices
Parameters:
xval (float) : series to aproximate
N (int) : number of close prices in calculations
a (float) : laplace coeficient
b (float) : second laplace coeficient
Returns: Aproxiated source value
NLaplaceTransformdiff(xval, N, a, b, repeat)
Difference of 2 exponent coeficient of Laplace Transform over N set of close prices
Parameters:
xval (float) : series to aproximate
N (int) : number of close prices in calculations
a (float) : laplace coeficient
b (float) : second laplace coeficient
repeat (int) : number of repetitions
Returns: Aproxiated source value
N_divLaplaceTransformdiff(xval, N, a, b, repeat)
N repetitions of Difference of 2 exponent coeficient of Laplace Transform over N set of close prices, with dynamic rotation
Parameters:
xval (float) : series to aproximate
N (int) : number of close prices in calculations
a (float) : laplace coeficient
b (float) : second laplace coeficient
repeat (int) : number of repetitions
Returns: Aproxiated source value
LaplaceTransformdiff(xval, N, a, b)
Difference of 2 exponent coeficient of Laplace Transform over N set of close prices
Parameters:
xval (float) : series to aproximate
N (int) : number of close prices in calculations
a (float) : laplace coeficient
b (float) : second laplace coeficient
Returns: Aproxiated source value
NLaplaceTransformdiffFrom2(xval, N, a, b, repeat)
N repetitions of Difference of 2 exponent coeficient of Laplace Transform over N set of close prices, second element has for 1 higher exponent factor
Parameters:
xval (float) : series to aproximate
N (int) : number of close prices in calculations
a (float) : laplace coeficient
b (float) : second laplace coeficient
repeat (int) : number of repetitions
Returns: Aproxiated source value
N_divLaplaceTransformdiffFrom2(xval, N, a, b, repeat)
N repetitions of Difference of 2 exponent coeficient of Laplace Transform over N set of close prices, second element has for 1 higher exponent factor, dynamic rotation
Parameters:
xval (float) : series to aproximate
N (int) : number of close prices in calculations
a (float) : laplace coeficient
b (float) : second laplace coeficient
repeat (int) : number of repetitions
Returns: Aproxiated source value
LaplaceTransformdiffFrom2(xval, N, a, b)
Difference of 2 exponent coeficient of Laplace Transform over N set of close prices, second element has for 1 higher exponent factor
Parameters:
xval (float) : series to aproximate
N (int) : number of close prices in calculations
a (float) : laplace coeficient
b (float) : second laplace coeficient
Returns: Aproxiated source value Library
