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

Isotropic Coordinate System (ICS)Library "ICS"
Isotropic Coordinate System (ICS): a dimensionless price-time space
for scale-invariant chart geometry.
Vertical axis: y = ln(price) / sigma, where sigma is the Yang-Zhang (2000)
minimum-variance, drift-independent, gap-consistent OHLC volatility estimator.
Horizontal axis: two scalings via the XScale enum.
legacy : x = bars / lookback. Linear window fraction. Backward compatible.
isotropic : x = sqrt(bars / lookback), with y additionally divided by
sqrt(lookback). Diffusion-consistent (sqrt-time scaling), so that
tan(theta) equals the z-score of the move and 45 degrees
corresponds to a move of exactly one standard deviation
of the n-bar log-return distribution. Assumes approximately
iid returns within the sigma window (the standard assumption
behind sqrt-time scaling; see Danielsson & Zigrand, 2006, for
its known limits under vol clustering and jumps).
Every output (angle, length, area, centroid) is a pure dimensionless number,
comparable across symbols, currencies, and timeframes.
Reference: Yang, D. & Zhang, Q. (2000), "Drift-Independent Volatility
Estimation Based on High, Low, Open, and Close Prices",
The Journal of Business, 73(3), 477-492.
yangZhangSigma(length)
Yang-Zhang volatility estimator. Minimum-variance, unbiased,
drift-independent, and consistent with opening gaps
(Yang & Zhang, 2000). Uses the unbiased sample variance
(biased = false) for both the overnight and open-to-close
components, matching the estimator's unbiasedness claim.
Parameters:
length (simple int) : (simple int) Rolling window length. Must be >= 2.
Returns: (series float) Per-bar sigma, floored at 1e-10.
toX(bars, lookback, mode)
Dimensionless horizontal coordinate.
Parameters:
bars (int) : (series int) Signed bar distance from the anchor.
lookback (int) : (series int) Window length acting as the horizontal unit.
mode (series XScale) : (series XScale) Scaling mode.
Returns: (series float) Signed dimensionless x.
toY(price, sigma, lookback, mode)
Dimensionless vertical coordinate.
Parameters:
price (float) : (series float) Price. Must be > 0.
sigma (float) : (series float) Yang-Zhang sigma. Must be > 1e-10.
lookback (int) : (series int) Window length (used by isotropic mode only).
mode (series XScale) : (series XScale) Scaling mode.
Returns: (series float) Dimensionless y, or na when inputs are invalid.
moveZScore(dLogPrice, sigma, bars)
Z-score of a log-price move over n bars: dLog / (sigma * sqrt(n)).
In isotropic mode this equals tan(theta) of the same move.
Parameters:
dLogPrice (float) : (series float) ln(target) - ln(anchor).
sigma (float) : (series float) Per-bar Yang-Zhang sigma. Must be > 1e-10.
bars (int) : (series int) Number of bars in the move. Must be > 0.
Returns: (series float) The z-score, or na when inputs are invalid.
triangle(td, anchorPrice, anchorBar, targetPrice, targetBar, sig, lookback, mode)
Right triangle between an anchor and a target, computed entirely
in ICS space. Writes results in place into `td` and returns it.
On invalid inputs every field is set to na, so world X never
receives contaminated numbers.
Parameters:
td (TriangleData) : (TriangleData) Output object, updated in place.
anchorPrice (float) : (series float) Anchor price (world A). Must be > 0.
anchorBar (int) : (series int) Anchor bar_index.
targetPrice (float) : (series float) Target price (world A). Must be > 0.
targetBar (int) : (series int) Target bar_index. Must differ from anchorBar.
sig (float) : (series float) Yang-Zhang sigma. Must be > 1e-10.
lookback (int) : (series int) Horizontal unit window.
mode (series XScale) : (series XScale) Scaling mode.
Returns: (TriangleData) The same `td`, for chaining.
pinTriangle(td, anchorPrice, anchorBar, extremePrice, bodyPrice, curBar, sig, lookback, mode)
Pin (wick) triangle with three vertices in ICS space:
A = anchor, B = candle extreme, C = candle body edge.
Side BC is the wick. theta = signed angle at A between AB and AC.
Since xB = xC, the shoelace area reduces exactly to
0.5 * |yB - yC| * |dx|.
Parameters:
td (TriangleData) : (TriangleData) Output object, updated in place.
anchorPrice (float) : (series float) Anchor price (hh or ll). Must be > 0.
anchorBar (int) : (series int) Anchor bar_index.
extremePrice (float) : (series float) Candle extreme (high or low). Must be > 0.
bodyPrice (float) : (series float) Candle body edge. Must be > 0.
curBar (int) : (series int) Current bar_index. Must differ from anchorBar.
sig (float) : (series float) Yang-Zhang sigma. Must be > 1e-10.
lookback (int) : (series int) Horizontal unit window.
mode (series XScale) : (series XScale) Scaling mode.
Returns: (TriangleData) The same `td`, for chaining.
zeroTri(td)
Resets a TriangleData to na. Use when the structure is inactive,
so inactive periods never enter moving averages or normalization
as fake zero values.
Parameters:
td (TriangleData) : (TriangleData) Object to reset, updated in place.
Returns: (TriangleData) The same `td`, for chaining.
TriangleData
One triangle's measurements in ICS space. All fields dimensionless.
Fields:
theta (series float) : Signed hypotenuse angle in degrees; in isotropic mode tan(theta) is the z-score of the move.
dy (series float) : Signed Euclidean magnitude of the hypotenuse.
area (series float) : Triangle area (>= 0).
centroidY (series float) : Vertical centroid of the triangle.
FrozenAnchors
Anchors frozen at a reference bar, plus activity state.
Fields:
hh (series float) : Highest high at the freeze bar (world-A price units).
ll (series float) : Lowest low at the freeze bar (world-A price units).
mid (series float) : Geometric mean sqrt(hh * ll) at the freeze bar.
bar_x (series int) : bar_index of the freeze bar.
time_x (series int) : time of the freeze bar.
is_active (series bool) : Whether the frozen structure is currently active. Library

Normalized Candles RSI [Jamallo]🔹 Intro
The Normalized Candles RSI is a quantitative momentum and volatility indicator designed to transform raw, trending price action into a stationary 0-100 oscillator. By passing price data through a Fractional Differencing engine and a dynamic Z-Score normalization layer, it strips away market drift and presents pure, bounded candlestick momentum. This stationary price structure is then directly overlaid with a traditional RSI and Divergence engine for highly confluent signals.
🔹 Break down
Fractional Differencing (FFD): Transforms non-stationary price data into a stationary series while retaining deep historical memory (controlled by the "d" parameter). This prevents the data loss associated with standard period-to-period differencing.
Normalization Engine: Applies a rolling Z-Score to the differenced data, which is then passed through a Sigmoid compression function. This mathematically forces the resulting candlesticks into a strict 0-100 range without repainting.
RSI & Divergence Engine: Overlays a classic RSI with optional smoothing moving averages and Bollinger Bands. Built-in regular bullish and bearish divergence detection algorithms automatically scan for momentum exhaustion relative to the price.
🔹 Visual Guide: Indicator Anatomy
The true power of this indicator lies in its visual mapping. As shown in the snapshot, the indicator pane perfectly merges the structure of raw price action directly with a classic RSI oscillator.
1:1 Structural Mapping: Notice how the normalized candles in the middle pane mirror the raw price action in the main chart exactly (highlighted by the "1:1 with overlay candle sticks" annotation). You get the exact same highs, lows, and structural candlestick patterns, but stripped of drift and mathematically squashed into a stationary box.
Normalized Candles + Standard RSI: If you look at a standard RSI (bottom pane), you only see a floating line. By overlaying the normalized candles (middle pane), you can see exactly how the physical candlestick bodies and wicks behave relative to the RSI's 0-100 bounds and its smoothing moving average (the yellow line).
Actionable Context: When a localized top or bottom forms, you aren't just guessing based on a purple line peaking. You can see the actual candlestick structure exhausting itself, forming wicks and reversal patterns right against the upper (70+) or lower (30-) overextended boundaries.
🔹 Settings Parameters
- Diff Order (d) (0.01 - 0.99): The fractional differencing order. Higher values make the series more stationary but remove more historical memory.
- Z-Score Lookback: The rolling window used to calculate the mean and standard deviation for the 0-100 normalization engine.
- Sigmoid Compression Scale: Controls the elasticity of the 0-100 bounds. A higher value results in softer compression at the extremes, while a lower value makes it compress faster.
- RSI Settings & Smoothing: Standard parameters for the RSI length, smoothing moving averages (SMA, EMA, VWMA, etc.), Bollinger Bands, and the divergence lookback constraints.
🔹 Credits & Acknowledgements
The core RSI and Divergence engine utilized in this script is adapted from PulseWire's built-in Relative Strength Index indicator code. Indicator

Liquidity ThermometerThis is a universal indicator that assesses market liquidity based on five key market parameters: volume, volatility, candlestick range, body size, and price momentum.
The indicator does not use open interest data and is suitable for all markets, including spot, futures, and Forex.
This indicator normalizes each metric historically and creates a composite index between 0 and 1, where higher values correspond to a stable and calm market environment, and lower values indicate periods of increased risk and potential liquidity stress.
LT generates an integral liquidity index in the range based on five normalized components:
-nVol — normalized volume, reflecting trading density and activity.
-nATR — the volatility component (ATR), inverted, as high volatility is typically associated with declining liquidity.
-nRange — the normalized candlestick range, also inverted to assess the structural narrowness of the price movement.
-nBody — the normalized candlestick body size (|close − open|), inverted to assess the balance of supply and demand.
-nMove — the normalized value of the price impulse movement (|Δclose|), reflecting short-term price spikes.
Each metric is linearly normalized over a sliding window (200 bars) using the formula:
norm(x) = (x − min) / (max − min),
where at max = min, the value is fixed at 0.5 to ensure stability.
The ALT index is calculated as a weighted combination:
ALT = 0.35 nVol + 0.20 (1 − nATR) + 0.20 (1 − nRange) + 0.15 (1 − nBody) + 0.10 (1 − nMove)
The result is further smoothed using EMA(3) to reduce micronoise.
Red Zone (MLI < 0.25) — Risk, Thin Liquidity
When the indicator falls into the red zone, it means the market is extremely volatile:
Characteristics:
Low volume — small trades have a strong impact on the price.
High volatility — candlesticks rise or fall sharply.
Wide candlestick range — the market is "breathing heavily," easily breaking price extremes.
Impulsive movements — small market shocks lead to sharp spikes.
Thin liquidity — few orders in the order book, large orders "eat up" the market.
What this means for a trader:
🔥 High risk of spikes and false breakouts.
⚠ Possible series of liquidations on leverage.
❌ It is not recommended to enter long or short positions without a filter or protection.
✅ Can be used for short scalping strategies if you know the entry point, but very carefully.
Green Zone (MLI > 0.75) — High Liquidity, Safe Zone
When the indicator rises into the green zone, it means the market is stable and balanced:
Characteristics:
High volume — the market is deep, orders are executed without a strong impact on the price.
Low volatility — candlesticks are stable, no sharp spikes.
Narrow candlestick range — price moves calmly.
Weak impulse movements — no sharp surges.
Sufficient liquidity — the market can handle large orders.
What this means for a trader:
✅ Safe zone for opening positions.
🔄 Easier to set stop-loss and take-profit orders.
💡 You can trade both up and down, the risk of sharp movements is minimal.
⚡ Under these conditions, there is a lower risk of spikes and accidental liquidations.
It does not predict price movements or guarantee results. It is an analytical tool intended for additional research into market structure.
Indicator

Advanced Speedometer Gauge [PhenLabs]Advanced Speedometer Gauge
Version: PineScript™v6
📌 Description
The Advanced Speedometer Gauge is a revolutionary multi-metric visualization tool that consolidates 13 distinct trading indicators into a single, intuitive speedometer display. Instead of cluttering your workspace with multiple oscillators and panels, this gauge provides a unified interface where you can switch between different metrics while maintaining consistent visual interpretation.
Built on PineScript™ v6, the indicator transforms complex technical calculations into an easy-to-read semi-circular gauge with color-coded zones and a precision needle indicator. Each of the 13 available metrics has been carefully normalized to a 0-100 scale, ensuring that whether you’re analyzing RSI, volume trends, or volatility extremes, the visual interpretation remains consistent and intuitive.
The gauge is designed for traders who value efficiency and clarity. By consolidating multiple analytical perspectives into one compact display, you can quickly assess market conditions without the visual noise of traditional multi-indicator setups. All metrics are non-overlapping, meaning each provides unique insights into different aspects of market behavior.
🚀 Points of Innovation
13 selectable metrics covering momentum, volume, volatility, trend, and statistical analysis, all accessible through a single dropdown menu
Universal 0-100 normalization system that standardizes different indicator scales for consistent visual interpretation across all metrics
Semi-circular gauge design with 21 arc segments providing smooth precision and clear visual feedback through color-coded zones
Non-redundant metric selection ensuring each indicator provides unique market insights without analytical overlap
Advanced metrics including MFI (volume-weighted momentum), CCI (statistical deviation), Volatility Rank (extended lookback), Trend Strength (ADX-style), Choppiness Index, Volume Trend, and Price Distance from MA
Flexible positioning system with 5 chart locations, 3 size options, and fully customizable color schemes for optimal workspace integration
🔧 Core Components
Metric Selection Engine: Dropdown interface allowing instant switching between 13 different technical indicators, each with independent parameter controls
Normalization System: All metrics converted to 0-100 scale using indicator-specific algorithms that preserve the statistical significance of each measurement
Semi-Circular Gauge: Visual display using 21 arc segments arranged in curved formation with two-row thickness for enhanced visibility
Color Zone System: Three distinct zones (0-40 green, 40-70 yellow, 70-100 red) providing instant visual feedback on metric extremes
Needle Indicator: Dynamic pointer that positions across the gauge arc based on precise current metric value
Table Implementation: Professional table structure ensuring consistent positioning and rendering across different chart configurations
🔥 Key Features
RSI (Relative Strength Index): Classic momentum oscillator measuring overbought/oversold conditions with adjustable period length (default 14)
Stochastic Oscillator: Compares closing price to price range over specified period with smoothing, ideal for identifying momentum shifts
MFI (Money Flow Index): Volume-weighted RSI that combines price movement with volume to measure buying and selling pressure intensity
CCI (Commodity Channel Index): Measures statistical deviation from average price, normalized from typical -200 to +200 range to 0-100 scale
Williams %R: Alternative overbought/oversold indicator using high-low range analysis, inverted to match 0-100 scale conventions
Volume %: Current volume relative to moving average expressed as percentage, capped at 100 for extreme spikes
Volume Trend: Cumulative directional volume flow showing whether volume is flowing into up moves or down moves over specified period
ATR Percentile: Current Average True Range position within historical range using specified lookback period (default 100 bars)
Volatility Rank: Close-to-close volatility measured against extended historical range (default 252 days), differs from ATR in calculation method
Momentum: Rate of change calculation showing price movement speed, centered at 50 and normalized to 0-100 range
Trend Strength: ADX-style calculation using directional movement to quantify trend intensity regardless of direction
Choppiness Index: Measures market choppiness versus trending behavior, where high values indicate ranging markets and low values indicate strong trends
Price Distance from MA: Measures current price over-extension from moving average using standard deviation calculations
🎨 Visualization
Semi-Circular Arc Display: Curved gauge spanning from 0 (left) to 100 (right) with smooth progression and two-row thickness for visibility
Color-Coded Zones: Green zone (0-40) for low/oversold conditions, yellow zone (40-70) for neutral readings, red zone (70-100) for high/overbought conditions
Needle Indicator: Downward-pointing triangle (▼) positioned precisely at current metric value along the gauge arc
Scale Markers: Vertical line markers at 0, 25, 50, 75, and 100 positions with corresponding numerical labels below
Title Display: Merged cell showing “𓄀 PhenLabs” branding plus currently selected metric name in monospace font
Large Value Display: Current metric value shown with two decimal precision in large text directly below title
Table Structure: Professional table with customizable background color, text color, and transparency for minimal chart obstruction
📖 Usage Guidelines
Metric Selection
Select Metric: Default: RSI | Options: RSI, Stochastic, Volume %, ATR Percentile, Momentum, MFI (Money Flow), CCI (Commodity Channel), Williams %R, Volatility Rank, Trend Strength, Choppiness Index, Volume Trend, Price Distance | Choose the technical indicator you want to display on the gauge based on your current analytical needs
RSI Settings
RSI Length: Default: 14 | Range: 1+ | Controls the lookback period for RSI calculation, shorter periods increase sensitivity to recent price changes
Stochastic Settings
Stochastic Length: Default: 14 | Range: 1+ | Lookback period for stochastic calculation comparing close to high-low range
Stochastic Smooth: Default: 3 | Range: 1+ | Smoothing period applied to raw stochastic value to reduce noise and false signals
Volume Settings
Volume MA Length: Default: 20 | Range: 1+ | Moving average period used to calculate average volume for comparison with current volume
Volume Trend Length: Default: 20 | Range: 5+ | Period for calculating cumulative directional volume flow trend
ATR and Volatility Settings
ATR Length: Default: 14 | Range: 1+ | Period for Average True Range calculation used in ATR Percentile metric
ATR Percentile Lookback: Default: 100 | Range: 20+ | Historical range used to determine current ATR position as percentile
Volatility Rank Lookback (Days): Default: 252 | Range: 50+ | Extended lookback period for Volatility Rank metric using close-to-close volatility
Momentum and Trend Settings
Momentum Length: Default: 10 | Range: 1+ | Lookback period for rate of change calculation in Momentum metric
Trend Strength Length: Default: 20 | Range: 5+ | Period for directional movement calculations in ADX-style Trend Strength metric
Advanced Metric Settings
MFI Length: Default: 14 | Range: 1+ | Lookback period for Money Flow Index calculation combining price and volume
CCI Length: Default: 20 | Range: 1+ | Period for Commodity Channel Index statistical deviation calculation
Williams %R Length: Default: 14 | Range: 1+ | Lookback period for Williams %R high-low range analysis
Choppiness Index Length: Default: 14 | Range: 5+ | Period for calculating market choppiness versus trending behavior
Price Distance MA Length: Default: 50 | Range: 10+ | Moving average period used for Price Distance standard deviation calculation
Visual Customization
Position: Default: Top Right | Options: Top Left, Top Right, Bottom Left, Bottom Right, Middle Right | Controls gauge placement on chart for optimal workspace organization
Size: Default: Normal | Options: Small, Normal, Large | Adjusts overall gauge dimensions and text size for different monitor resolutions and preferences
Low Zone Color (0-40): Default: Green (#00FF00) | Customize color for low/oversold zone of gauge arc
Medium Zone Color (40-70): Default: Yellow (#FFFF00) | Customize color for neutral/medium zone of gauge arc
High Zone Color (70-100): Default: Red (#FF0000) | Customize color for high/overbought zone of gauge arc
Background Color: Default: Semi-transparent dark gray | Customize gauge background for contrast and chart integration
Text Color: Default: White (#FFFFFF) | Customize all text elements including title, value, and scale labels
✅ Best Use Cases
Quick visual assessment of market conditions when you need instant feedback on whether an asset is in extreme territory across multiple analytical dimensions
Workspace organization for traders who monitor multiple indicators but want to reduce chart clutter and visual complexity
Metric comparison by switching between different indicators while maintaining consistent visual interpretation through the 0-100 normalization
Overbought/oversold identification using RSI, Stochastic, Williams %R, or MFI depending on whether you prefer price-only or volume-weighted analysis
Volume analysis through Volume %, Volume Trend, or MFI to confirm price movements with corresponding volume characteristics
Volatility monitoring using ATR Percentile or Volatility Rank to identify expansion/contraction cycles and adjust position sizing
Trend vs range identification by comparing Trend Strength (high values = trending) against Choppiness Index (high values = ranging)
Statistical over-extension detection using CCI or Price Distance to identify when price has deviated significantly from normal behavior
Multi-timeframe analysis by duplicating the gauge on different timeframe charts to compare metric readings across time horizons
Educational purposes for new traders learning to interpret technical indicators through consistent visual representation
⚠️ Limitations
The gauge displays only one metric at a time, requiring manual switching to compare different indicators rather than simultaneous multi-metric viewing
The 0-100 normalization, while providing consistency, may obscure the raw values and specific nuances of each underlying indicator
Table-based visualization cannot be exported or saved as an image separately from the full chart screenshot
Optimal parameter settings vary by asset type, timeframe, and market conditions, requiring user experimentation for best results
💡 What Makes This Unique
Unified Multi-Metric Interface: The only gauge-style indicator offering 13 distinct metrics through a single interface, eliminating the need for multiple oscillator panels
Non-Overlapping Analytics: Each metric provides genuinely unique insights—MFI combines volume with price, CCI measures statistical deviation, Volatility Rank uses extended lookback, Trend Strength quantifies directional movement, and Choppiness Index measures ranging behavior
Universal Normalization System: All metrics standardized to 0-100 scale using indicator-appropriate algorithms that preserve statistical meaning while enabling consistent visual interpretation
Professional Visual Design: Semi-circular gauge with 21 arc segments, precision needle positioning, color-coded zones, and clean table implementation that maintains clarity across all chart configurations
Extensive Customization: Independent parameter controls for each metric, five position options, three size presets, and full color customization for seamless workspace integration
🔬 How It Works
1. Metric Calculation Phase:
All 13 metrics are calculated simultaneously on every bar using their respective algorithms with user-defined parameters
Each metric applies its own specific calculation method—RSI uses average gains vs losses, Stochastic compares close to high-low range, MFI incorporates typical price and volume, CCI measures deviation from statistical mean, ATR calculates true range, directional indicators measure up/down movement, and statistical metrics analyze price relationships
2. Normalization Process:
Each calculated metric is converted to a standardized 0-100 scale using indicator-appropriate transformations
Some metrics are naturally 0-100 (RSI, Stochastic, MFI, Williams %R), while others require scaling—CCI transforms from ±200 range, Momentum centers around 50, Volume ratio caps at 2x for 100, ATR and Volatility Rank calculate percentile positions, and Price Distance scales by standard deviations
3. Gauge Rendering:
The selected metric’s normalized value determines the needle position across 21 arc segments spanning 0-100
Each arc segment receives its color based on position—segments 0-8 are green zone, segments 9-14 are yellow zone, segments 15-20 are red zone
The needle indicator (▼) appears in row 5 at the column corresponding to the current metric value, providing precise visual feedback
4. Table Construction:
The gauge uses PulseWire’s table system with merged cells for title and value display, ensuring consistent positioning regardless of chart configuration
Rows are allocated as follows: Row 0 merged for title, Row 1 merged for large value display, Row 2 for spacing, Rows 3-4 for the semi-circular arc with curved shaping, Row 5 for needle indicator, Row 6 for scale markers, Row 7 for numerical labels at 0/25/50/75/100
All visual elements update on every bar when barstate.islast is true, ensuring real-time accuracy without performance impact
💡 Note:
This indicator is designed for visual analysis and market condition assessment, not as a standalone trading system. For best results, combine gauge readings with price action analysis, support and resistance levels, and broader market context. Parameter optimization is recommended based on your specific trading timeframe and asset class. The gauge works on all timeframes but may require different parameter settings for intraday versus daily/weekly analysis. Consider using multiple instances of the gauge set to different metrics for comprehensive market analysis without switching between settings. Indicator

Indicator

Normalized Portfolio TrackerThis script lets you create, visualize, and track a custom portfolio of up to 15 assets directly on PulseWire.
It calculates a synthetic "portfolio index" by combining multiple tickers with user-defined weights, automatically normalizing them so the total allocation always equals 100%.
All assets are scaled to a common starting point, allowing you to compare your portfolio’s performance versus any benchmark like SPY, QQQ, or BTC.
🚀 Goal
This script helps traders and investors:
• Understand the combined performance of their portfolio.
• Normalize diverse assets into a single synthetic chart .
• Make portfolio-level insights without relying on external spreadsheets.
🎯 Use Cases
• Backtest your portfolio allocations directly on the chart.
• Compare your portfolio vs. benchmarks like SPY, QQQ, BTC.
• Track thematic baskets (commodities, EV supply chain, regional ETFs).
• Visualize how each component contributes to overall performance.
📊 Features
• Weighted Portfolio Performance : Combines selected assets into a synthetic value series.
• Base Price Alignment : Each asset is normalized to its starting price at the chosen date.
• Dynamic Portfolio Table : Displays symbols, normalized weights (%), equivalent shares (based on each asset’s start price, sums to 100 shares), and a total row that always sums to 100%.
• Multi-Asset Support : Works with stocks, ETFs, indices, crypto, or any PulseWire-compatible symbol.
⚙️ Configuration
Flexible Portfolio Setup
• Add up to 15 assets with custom weight inputs.
• You can enter any arbitrary numbers (e.g. 30, 15, 55).
• The script automatically normalizes all weights so the total allocation always equals 100%.
Start Date Selection
• Choose any custom start date to normalize all assets.
• The portfolio value is then scaled relative to the main chart symbol, so you can directly compare portfolio performance against benchmarks like SPY or QQQ.
Chart Styles
• Candlestick chart
• Heikin Ashi chart
• Line chart
Custom Display
• Adjustable colors and line widths
• Optionally display asset list, normalized weights, and equivalent shares
⚙️ How It Works
• Fetch OHLC data for each asset.
• Normalizes weights internally so totals = 100%.
• Stores each asset’s base price at the selected start date.
• Calculates equivalent “shares” for each allocation.
• Builds a synthetic portfolio value series by summing weighted contributions.
• Renders as Candlestick, Heikin Ashi, or Line chart.
• Adds a portfolio info table for clarity.
⚠️ Notes
• This script is for visualization only . It does not place trades or auto-rebalance.
• Weight inputs are automatically normalized, so you don’t need to enter exact percentages.
Indicator

ATR% | Volatility NormalizerThis indicator measures true volatility by expressing the Average True Range (ATR) as a percentage of price. Unlike basic ATR plots, which show raw values, this version normalizes volatility to make it directly comparable across instruments and timeframes.
How it works:
Uses True Range (High–Low plus gaps) to capture actual market movement.
Normalizes by dividing ATR by the chosen price base (default: Close).
Multiplies by 100 to output a clean ATR% line.
Smoothing is flexible: choose from RMA, SMA, EMA, or WMA.
Optional Feature:
For comparison, you can toggle an auxiliary line showing the average absolute close-to-close % move, highlighting the difference between simplified and true volatility.
Why use it:
Track regime shifts: identify when volatility expands or contracts in % terms.
Compare volatility across different markets (equities, crypto, forex, commodities).
Integrate into risk management: position sizing, stop placement, or volatility filters for entries.
Interpretation:
Rising ATR% → expanding volatility, potential breakouts or unstable ranges.
Falling ATR% → contracting volatility, possible consolidation or range-bound conditions.
Sudden spikes → market “shocks” worth paying attention to. Indicator

Gioteen-NormThe "Gioteen-Norm" indicator is a versatile and powerful technical analysis tool designed to help traders identify key market conditions such as divergences, overbought/oversold levels, and trend strength. By normalizing price data relative to a moving average and standard deviation, this indicator provides a unique perspective on price behavior, making it easier to spot potential reversals or continuations in the market.
The indicator calculates a normalized value based on the difference between the selected price and its moving average, scaled by the standard deviation over a user-defined period. Additionally, an optional moving average of this normalized value (Green line) can be plotted to smooth the output and enhance signal clarity. This dual-line approach makes it an excellent tool for both short-term and long-term traders.
***Key Features
Divergence Detection: The Gioteen-Norm excels at identifying divergences between price action and the normalized indicator value. For example, if the price makes a higher high while Red line forms a lower high, it may signal a bearish divergence, hinting at a potential reversal.
Overbought/Oversold Conditions: Extreme values of Red line (e.g., significantly above or below zero) can indicate overbought or oversold conditions, helping traders anticipate pullbacks or bounces.
Trend Strength Insight: The normalized output reflects how far the price deviates from its average, providing a measure of momentum and trend strength.
**Customizable Parameters
Traders can adjust the period, moving average type, applied price, and shift to suit their trading style and timeframe.
**How It Works
Label1 (Red Line): Represents the normalized price deviation from a user-selected moving average (SMA, EMA, SMMA, or LWMA) divided by the standard deviation over the specified period. This line highlights the relative position of the price compared to its historical range.
Label2 (Green Line, Optional): A moving average of Label1, which smooths the normalized data to reduce noise and provide clearer signals. This can be toggled on or off via the "Draw MA" option.
**Inputs
Period: Length of the lookback period for normalization (default: 100).
MA Method: Type of moving average for normalization (SMA, EMA, SMMA, LWMA; default: EMA).
Applied Price: Price type used for calculation (Close, Open, High, Low, HL2, HLC3, HLCC4; default: Close).
Shift: Shifts the indicator forward or backward (default: 0).
Draw MA: Toggle the display of the Label2 moving average (default: true).
MA Period: Length of the moving average for Label2 (default: 50).
MA Method (Label2): Type of moving average for Label2 (SMA, EMA, SMMA, LWMA; default: SMA).
**How to Use
Divergence Trading: Look for discrepancies between price action and Label1. A bullish divergence (higher low in Label1 vs. lower low in price) may suggest a buying opportunity, while a bearish divergence could indicate a selling opportunity.
Overbought/Oversold Levels: Monitor extreme Label1 values. For instance, values significantly above +2 or below -2 could indicate overextension, though traders should define thresholds based on the asset and timeframe.
Trend Confirmation: Use Label2 to confirm trend direction. A rising Label2 suggests increasing bullish momentum, while a declining Label2 may indicate bearish pressure.
Combine with Other Tools: Pair Gioteen-Norm with support/resistance levels, RSI, or volume indicators for a more robust trading strategy.
**Notes
The indicator is non-overlay, meaning it plots below the price chart in a separate panel.
Avoid using a Period value of 1, as it may lead to unstable results due to insufficient data for standard deviation calculation.
This tool is best used as part of a broader trading system rather than in isolation.
**Why Use Gioteen-Norm?
The Gioteen-Norm indicator offers a fresh take on price normalization, blending statistical analysis with moving average techniques. Its flexibility and clarity make it suitable for traders of all levels—whether you're scalping on short timeframes or analyzing long-term trends. By publishing this for free, I hope to contribute to the PulseWire community and help traders uncover hidden opportunities in the markets.
**Disclaimer
This indicator is provided for educational and informational purposes only. It does not constitute financial advice. Always backtest and validate any strategy before trading with real capital, and use proper risk management. 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

Money Flow Index Trend Zone Strength [UAlgo]The "Money Flow Index Trend Zone Strength " indicator is designed to analyze and visualize the strength of market trends and OB/OS zones using the Money Flow Index (MFI). The MFI is a momentum indicator that incorporates both price and volume data, providing insights into the buying and selling pressure in the market. This script enhances the traditional MFI by introducing trend and zone strength analysis, helping traders identify potential trend reversals and continuation points.
🔶 Customizable Settings
Amplitude: Defines the range for the MFI Zone Strength calculation.
Wavelength: Period used for the MFI calculation and Stochastic calculations.
Smoothing Factor: Smoothing period for the Stochastic calculations.
Show Zone Strength: Enables/disables visualization of the MFI Zone Strength line.
Show Trend Strength: Enables/disables visualization of the MFI Trend Strength area.
Trend Strength Signal Length: Period used for the final smoothing of the Trend Strength indicator.
Trend Anchor: Selects the anchor point (0 or 50) for the Trend Strength Stochastic calculation.
Trend Transform MA Length: Moving Average length for the Trend Transform calculation.
🔶 Calculations
Zone Strength (Stochastic MFI):
The highest and lowest MFI values over a specified amplitude are used to normalize the MFI value:
MFI Highest: Highest MFI value over the amplitude period.
MFI Lowest: Lowest MFI value over the amplitude period.
MFI Zone Strength: (MFI Value - MFI Lowest) / (MFI Highest - MFI Lowest)
By normalizing and smoothing the MFI values, we aim to highlight the relative strength of different market zones.
Trend Strength:
The smoothed MFI zone strength values are further processed to calculate the trend strength:
EMA of MFI Zone Strength: Exponential Moving Average of the MFI Zone Strength over the wavelength period.
Stochastic of EMA: Stochastic calculation of the EMA values, smoothed with the same smoothing factor.
Purpose: The trend strength calculation provides insights into the underlying market trends. By using EMA and stochastic functions, we can filter out noise and better understand the overall market direction. This helps traders stay aligned with the prevailing trend and make more informed trading decisions.
🔶 Usage
Interpreting Zone Strength: The zone strength plot helps identify overbought and oversold conditions. A higher zone strength indicates potential overbought conditions, while a lower zone strength suggests oversold conditions, can suggest areas for entry/exit decisions.
Interpreting Trend Strength: The trend strength plot visualizes the underlying market trend, can help signal potential trend continuation or reversal based on the chosen anchor point.
Using the Trend Transform: The trend transform plot provides an additional layer of trend analysis, helping traders identify potential trend reversals and continuation points.
Combine the insights from the zone strength and trend strength plots with other technical analysis tools to make informed trading decisions. Look for confluence between different indicators to increase the reliability of your trades.
🔶 Disclaimer:
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (UAlgo) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results. Indicator

Normalized Hull Moving Average Oscillator w/ ConfigurationsThis indicator uniquely uses normalization techniques applied to the Hull Moving Average (HMA) and allows the user to choose between a number of different types of normalization, each with their own advantages. This indicator is one in a series of experiments I've been working on in looking at different methods of transforming data. In particular, this is a more usable example of the power of data transformation, as it takes the Hull Moving Average of Alan Hull and turns it into a powerful oscillating indicator.
The indicator offers multiple types of normalization, each with its own set of benefits and drawbacks. My personal favorites are the Mean Normalization , which turns the data series into one centered around 0, and the Quantile Transformation , which converts the data into a data set that is normally distributed.
I've also included the option of showing the mean, median, and mode of the data over the period specified by the length of normalization. Using this will allow you to gather additional insights into how these transformations affect the distribution of the data series.
Types of Normalization:
1. Z-Score
Overview: Standardizes the data by subtracting the mean and dividing by the standard deviation.
Benefits: Centers the data around 0 with a standard deviation of 1, reducing the impact of outliers.
Disadvantages: Works best on data that is normally distributed
Notes: Best used with a mid-longer length of transformation.
2. Min-Max
Overview: Scales the data to fit within a specified range, typically 0 to 1.
Benefits: Simple and fast to compute, preserves the relationships among data points.
Disadvantages: Sensitive to outliers, which can skew the normalization.
Notes: Best used with mid-longer length of transformation.
3. Mean Normalization
Overview: Subtracts the mean and divides by the range (max - min).
Benefits: Centers data around 0, making it easier to compare different datasets.
Disadvantages: Can be affected by outliers, which influence the range.
Notes: Best used with a mid-longer length of transformation.
4. Max Abs Scaler
Overview: Scales each feature by its maximum absolute value.
Benefits: Retains sparsity and is robust to large outliers.
Disadvantages: Only shifts data to the range , which might not always be desirable.
Notes: Best used with a mid-longer length of transformation.
5. Robust Scaler
Overview: Uses the median and the interquartile range for scaling.
Benefits: Robust to outliers, does not shift data as much as other methods.
Disadvantages: May not perform well with small datasets.
Notes: Best used with a longer length of transformation.
6. Feature Scaling to Unit Norm
Overview: Scales data such that the norm (magnitude) of each feature is 1.
Benefits: Useful for models that rely on the magnitude of feature vectors.
Disadvantages: Sensitive to outliers, which can disproportionately affect the norm. Not normally used in this context, though it provides some interesting transformations.
Notes: Best used with a shorter length of transformation.
7. Logistic Function
Overview: Applies the logistic function to squash data into the range .
Benefits: Smoothly compresses extreme values, handling skewed distributions well.
Disadvantages: May not preserve the relative distances between data points as effectively.
Notes: Best used with a shorter length of transformation. This feature is actually two layered, we first put it through the mean normalization to ensure that it's generally centered around 0.
8. Quantile Transformation
Overview: Maps data to a uniform or normal distribution using quantiles.
Benefits: Makes data follow a specified distribution, useful for non-linear scaling.
Disadvantages: Can distort relationships between features, computationally expensive.
Notes: Best used with a very long length of transformation.
Conclusion
This indicator is a powerful example into how normalization can alter and improve the usability of a data series. Each method offers unique insights and benefits, making this indicator a useful tool for any trader. Try it out, and don't hesitate to reach out if you notice any glaring flaws in the script, room for improvement, or if you just have questions. Indicator

CofG Oscillator w/ Added Normalizations/TransformationsThis indicator is a unique study in normalization/transformation techniques, which are applied to the CG (center of gravity) Oscillator, a popular oscillator made by John Ehlers.
The idea to transform the data from this oscillator originated from observing the original indicator, which exhibited numerous whips. Curious about the potential outcomes, I began experimenting with various normalization/transformation methods and discovered a plethora of interesting results.
The indicator offers 10 different types of normalization/transformation, each with its own set of benefits and drawbacks. My personal favorites are the Quantile Transformation , which converts the dataset into one that is mostly normally distributed, and the Z-Score , which I have found tends to provide better signaling than the original indicator.
I've also included the option of showing the mean, median, and mode of the data over the period specified by the transformation period. Using this will allow you to gather additional insights into how these transformations effect the distribution of the data series.
I've also included some notes on what each transformation does, how it is useful, where it fails, and what I've found to be the best inputs for it (though I'd encourage you to play around with it yourself).
Types of Normalization/Transformation:
1. Z-Score
Overview: Standardizes the data by subtracting the mean and dividing by the standard deviation.
Benefits: Centers the data around 0 with a standard deviation of 1, reducing the impact of outliers.
Disadvantages: Works best on data that is normally distributed
Notes: Best used with a mid-longer transformation period.
2. Min-Max
Overview: Scales the data to fit within a specified range, typically 0 to 1.
Benefits: Simple and fast to compute, preserves the relationships among data points.
Disadvantages: Sensitive to outliers, which can skew the normalization.
Notes: Best used with mid-longer transformation period.
3. Decimal Scaling
Overview: Normalizes data by moving the decimal point of values.
Benefits: Simple and straightforward, useful for data with varying scales.
Disadvantages: Not commonly used, less intuitive, less advantageous.
Notes: Best used with a mid-longer transformation period.
4. Mean Normalization
Overview: Subtracts the mean and divides by the range (max - min).
Benefits: Centers data around 0, making it easier to compare different datasets.
Disadvantages: Can be affected by outliers, which influence the range.
Notes: Best used with a mid-longer transformation period.
5. Log Transformation
Overview: Applies the logarithm function to compress the data range.
Benefits: Reduces skewness, making the data more normally distributed.
Disadvantages: Only applicable to positive data, breaks on zero and negative values.
Notes: Works with varied transformation period.
6. Max Abs Scaler
Overview: Scales each feature by its maximum absolute value.
Benefits: Retains sparsity and is robust to large outliers.
Disadvantages: Only shifts data to the range , which might not always be desirable.
Notes: Best used with a mid-longer transformation period.
7. Robust Scaler
Overview: Uses the median and the interquartile range for scaling.
Benefits: Robust to outliers, does not shift data as much as other methods.
Disadvantages: May not perform well with small datasets.
Notes: Best used with a longer transformation period.
8. Feature Scaling to Unit Norm
Overview: Scales data such that the norm (magnitude) of each feature is 1.
Benefits: Useful for models that rely on the magnitude of feature vectors.
Disadvantages: Sensitive to outliers, which can disproportionately affect the norm. Not normally used in this context, though it provides some interesting transformations.
Notes: Best used with a shorter transformation period.
9. Logistic Function
Overview: Applies the logistic function to squash data into the range .
Benefits: Smoothly compresses extreme values, handling skewed distributions well.
Disadvantages: May not preserve the relative distances between data points as effectively.
Notes: Best used with a shorter transformation period. This feature is actually two layered, we first put it through the mean normalization to ensure that it's generally centered around 0.
10. Quantile Transformation
Overview: Maps data to a uniform or normal distribution using quantiles.
Benefits: Makes data follow a specified distribution, useful for non-linear scaling.
Disadvantages: Can distort relationships between features, computationally expensive.
Notes: Best used with a very long transformation period.
Conclusion
Feel free to explore these normalization/transformation techniques to see how they impact the performance of the CG Oscillator. Each method offers unique insights and benefits, making this study a valuable tool for traders, especially those with a passion for data analysis. Indicator

Normalized Fisher Transformed VolumeGreetings Traders,
I am thrilled to introduce a game-changing tool that I've passionately developed to enhance your trading precision – the Normalized Fisher Transformed Volume indicator. Let's dive into the specifics and explore how this tool can empower you in the markets.
Unlocking Trading Precision:
Normalization and Transformation:
Normalize raw volume data to ensure a consistent scale for analysis.
The Fisher Transformation converts normalized volume data into a Gaussian distribution, providing enhanced insights into trend dynamics.
Flexible Modes for Tailored Strategies:
Choose from three distinct modes:
Volume T3 (MA) + Heatmap: Identify trends with T3 Moving Average and visualize volume strength with Heatmap.
Volume Percent Rank: Evaluate the position of current volume relative to historical data.
Volume T3 (MA) Percent Rank: Combine T3 Moving Average with percentile ranking for a comprehensive analysis.
Heatmap Visualization for Quick Insights:
Heatmap Zones and Lines visually represent volume strength relative to historical data.
Customize threshold multipliers and color options for precise Heatmap interpretation.
T3 Moving Average Integration:
Smoothed representation of volume trends with the T3 Moving Average enhances trend identification.
Percent Rank Analysis for Context:
Gauge the position of normalized volume within historical context using Percent Rank analysis.
User-Friendly Customization:
Easily adjust parameters such as length, T3 Moving Average length, Heatmap standard deviation length, and threshold multipliers.
Intuitive interface with colored bars and customizable background options for personalized analysis.
How to Use Effectively:
Mode Selection:
Identify your preferred trading strategy and select the mode that aligns with your approach.
Parameter Adjustment:
Fine-tune the indicator by adjusting parameters to match your preferred trading style.
Interpret Heatmap and T3 Analysis:
Leverage Heatmap and T3 Moving Average analysis to spot potential trend reversals, overbought/oversold conditions, and market sentiment shifts.
Conclusion:
The Normalized Fisher Transformed Volume indicator is not just a tool; it's your key to unlocking precision in trading. Crafted by Simwai, this indicator offers unique insights tailored to your specific trading needs. Dive in, explore its features, experiment with parameters, and let it guide you to more informed and precise trading decisions.
Trade wisely and prosper,
simwai Indicator

Indicator

Bull Bear Power with Optional Normalization FunctionThis indicator is designed to provide traders with insights into market sentiment and potential trend reversals. This indicator enhances the traditional Bull Bear Power (BBP) by adding valuable visualizations and customization options to assist traders in making informed trading decisions.
Indicator Overview:
The NBBP indicator calculates Bull Bear Power, which measures the strength of bullish and bearish forces in the market. It does so by taking the difference between the high and the exponential moving average (EMA) of the closing price for a specified length. This raw BBP is represented on the chart as a line.
Key Features:
-- Zero Line : The NBBP indicator introduces a central reference line at zero. This line serves as a pivotal point for interpreting market sentiment. When the BBP line is above zero, it is colored green, indicating a predominance of bullish sentiment. Conversely, when the BBP line is below zero, it turns red, signaling a prevalence of bearish sentiment. This coloration helps traders quickly identify shifts in market sentiment.
-- OPTIONAL Normalization Function : One of the standout features of the NBBP indicator is its optional normalization function. When activated in the settings menu, this function scales the BBP values from -1 to +1. This means that BBP values are adjusted to fit within a standardized range, making it easier for traders to compare sentiment across different timeframes or assets. Normalization is particularly valuable for identifying extreme sentiment conditions and potential reversals.
-- Moving Average : To provide additional context and smooth out BBP fluctuations, the indicator includes an exponential moving average (EMA). The EMA of BBP is plotted on the chart as a white line. Traders can use this moving average to identify trends and potential trend reversals.
-- Fill Between Lines : The indicator visually enhances the BBP by filling the area between the BBP line and the zero line with a translucent color. This fill helps traders visualize the strength and duration of bullish or bearish sentiment.
Interpretation:
-- BBP Line : Traders can assess the raw BBP line for shifts in sentiment. When the line crosses above zero, it may suggest a shift from bearish to bullish sentiment, potentially indicating a buying opportunity. Conversely, when the line crosses below zero, it may signal a shift from bullish to bearish sentiment, suggesting a potential selling opportunity.
-- Normalization Function : The optional normalization function allows traders to gauge sentiment on a standardized scale. Values above 0 indicate bullish sentiment, while values below 0 suggest bearish sentiment. The closer the values are to their polar ends (-1 or +1), the stronger the sentiment.
-- Moving Average : The EMA of BBP helps identify trends. When BBP crosses above the EMA, it may indicate a strengthening bullish trend, while a crossover below the EMA may suggest a bearish trend.
Customization:
The NBBP indicator provides traders with flexibility through customizable settings. Users can adjust the BBP length, EMA length, and choose to activate or deactivate the normalization function based on their trading preferences and strategy.
Limitations:
The NBBP indicator is most effective when used in conjunction with other technical analysis tools and market context. Traders should consider multiple factors when making trading decisions.
Normalization function results may vary depending on the chosen length and market conditions. If the desired result is not achieved through default settings, try changing timeframes or toggling on/off the normalization function. Users should exercise caution and combine it with other indicators and analysis techniques.
In conclusion, the NBBP indicator is a versatile tool that empowers traders to assess market sentiment, identify potential reversals, and follow trends. Its intuitive visualizations, normalization function, and customizable settings make it a valuable addition to any trader's toolkit. Indicator

Crunchster's Real PriceThis is a simple transformation of any price series (best suited to daily timeframe) that filters out random price fluctuations and revealing the "real" price action. It allows comparison between different assets easily and is a useful confirmation of support and resistance levels, or can be used with other technical analysis.
In the default settings based on a daily chart, the daily returns are first calculated, then volatility normalised by dividing by the standard deviation of daily returns over the defined lookback period (14 periods by default).
These normalised returns are then added together over the entire price series period, to create a new "Real price" - the volatility adjusted price. This is the default presentation.
In addition, a second signal ("Normalised price series over rolling period") is available which, instead of summing the normalised returns over the entire price series, allows a user configurable, rolling lookback window over which the normalised returns are summed up. The default setting is 365 periods (ie 1 year on the daily timeframe for tickers with 24hr markets such as crypto. This can be set to 252 periods if analysing equities, which only trade 5 days per week, or any other user defined period of interest). Indicator

VolatilityIndicatorsLibrary "VolatilityIndicators"
This is a library of Volatility Indicators .
It aims to facilitate the grouping of this category of indicators, and also offer the customized supply of
the parameters and sources, not being restricted to just the closing price.
@Thanks and credits:
1. Dynamic Zones: Leo Zamansky, Ph.D., and David Stendahl
2. Deviation: Karl Pearson (code by PulseWire)
3. Variance: Ronald Fisher (code by PulseWire)
4. Z-score: Veronique Valcu (code by HPotter)
5. Standard deviation: Ronald Fisher (code by PulseWire)
6. ATR (Average True Range): J. Welles Wilder (code by PulseWire)
7. ATRP (Average True Range Percent): millerrh
8. Historical Volatility: HPotter
9. Min-Max Scale Normalization: gorx1
10. Mean Normalization: gorx1
11. Standardization: gorx1
12. Scaling to unit length: gorx1
13. LS Volatility Index: Alexandre Wolwacz (Stormer), Fabrício Lorenz, Fábio Figueiredo (Vlad) (code by me)
14. Bollinger Bands: John Bollinger (code by PulseWire)
15. Bollinger Bands %: John Bollinger (code by PulseWire)
16. Bollinger Bands Width: John Bollinger (code by PulseWire)
dev(source, length, anotherSource)
Deviation. Measure the difference between a source in relation to another source
Parameters:
source (float)
length (simple int) : (int) Sequential period to calculate the deviation
anotherSource (float) : (float) Source to compare
Returns: (float) Bollinger Bands Width
variance(src, mean, length, biased, degreesOfFreedom)
Variance. A statistical measurement of the spread between numbers in a data set. More specifically,
variance measures how far each number in the set is from the mean (average), and thus from every other number in the set.
Variance is often depicted by this symbol: σ2. It is used by both analysts and traders to determine volatility and market security.
Parameters:
src (float) : (float) Source to calculate variance
mean (float) : (float) Mean (Moving average)
length (simple int) : (int) The sequential period to calcule the variance (number of values in data set)
biased (simple bool) : (bool) Defines the type of standard deviation. If true, uses biased sample variance (n),
degreesOfFreedom (simple int) : (int) Degrees of freedom. The number of values in the final calculation of a statistic that are free to vary.
Default value is n-1, where n here is length. Only applies when biased parameter is defined as true.
Returns: (float) Standard deviation
stDev(src, length, mean, biased, degreesOfFreedom)
Measure the Standard deviation from a source in relation to it's moving average.
In this implementation, you pass the average as a parameter, allowing a more personalized calculation.
Parameters:
src (float) : (float) Source to calculate standard deviation
length (simple int) : (int) The sequential period to calcule the standard deviation
mean (float) : (float) Moving average.
biased (simple bool) : (bool) Defines the type of standard deviation. If true, uses biased sample variance (n),
else uses unbiased sample variance (n-1 or another value, as long as it is in the range between 1 and n-1), where n=length.
degreesOfFreedom (simple int) : (int) Degrees of freedom. The number of values in the final calculation of a statistic that are free to vary.
Default value is n-1, where n here is length.
Returns: (float) Standard deviation
zscore(src, mean, length, biased, degreesOfFreedom)
Z-Score. A z-score is a statistical measurement that indicates how many standard deviations a data point is from
the mean of a data set. It is also known as a standard score. The formula for calculating a z-score is (x - μ) / σ,
where x is the individual data point, μ is the mean of the data set, and σ is the standard deviation of the data set.
Z-scores are useful in identifying outliers or extreme values in a data set. A positive z-score indicates that the
data point is above the mean, while a negative z-score indicates that the data point is below the mean. A z-score of
0 indicates that the data point is equal to the mean.
Z-scores are often used in hypothesis testing and determining confidence intervals. They can also be used to compare
data sets with different units or scales, as the z-score standardizes the data. Overall, z-scores provide a way to
measure the relative position of a data point in a data
Parameters:
src (float) : (float) Source to calculate z-score
mean (float) : (float) Moving average.
length (simple int) : (int) The sequential period to calcule the standard deviation
biased (simple bool) : (bool) Defines the type of standard deviation. If true, uses biased sample variance (n),
else uses unbiased sample variance (n-1 or another value, as long as it is in the range between 1 and n-1), where n=length.
degreesOfFreedom (simple int) : (int) Degrees of freedom. The number of values in the final calculation of a statistic that are free to vary.
Default value is n-1, where n here is length.
Returns: (float) Z-score
atr(source, length)
ATR: Average True Range. Customized version with source parameter.
Parameters:
source (float) : (float) Source
length (simple int) : (int) Length (number of bars back)
Returns: (float) ATR
atrp(length, sourceP)
ATRP (Average True Range Percent)
Parameters:
length (simple int) : (int) Length (number of bars back) for ATR
sourceP (float) : (float) Source for calculating percentage relativity
Returns: (float) ATRP
atrp(source, length, sourceP)
ATRP (Average True Range Percent). Customized version with source parameter.
Parameters:
source (float) : (float) Source for ATR
length (simple int) : (int) Length (number of bars back) for ATR
sourceP (float) : (float) Source for calculating percentage relativity
Returns: (float) ATRP
historicalVolatility(lengthATR, lengthHist)
Historical Volatility
Parameters:
lengthATR (simple int) : (int) Length (number of bars back) for ATR
lengthHist (simple int) : (int) Length (number of bars back) for Historical Volatility
Returns: (float) Historical Volatility
historicalVolatility(source, lengthATR, lengthHist)
Historical Volatility
Parameters:
source (float) : (float) Source for ATR
lengthATR (simple int) : (int) Length (number of bars back) for ATR
lengthHist (simple int) : (int) Length (number of bars back) for Historical Volatility
Returns: (float) Historical Volatility
minMaxNormalization(src, numbars)
Min-Max Scale Normalization. Maximum and minimum values are taken from the sequential range of
numbars bars back, where numbars is a number defined by the user.
Parameters:
src (float) : (float) Source to normalize
numbars (simple int) : (int) Numbers of sequential bars back to seek for lowest and hightest values.
Returns: (float) Normalized value
minMaxNormalization(src, numbars, minimumLimit, maximumLimit)
Min-Max Scale Normalization. Maximum and minimum values are taken from the sequential range of
numbars bars back, where numbars is a number defined by the user.
In this implementation, the user explicitly provides the desired minimum (min) and maximum (max) values for the scale,
rather than using the minimum and maximum values from the data.
Parameters:
src (float) : (float) Source to normalize
numbars (simple int) : (int) Numbers of sequential bars back to seek for lowest and hightest values.
minimumLimit (simple float) : (float) Minimum value to scale
maximumLimit (simple float) : (float) Maximum value to scale
Returns: (float) Normalized value
meanNormalization(src, numbars, mean)
Mean Normalization
Parameters:
src (float) : (float) Source to normalize
numbars (simple int) : (int) Numbers of sequential bars back to seek for lowest and hightest values.
mean (float) : (float) Mean of source
Returns: (float) Normalized value
standardization(src, mean, stDev)
Standardization (Z-score Normalization). How "outside the mean" values relate to the standard deviation (ratio between first and second)
Parameters:
src (float) : (float) Source to normalize
mean (float) : (float) Mean of source
stDev (float) : (float) Standard Deviation
Returns: (float) Normalized value
scalingToUnitLength(src, numbars)
Scaling to unit length
Parameters:
src (float) : (float) Source to normalize
numbars (simple int) : (int) Numbers of sequential bars back to seek for lowest and hightest values.
Returns: (float) Normalized value
lsVolatilityIndex(movingAverage, sourceHvol, lengthATR, lengthHist, lenNormal, lowerLimit, upperLimit)
LS Volatility Index. Measures the volatility of price in relation to an average.
Parameters:
movingAverage (float) : (float) A moving average
sourceHvol (float) : (float) Source for calculating the historical volatility
lengthATR (simple int) : (float) Length for calculating the ATR (Average True Range)
lengthHist (simple int) : (float) Length for calculating the historical volatility
lenNormal (simple int) : (float) Length for normalization
lowerLimit (simple int)
upperLimit (simple int)
Returns: (float) LS Volatility Index
lsVolatilityIndex(sourcePrice, movingAverage, sourceHvol, lengthATR, lengthHist, lenNormal, lowerLimit, upperLimit)
LS Volatility Index. Measures the volatility of price in relation to an average.
Parameters:
sourcePrice (float) : (float) Source for measure the distance
movingAverage (float) : (float) A moving average
sourceHvol (float) : (float) Source for calculating the historical volatility
lengthATR (simple int) : (float) Length for calculating the ATR (Average True Range)
lengthHist (simple int) : (float) Length for calculating the historical volatility
lenNormal (simple int)
lowerLimit (simple int)
upperLimit (simple int)
Returns: (float) LS Volatility Index
bollingerBands(src, length, mult, basis)
Bollinger Bands. A Bollinger Band is a technical analysis tool defined by a set of lines plotted
two standard deviations (positively and negatively) away from a simple moving average (SMA) of the security's price,
but can be adjusted to user preferences. In this version you can pass a customized basis (moving average), not only SMA.
Parameters:
src (float) : (float) Source to calculate standard deviation used in Bollinger Bands
length (simple int) : (int) The time period to be used in calculating the standard deviation
mult (simple float) : (float) Multiplier used in standard deviation. Basically, the upper/lower bands are standard deviation multiplied by this.
basis (float) : (float) Basis of Bollinger Bands (a moving average)
Returns: (float) A tuple of Bollinger Bands, where index 1=basis; 2=basis+dev; 3=basis-dev; and dev=multiplier*stdev
bollingerBands(src, length, aMult, basis)
Bollinger Bands. A Bollinger Band is a technical analysis tool defined by a set of lines plotted
two standard deviations (positively and negatively) away from a simple moving average (SMA) of the security's price,
but can be adjusted to user preferences. In this version you can pass a customized basis (moving average), not only SMA.
Also, various multipliers can be passed, thus getting more bands (instead of just 2).
Parameters:
src (float) : (float) Source to calculate standard deviation used in Bollinger Bands
length (simple int) : (int) The time period to be used in calculating the standard deviation
aMult (float ) : (float ) An array of multiplies used in standard deviation. Basically, the upper/lower bands are standard deviation multiplied by this.
This array of multipliers permit the use of various bands, not only 2.
basis (float) : (float) Basis of Bollinger Bands (a moving average)
Returns: (float ) An array of Bollinger Bands, where:
index 1=basis; 2=basis+dev1; 3=basis-dev1; 4=basis+dev2, 5=basis-dev2, 6=basis+dev2, 7=basis-dev2, Nup=basis+devN, Nlow=basis-devN
and dev1, dev2, devN are ```multiplier N * stdev```
bollingerBandsB(src, length, mult, basis)
Bollinger Bands %B - or Percent Bandwidth (%B).
Quantify or display where price (or another source) is in relation to the bands.
%B can be useful in identifying trends and trading signals.
Calculation:
%B = (Current Price - Lower Band) / (Upper Band - Lower Band)
Parameters:
src (float) : (float) Source to calculate standard deviation used in Bollinger Bands
length (simple int) : (int) The time period to be used in calculating the standard deviation
mult (simple float) : (float) Multiplier used in standard deviation
basis (float) : (float) Basis of Bollinger Bands (a moving average)
Returns: (float) Bollinger Bands %B
bollingerBandsB(src, length, aMult, basis)
Bollinger Bands %B - or Percent Bandwidth (%B).
Quantify or display where price (or another source) is in relation to the bands.
%B can be useful in identifying trends and trading signals.
Calculation
%B = (Current Price - Lower Band) / (Upper Band - Lower Band)
Parameters:
src (float) : (float) Source to calculate standard deviation used in Bollinger Bands
length (simple int) : (int) The time period to be used in calculating the standard deviation
aMult (float ) : (float ) Array of multiplier used in standard deviation. Basically, the upper/lower bands are standard deviation multiplied by this.
This array of multipliers permit the use of various bands, not only 2.
basis (float) : (float) Basis of Bollinger Bands (a moving average)
Returns: (float ) An array of Bollinger Bands %B. The number of results in this array is equal the numbers of multipliers passed via parameter.
bollingerBandsW(src, length, mult, basis)
Bollinger Bands Width. Serve as a way to quantitatively measure the width between the Upper and Lower Bands
Calculation:
Bollinger Bands Width = (Upper Band - Lower Band) / Middle Band
Parameters:
src (float) : (float) Source to calculate standard deviation used in Bollinger Bands
length (simple int) : (int) Sequential period to calculate the standard deviation
mult (simple float) : (float) Multiplier used in standard deviation
basis (float) : (float) Basis of Bollinger Bands (a moving average)
Returns: (float) Bollinger Bands Width
bollingerBandsW(src, length, aMult, basis)
Bollinger Bands Width. Serve as a way to quantitatively measure the width between the Upper and Lower Bands
Calculation
Bollinger Bands Width = (Upper Band - Lower Band) / Middle Band
Parameters:
src (float) : (float) Source to calculate standard deviation used in Bollinger Bands
length (simple int) : (int) Sequential period to calculate the standard deviation
aMult (float ) : (float ) Array of multiplier used in standard deviation. Basically, the upper/lower bands are standard deviation multiplied by this.
This array of multipliers permit the use of various bands, not only 2.
basis (float) : (float) Basis of Bollinger Bands (a moving average)
Returns: (float ) An array of Bollinger Bands Width. The number of results in this array is equal the numbers of multipliers passed via parameter.
dinamicZone(source, sampleLength, pcntAbove, pcntBelow)
Get Dynamic Zones
Parameters:
source (float) : (float) Source
sampleLength (simple int) : (int) Sample Length
pcntAbove (simple float) : (float) Calculates the top of the dynamic zone, considering that the maximum values are above x% of the sample
pcntBelow (simple float) : (float) Calculates the bottom of the dynamic zone, considering that the minimum values are below x% of the sample
Returns: A tuple with 3 series of values: (1) Upper Line of Dynamic Zone;
(2) Lower Line of Dynamic Zone; (3) Center of Dynamic Zone (x = 50%)
Examples:
Library

Library

Indicator

On Balance Volume Scaled - OBV ScaledThe main idea of this oscillator is to place the OBV oscillator and its oscillation around the range of 0 and around -50 to +50 and for this scaling of the "On Balance Volume" oscillator, I have used Min-max normalization.
Since this oscillator does not have a specific minimum and maximum, just setting the maximum and minimum does not seem the best thing to do. As in this case, we will constantly observe sudden changes and we will have problems such as volatility. On the one hand, we will constantly deal with sudden changes and problems such as volatility. Also on the other hand, the continuous collisions of the high/low(+50 & -50) and index and returning from that is another thing that we are going to deal with.
Therefore, to solve these problems and create more flexible maximum and minimum ranges, another similar method has been used. Choosing the maximum of our normalization to the size of the moving average of 100 candles of the index maximum and choosing the minimum of normalization to the size of the moving average of 100 candles of the minimums of the OBV index, and then normalizing the OBV index with the Min-max method with those ranges, is the recommended method ,which has been used to eliminate problems. In this case, we will not have any problem hitting 50 and returning or hitting -50 and returning. Also, our scaled OBV index will have the ability to touch and cross 50 and -50 and can fluctuate without problems. Indicator

Indicator

Indicator
