Generalized Fisher Transform [LB] Concept
The Generalized Fisher Transform extends John F. Ehlers' classic Fisher Transform (2002) by introducing an adjustable shape parameter that controls the sensitivity profile of the transformation. While the original Fisher Transform maps any normalized input to a near‑Gaussian output to highlight statistical extremes, this generalized version allows traders to emphasize central regions (shape < 1) or extreme tails (shape > 1) depending on their strategy.
Mathematical Foundation
The indicator first normalizes price to a bounded range using a rolling min‑max window of length N :
x = 2 × (P - L_min) / (H_max - L_min) - 1
A signed power is then applied with a shape factor p :
x_p = sign(x) × |x|^p
The generalized Fisher Transform is computed as :
F = 0.5 × ln( (1 + x_p) / (1 - x_p) )
When p = 1 , the formula reduces to the classic Fisher Transform. Values of p < 1 amplify sensitivity near zero (central price region), while p > 1 amplify sensitivity near the edges (extreme price region). The result is smoothed by an EMA for noise reduction.
What Problem Does It Solve ?
Classic oscillators such as RSI or Stochastic use fixed non‑linear mappings that cannot adapt to different market regimes or trader preferences. The classic Fisher Transform offers a single sensitivity profile. The Generalized Fisher Transform solves this by exposing the shape parameter p , giving traders direct control over where the indicator is most responsive — near the mean or near the extremes — without changing the underlying logic or introducing additional indicators.
How To Interpret
The indicator operates in two selectable modes :
Extremes Mode – the background turns red when Fisher exceeds the upper threshold (statistically overbought), and green when it drops below the lower threshold (statistically oversold). These zones suggest potential mean‑reversion.
Direction Mode – the background turns cyan when Fisher is above zero (bullish bias) and orange when below zero (bearish bias). This mode is suited for trend‑following or directional confirmation.
In both modes, the Fisher line crossing zero indicates a shift in the price distribution relative to its recent range.
Parameters
Source – price data used for the calculation (default: close).
Normalization Period – number of bars used to compute the rolling min‑max for the normalization.
Shape Factor – exponent applied to the normalized price before the Fisher transform. 1 = classic Fisher, < 1 = center‑sensitive, > 1 = tail‑sensitive.
Smoothing Period – EMA length applied to the raw Fisher output.
Coloration Mode – switches between "Extremes" (overbought/oversold highlighting) and "Direction" (bullish/bearish highlighting).
Upper Threshold – Fisher level above which the background turns red in Extremes mode.
Lower Threshold – Fisher level below which the background turns green in Extremes mode.
Reference
Ehlers J.F., "Using the Fisher Transform", Technical Analysis of Stocks & Commodities, Vol. 20, No. 11, pp. 40‑45, November 2002.
Ehlers J.F., "Cybernetic Analysis for Stocks and Futures", Chapter 4 – The Fisher Transform, John Wiley & Sons, 2004. Indicateur

Price Normalized RSI Profile [UAlgo]Price Normalized RSI Profile is a hybrid visualization tool that combines a rolling RSI distribution study with a profile style overlay drawn directly on the price chart. Instead of plotting a classic RSI line in a separate oscillator pane, this script collects historical RSI readings, groups them into fixed 0 to 100 bins, weights each bin by traded volume, and then renders the resulting distribution as a horizontal profile on the right side of the main chart.
The goal of the script is not to show where price traded the most, but to show where RSI states accumulated the most volume over the selected lookback period. In other words, it answers a different question than a traditional volume profile. Rather than asking which prices were most active, it asks which RSI regimes were most active, then maps those oscillator regimes visually into the chart’s price space for easier on-chart interpretation.
The indicator highlights:
A volume weighted RSI Point of Control (POC)
A Value Area around that POC
A right side histogram of RSI regime distribution
A color gradient that reflects bullish versus bearish RSI zones
Reference labels for POC, VAH, and VAL
Lookback boundary markers for profile context
This makes the script useful for traders who want to blend oscillator distribution analysis with chart based execution, especially when comparing current price position against historically dominant RSI states.
Important note: The POC, VAH, and VAL in this script are derived from an RSI distribution profile , not from a standard price based volume profile. They are visually mapped onto the current chart range for presentation.
🔹 Features
🔸 1) Volume Weighted RSI Distribution Profile
The script collects RSI values over a rolling lookback window and assigns each reading into one of several fixed RSI bins. Each bin accumulates volume , not just frequency, so the profile reflects how much traded participation occurred while RSI was in that zone.
This makes the output more meaningful than a simple occurrence count because highly active bars contribute more weight.
🔸 2) Fixed 0 to 100 RSI Bin Framework
The profile is built over the natural RSI range from 0 to 100, divided into a user defined number of bins. This creates a stable oscillator distribution model that is consistent across symbols and timeframes.
Lower bin counts create thicker, smoother profile bars.
Higher bin counts create finer resolution and more detailed structure.
🔸 3) Overlay on the Main Price Chart
Unlike most RSI tools, this script runs with overlay=true and renders the profile directly on the price chart. It maps RSI bins onto the vertical span of the recent chart range, allowing traders to see the distribution without leaving the main chart.
This is a visual convenience feature and creates a unique fusion of oscillator logic and price space presentation.
🔸 4) Point of Control (POC) Detection
The indicator identifies the RSI bin with the highest accumulated volume and treats it as the RSI Profile POC. This is the most active RSI zone by volume over the lookback window.
The POC is highlighted with:
A wider profile bar
A unique color
A label showing the POC volume
🔸 5) Value Area (VAH / VAL) Calculation
The script builds a Value Area around the POC using the selected percentage of total profile volume. This identifies the core RSI regime zone where the majority of the volume weighted RSI activity occurred.
The Value Area is visually emphasized with more visible bars and separate VAH / VAL guide lines.
🔸 6) Gradient Color Mapping by RSI Regime
Each bin is colored using a gradient based on its RSI location:
Lower RSI zones lean bullish color
Higher RSI zones lean bearish color
This reflects the script’s chosen visual logic, where low RSI bins appear in the bullish color family and high RSI bins appear in the bearish color family.
🔸 7) Distinct Styling for POC, Value Area, and Outside Value
The script visually separates three categories:
POC bin
Bins inside the Value Area
Bins outside the Value Area
This helps traders quickly distinguish the dominant RSI regime from the broader accepted RSI zone and from lower importance outer regions.
🔸 8) Forward Projected Histogram Layout
The profile is drawn to the right of current price using configurable:
Maximum width in bars
Horizontal offset
This keeps the histogram out of the way of current candles while preserving clear visibility on the active chart.
🔸 9) Lookback Context Markers
The script draws a vertical line marking the start of the profile lookback window, plus horizontal guide lines across the chart high and low range used for the profile mapping. This makes it easy to understand which portion of the chart is being analyzed.
🔸 10) Compact On Chart Labels
The indicator adds right side labels for:
POC
VAH
VAL
This makes the distribution easier to read without manually inspecting each bar.
🔸 11) Rolling History Buffer for RSI and Volume
The script stores both RSI and volume into arrays, allowing the profile to be rebuilt from recent history on the last bar. This keeps the logic fully rolling and independent from session boundaries.
🔸 12) Structured Object Based Design
The script uses custom types:
RsiBin for each RSI interval
RsiProfile for the full profile state, including POC and Value Area indexes
This makes the internal logic cleaner and easier to maintain.
🔹 Calculations
1) RSI Calculation
The script calculates RSI from the chosen source and length:
float rsi_val = ta.rsi(rsi_src, rsi_len)
This value is the basis for all binning and profile accumulation.
2) Rolling RSI and Volume History Storage
Every bar, the script pushes the latest RSI value and volume into rolling arrays:
rsi_history.push(rsi_val)
vol_history.push(volume)
To prevent unlimited growth, the arrays are trimmed when they exceed:
lookback + 100
This keeps enough buffer for profile stability while controlling memory size.
3) Fixed RSI Bin Initialization
The profile divides the 0 to 100 RSI range into equal bins:
float step = 100.0 / bins_count
for i = 0 to bins_count - 1
float min_v = i * step
float max_v = (i + 1) * step
this.bins.push(RsiBin.new(min_v, max_v, 0.0, 0))
Each bin stores:
RSI minimum value
RSI maximum value
Accumulated volume
Observation count
4) Volume Weighted Population of the RSI Profile
When populating the profile, each historical RSI value is mapped into the correct bin:
int bin_idx = math.floor(r_val / 100.0 * this.bins.size())
The index is clamped to remain inside valid bounds:
bin_idx := math.min(bin_idx, this.bins.size() - 1)
bin_idx := math.max(bin_idx, 0)
Then the script adds the corresponding bar volume to that bin:
b.volume += v_val
b.count += 1
this.total_vol += v_val
This means the profile is volume weighted RSI distribution , not a simple count histogram.
5) POC Detection
As bins are populated, the script tracks the bin with the highest accumulated volume:
if b.volume > this.max_vol
this.max_vol := b.volume
this.poc_idx := bin_idx
This bin becomes the profile POC and acts as the center for Value Area expansion.
6) Value Area Calculation
The Value Area target is calculated from total profile volume:
float target_vol = this.total_vol * (va_percent / 100.0)
The script starts from the POC and expands outward, comparing the next upper and lower bin volumes:
float vol_up = (top < max_idx) ? this.bins.get(top + 1).volume : 0.0
float vol_dn = (bot > 0) ? this.bins.get(bot - 1).volume : 0.0
Whichever side has more volume is added first. This continues until the accumulated volume reaches the target percentage.
The final indexes are stored as:
this.va_top_idx := top
this.va_bot_idx := bot
7) Mapping RSI Bins into Price Space
A key part of this script is that RSI bins are not drawn in an oscillator pane. Instead, each RSI interval is mapped onto the chart’s recent price range:
float price_range = chart_high - chart_low
float y_bottom = chart_low + (b.min_val / 100.0) * price_range
float y_top = chart_low + (b.max_val / 100.0) * price_range
Interpretation:
RSI 0 maps to the recent chart low.
RSI 100 maps to the recent chart high.
All intermediate RSI bins are proportionally placed between them.
This is a visual mapping device, not a statement that those price levels correspond to actual RSI threshold prices.
8) Histogram Width Normalization
Each bin’s horizontal width is scaled by its volume relative to the maximum profile volume:
int bar_w = math.round((b.volume / this.max_vol) * max_width)
If the bin is the POC, it gets extra width:
if is_poc
bar_w := int(max_width * 1.15)
This makes the POC stand out clearly inside the profile.
9) POC, VA, and Outside VA Styling Logic
Each bin is categorized as:
POC
Inside the Value Area
Outside the Value Area
Then the script applies different opacity and border logic:
POC gets the dedicated POC color
VA bins are more visible
Outside VA bins are more faded
This creates clear visual hierarchy in the profile.
10) Color Gradient by RSI Position
Base color is determined from bin position in the RSI scale:
color base_col = color.from_gradient(b.min_val, 0, 100, c_bull, c_bear)
This means lower RSI bins transition toward the bullish color and higher RSI bins transition toward the bearish color. This is a stylistic mapping choice built into the script.
11) POC Label and Volume Display
When the POC is drawn, the script also adds a label showing:
The text POC
The accumulated volume of that bin
text="POC " + str.tostring(b.volume, format.volume)
This provides quick information about the dominant RSI regime’s participation size.
12) VAH and VAL Price Level Rendering
The script converts the Value Area top and bottom RSI bin indexes into mapped chart levels:
For VAH:
float vah_level = chart_low + (b_vah.max_val / 100.0) * price_range_val
For VAL:
float val_level = chart_low + (b_val.min_val / 100.0) * price_range_val
It then draws dashed horizontal lines and small labels for both.
Important note:
These are RSI profile Value Area boundaries mapped into price space , not true price based VAH and VAL from a market profile.
13) Lookback Boundary Drawing
The start of the lookback window is marked with a vertical dotted line:
int start_bar_idx = bar_index - lookback
line.new(start_bar_idx, chart_low, start_bar_idx, chart_high, ...)
This makes it easier to visually understand which section of chart history contributed to the current profile.
14) Chart Range Anchoring
The vertical display range used for the RSI to price mapping is derived from:
float chart_high = ta.highest(high, lookback)
float chart_low = ta.lowest(low, lookback)
This means the profile always stretches across the full recent visible price range used in the calculation window.
15) Last Bar Rendering Behavior
The profile is built and rendered only on the last bar:
if barstate.islast
vp.init(bin_count)
vp.populate(rsi_history, vol_history, lookback)
vp.calc_va(va_pct)
vp.render(...)
Indicateur

MFI Distribution [UAlgo]MFI Distribution is a statistics focused Money Flow Index indicator that combines a live MFI oscillator with a forward projected distribution histogram and normality diagnostics. Instead of only showing the current MFI line, the script collects a rolling history of MFI values, studies their distribution over a configurable lookback period, and visualizes the result as a histogram in the oscillator pane.
The indicator is designed for traders who want to understand how MFI behaves as a distribution , not only where it is on the current bar. It provides a compact statistical framework that helps answer questions such as:
Is MFI clustering around a narrow regime or spread across the full range
Is the recent MFI behavior skewed toward strong buying or selling pressure
Does the MFI sample look approximately normal, or is it fat tailed / asymmetric
How extreme is the current reading relative to the recent distribution
To support this, the script includes:
A live MFI line with dynamic gradient coloring
Overbought and oversold visual zones with gradient fills
A histogram of MFI frequency distribution over the selected lookback
An optional Gaussian curve overlay for visual comparison
A statistical dashboard with mean, standard deviation, skewness, kurtosis, and Jarque Bera normality test results
The histogram is drawn into the future area of the pane, so it does not interfere with the live MFI trace while still remaining visually aligned to the 0 to 100 oscillator scale.
Educational tool only. Not financial advice.
🔹 Features
🔸 1) Live MFI Oscillator with Regime Aware Coloring
The script plots a standard MFI line and colors it dynamically based on level behavior:
High MFI values transition toward red tones
Low MFI values transition toward green tones
Mid range values remain purple
This makes the oscillator easier to read at a glance, especially during sustained overbought or oversold conditions.
🔸 2) Overbought and Oversold Zone Visualization
The indicator includes standard MFI reference levels at 80 and 20, then adds gradient fills that become visible when the MFI pushes into extreme zones. This provides better visual emphasis for momentum extremes without cluttering the chart.
🔸 3) Rolling MFI History Collection for Statistical Analysis
The script maintains an internal array of the latest MFI values up to the user defined lookback length. This rolling sample is used to compute all distribution statistics and histogram frequencies on the last bar.
This design keeps the indicator responsive while ensuring the displayed distribution reflects the most recent market behavior.
🔸 4) Forward Projected MFI Distribution Histogram
A histogram is drawn in the oscillator pane using bins over the fixed MFI range from 0 to 100. Each bin counts how many MFI observations fall inside that interval during the lookback window.
The histogram is projected to the right of current price action in the pane, giving users a clean distribution panel without covering the live MFI line.
🔸 5) Configurable Histogram Resolution and Width
Users can control:
Lookback period used for distribution analysis
Number of histogram bins
Visual width of the histogram in future bars
This makes the tool flexible for both high level regime reading and finer distribution inspection.
🔸 6) Optional Gaussian Curve Overlay
When enabled, the script overlays a theoretical normal distribution curve using the sample mean and sample standard deviation. The curve is normalized to the histogram height so users can visually compare the empirical MFI distribution against a bell curve shape.
This is useful for quickly spotting asymmetry, multimodal clustering, or fat tail behavior.
🔸 7) Full Statistical Summary Dashboard
A built in dashboard table displays:
Mean
Standard Deviation
Skewness
Kurtosis (excess kurtosis)
Jarque Bera statistic
Pass / Fail normality status (95% threshold logic)
This turns the indicator into a compact quantitative diagnostic panel, not only a visual oscillator.
🔸 8) Jarque Bera Normality Test Classification
The script evaluates whether the MFI sample is approximately normal using a Jarque Bera style test and a fixed chi square threshold (95% confidence, 2 degrees of freedom). It then marks the result as PASS (Normal) or FAIL (Non Normal).
This helps traders distinguish between more stable oscillator regimes and structurally distorted ones.
🔸 9) Histogram Color Theme Based on Normality Result
The histogram automatically changes style depending on the test result:
Teal themed histogram when normality test passes
Red themed histogram when normality test fails
This creates an immediate visual signal of distribution quality without needing to read the dashboard first.
🔸 10) Last Bar Only Heavy Processing for Efficiency
Statistical calculations, histogram drawing, and dashboard refresh are performed only on the last bar. This reduces object churn and improves performance while preserving real time utility.
🔸 11) Object Based Drawing Management
The script uses custom types to organize logic:
DistributionStats for statistical values and normality output
HistoDrawer for histogram bars, curve lines, and labels
This makes the code structured and easier to extend with future features such as percentiles, z scores, or alternate tests.
🔹 Calculations
1) MFI Calculation
The script computes Money Flow Index from a user selected source and length:
mfi_val = ta.mfi(mfi_src, mfi_len)
This value is plotted in the oscillator pane and colored dynamically according to level.
2) Rolling History Buffer for Distribution Sampling
Each valid MFI value is pushed into a rolling array used for statistical analysis:
if not na(mfi_val)
mfi_history.push(mfi_val)
if mfi_history.size() > lookback
mfi_history.shift()
This ensures the sample size is capped at the selected lookback and continuously refreshed with recent values.
3) Sample Variance and Standard Deviation
The script computes sample variance using the classic n minus 1 denominator:
sum_sq_diff / (n - 1)
Standard deviation is then calculated as:
stats.stdev := math.sqrt(variance_val)
Using sample variance is appropriate here because the lookback window is treated as a sample of recent market behavior.
4) Sample Skewness Calculation
Skewness is computed from standardized deviations and corrected for sample size:
(n * sum_cube_diff) / ((n - 1) * (n - 2))
Interpretation:
Positive skew suggests more mass on lower values with a right tail toward high MFI prints
Negative skew suggests more mass on higher values with a left tail toward low MFI prints
5) Excess Kurtosis Calculation
The script calculates excess kurtosis , where a normal distribution is centered around 0:
float term1 = (n * (n + 1) * sum_quad_diff) / ((n - 1) * (n - 2) * (n - 3))
float term2 = (3 * math.pow(n - 1, 2)) / ((n - 2) * (n - 3))
term1 - term2
Interpretation:
Positive excess kurtosis suggests heavier tails or more peaked behavior
Negative excess kurtosis suggests flatter distribution behavior
6) Jarque Bera Normality Test
The script uses skewness and excess kurtosis to compute the Jarque Bera statistic:
stats.jb_stat := (n / 6.0) * (math.pow(stats.skew, 2) + 0.25 * math.pow(stats.kurt, 2))
Then it compares the result against a 95 percent chi square critical value (2 degrees of freedom):
stats.is_normal := stats.jb_stat < 5.991
Important note:
The code defines a jb_p_value field in the stats type, but this version does not explicitly calculate or display a p value. The pass / fail logic is threshold based.
7) Fixed MFI Range Histogram Binning (0 to 100)
The histogram always bins data over the full MFI range:
float min_val = 0.0
float max_val = 100.0
float bin_size = (max_val - min_val) / bins
Each MFI value is mapped to a bin index:
int bin_idx = math.floor(val / bin_size)
The index is clamped so values at boundaries stay valid:
if bin_idx >= bins
bin_idx := bins - 1
if bin_idx < 0
bin_idx := 0
This makes the histogram consistent across symbols and timeframes.
8) Frequency Counting and Peak Detection
For each binned MFI observation, the script increments a frequency counter and tracks the highest bin count:
int new_count = frequencies.get(bin_idx) + 1
frequencies.set(bin_idx, new_count)
if new_count > max_freq
max_freq := new_count
The maximum frequency is later used to normalize histogram bar heights.
9) Histogram Rendering Geometry
The histogram is drawn as boxes in the oscillator pane, projected to the right of the last bar:
int start_bar = bar_index + 5
float base_y = 10.0
float available_height = 80.0
This effectively uses the MFI pane vertical range from about 10 to 90 for histogram height visualization, keeping it aligned with the oscillator scale.
Each bin is mapped to x coordinates using its MFI interval and the user selected histogram width:
int x_left = start_bar + math.round((bin_val_start / 100.0) * chart_width_bars)
int x_right = start_bar + math.round((bin_val_end / 100.0) * chart_width_bars)
Each frequency is mapped to a vertical height using:
float bar_height_val = (freq / max_freq) * available_height
10) Histogram Color Logic from Normality Result
The histogram color theme is selected from the Jarque Bera pass / fail result:
Teal palette when stats.is_normal is true
Red palette when stats.is_normal is false
This creates a direct link between statistical classification and visual presentation.
11) Gaussian Curve Overlay Calculation
The script defines a normal probability density function:
(1.0 / (sigma * math.sqrt(2.0 * math.pi))) * math.exp(-0.5 * math.pow((x - mu) / sigma, 2))
For curve plotting:
It samples points across the histogram width
Maps each x position back to an MFI value from 0 to 100
Computes the PDF at that MFI value using the sample mean and standard deviation
Scales the PDF by the theoretical peak so the curve fits the histogram height
Key normalization idea:
float pdf_peak = normal_pdf(stats.mean, stats.mean, stats.stdev)
float current_y = base_y + (pdf_val / pdf_peak) * available_height
This makes the Gaussian curve visually comparable to the empirical histogram, even though one is a density and the other is raw frequency.
12) Dashboard Table Metrics
On the last bar, the script updates a table with the computed statistics:
Mean
StdDev
Skewness
Kurtosis
Jarque Bera statistic and normality classification
The result cell color changes based on normality:
Green for PASS (Normal)
Red for FAIL (Non Normal)
This gives traders a compact quantitative summary next to the visual distribution.
13) Overbought and Oversold Gradient Fills
The script adds gradient fills that appear when MFI moves beyond standard thresholds:
fill(plot_mfi, p_ob, 100, 80, ...)
fill(plot_mfi, p_os, 20, 0, ...)
This helps contextualize whether the current MFI reading is extreme while the histogram and dashboard describe the broader behavior of the recent MFI sample. Indicateur

Adaptive Z-Score Oscillator [QuantAlgo]🟢 Overview
The Adaptive Z-Score Oscillator transforms price action into statistical significance measurements by calculating how many standard deviations the current price deviates from its moving average baseline, then dynamically adjusting threshold levels based on historical distribution patterns. Unlike traditional oscillators that rely on fixed overbought/oversold levels, this indicator employs percentile-based adaptive thresholds that automatically calibrate to changing market volatility regimes and statistical characteristics. By offering both adaptive and fixed threshold modes alongside multiple moving average types and customizable smoothing, the indicator provides traders and investors with a robust framework for identifying extreme price deviations, mean reversion opportunities, and underlying trend conditions through the visualization of price behavior within a statistical distribution context.
🟢 How It Works
The indicator begins by establishing a dynamic baseline using a user-selected moving average type applied to closing prices over the specified length period, then calculates the standard deviation to measure price dispersion:
basis = ma(close, length, maType)
stdev = ta.stdev(close, length)
The core Z-Score calculation quantifies how many standard deviations the current price sits above or below the moving average basis, creating a normalized oscillator that facilitates cross-asset and cross-timeframe comparisons:
zScore = stdev != 0 ? (close - basis) / stdev : 0
smoothedZ = ma(zScore, smooth, maType)
The adaptive threshold mechanism employs percentile calculations over a historical lookback period to determine statistically significant extreme zones. Rather than using fixed levels like ±2.0, the indicator identifies where a specified percentage of historical Z-Score readings have fallen, automatically adjusting to market regime changes:
upperThreshold = adaptive ? ta.percentile_linear_interpolation(smoothedZ, percentilePeriod, upperPercentile) : fixedUpper
lowerThreshold = adaptive ? ta.percentile_linear_interpolation(smoothedZ, percentilePeriod, lowerPercentile) : fixedLower
The visualization architecture creates a four-tier coloring system that distinguishes between extreme conditions (beyond the adaptive thresholds) and moderate conditions (between the midpoint and threshold levels), providing visual gradation of statistical significance through opacity variations and immediate recognition of distribution extremes.
🟢 How to Use This Indicator
▶ Overbought and Oversold Identification:
The indicator identifies potential overbought conditions when the smoothed Z-Score crosses above the upper threshold, indicating that price has deviated to a statistically extreme level above its mean. Conversely, oversold conditions emerge when the Z-Score crosses below the lower threshold, signaling statistically significant downward deviation. In adaptive mode (default), these thresholds automatically adjust to the asset's historical behavior, i.e., during high volatility periods, the thresholds expand to accommodate wider price swings, while during low volatility regimes, they contract to capture smaller deviations as significant. This dynamic calibration reduce false signals that plague fixed-level oscillators when market character shifts between volatile and ranging conditions.
▶ Mean Reversion Trading Applications:
The Z-Score framework excels at identifying mean reversion opportunities by highlighting when price has stretched too far from its statistical equilibrium. When the oscillator reaches extreme bearish levels (below the lower threshold with deep red coloring), it suggests price has become statistically oversold and may snap back toward the mean, presenting potential long entry opportunities for mean reversion traders. Symmetrically, extreme bullish readings (above the upper threshold with bright green coloring) indicate potential short opportunities or long exit points as price becomes statistically overbought. The moderate zones (lighter colors between midpoint and threshold) serve as early warning areas where traders can prepare for potential reversals, while exits from extreme zones (crossing back inside the thresholds) often provide confirmation that mean reversion is underway.
▶ Trend and Distribution Analysis:
Beyond discrete overbought/oversold signals, the histogram's color pattern and shape reveal the underlying trend structure and distribution characteristics. Sustained periods where the Z-Score oscillates primarily in positive territory (green bars) indicate a bullish trend where price consistently trades above its moving average baseline, even if not reaching extreme levels. Conversely, predominant negative readings (red bars) suggest bearish trend conditions. The distribution shape itself provides insight into market behavior, e.g., a narrow, centered distribution clustering near zero indicates tight ranging conditions with price respecting the mean, while a wide distribution with frequent extreme readings reveals volatile trending or choppy conditions. Asymmetric distributions skewed heavily toward one side demonstrate persistent directional bias, whereas balanced distributions suggest equilibrium between bulls and bears.
▶ Built-in Alerts:
Seven alert conditions enable automated monitoring of statistical extremes and trend transitions. Enter Overbought and Enter Oversold alerts trigger when the Z-Score crosses into extreme zones, providing early warnings of potential reversal setups. Exit Overbought and Exit Oversold alerts signal when price begins reverting from extremes, offering confirmation that mean reversion has initiated. Zero Cross Up and Zero Cross Down alerts identify transitions through the neutral line, indicating shifts between above-mean and below-mean price action that can signal trend changes. The Extreme Zone Entry alert fires on any extreme threshold penetration regardless of direction, allowing unified monitoring of both overbought and oversold opportunities.
▶ Color Customization:
Six visual themes (Classic, Aqua, Cosmic, Ember, Neon, plus Custom) accommodate different chart backgrounds and aesthetic preferences, ensuring optimal contrast and readability across trading platforms. The bar transparency control (0-90%) allows fine-tuning of visual prominence, with minimal transparency creating bold, attention-grabbing bars for primary analysis, while higher transparency values produce subtle background context when using the oscillator alongside other indicators. The extreme and moderate zone coloring system uses automatic opacity variation to create instant visual hierarchy, with darkest colors highlight the most statistically significant deviations demanding immediate attention, while lighter shades mark developing conditions that warrant monitoring but may not yet justify action. Optional candle coloring extends the Z-Score color scheme directly to the price candles on the main chart, enabling traders to instantly recognize statistical extremes and trend conditions without needing to reference the oscillator panel, creating a unified visual experience where both price action and statistical analysis share the same color language.
Indicateur

RSI Profile [Kodexius]RSI Profile is an advanced technical indicator that turns the classic RSI into a distribution profile instead of a single oscillating line. Rather than only showing where the RSI is at the current bar, it displays where the RSI has spent most of its time or most of its volume over a user defined lookback period.
The script builds a histogram of RSI values between 0 and 100, splits that range into configurable bins, and then projects the result to the right side of the chart. This gives you a clear visual representation of the RSI structure, including the Point of Control (POC), the Value Area High (VAH), and the Value Area Low (VAL). The POC marks the RSI level with the highest activity, while VAH and VAL bracket the percentage based value area around it.
By combining standard RSI, a distribution profile, and value area logic, this tool lets you study RSI behavior statistically instead of only bar by bar. You can immediately see whether the current RSI reading is located inside the dominant zone, extended above it, or depressed below it, and whether the recent regime has been biased toward overbought, oversold, or neutral territory. This is particularly useful for swing traders, mean reversion systems, and anyone who wants to integrate RSI context into a more profile oriented workflow.
🔹 Features
1. RSI-Based Distribution Profile
-Builds a histogram of RSI values between 0 and 100.
-The RSI range is divided into a user-defined number of bins (e.g., 30 bins).
-Each bin represents a band of RSI values, such as 0–3.33, 3.33–6.66, ..., 96.66–100.
-For each bar in the lookback period, the script:
-Finds which bin the RSI value belongs to
Adds either:
-1.0 → if using time/frequency
-volume → if using volume-weighted RSI distribution
This creates a clear profile of where RSI has been concentrated over the chosen lookback window.
2. Time / Volume Weighting Mode
Under Profile Settings, you can choose:
-Weight by Volume = false
→ Profile is built using time spent at each RSI level (frequency).
-Weight by Volume = true
→ Profile is built using volume traded at each RSI level.
This flexibility allows you to decide whether you want:
-A pure momentum structure (time spent at each RSI)
-Or a participation-weighted structure (where higher-volume zones are emphasized)
3. Configurable Lookback & Resolution
-Profile Lookback: number of historical bars to analyze.
-Number of Bins: controls the resolution of the histogram:
Fewer bins → smoother, fewer gaps
More bins → more detail, but potentially more visual sparsity
-Profile Width (Bars): defines how wide the histogram extends into the future (visually), converted into time using average bar duration.
This provides a balance between performance, clarity, and visual density.
4. Value Area, POC, VAH, VAL
The script computes:
-POC (Point of Control)
→ The RSI bin with the highest total value (time or volume).
-Value Area (VA)
→ The range of RSI bins that contain a user-specified percentage of total activity (e.g., 70%).
-VAH & VAL
→ Upper and lower RSI boundaries of this Value Area.
These are then drawn as horizontal lines and labeled:
-POC line and label
-VAH line and label
-VAL line and label
This gives you a profile-style view similar to classical volume profile, but entirely on the RSI axis.
5. Color Coding & Visual Design
The histogram bars (boxes) are colored using a smart scheme:
-Below 30 RSI → Oversold zone, uses the Oversold Color (default: green).
-Above 70 RSI → Overbought zone, uses the Overbought Color (default: red).
-Between 30 and 70 RSI → Neutral zone, uses a gradient between:
A soft blue at lower mid levels
A soft orange at higher mid levels
Additional styling:
-POC bin is highlighted in bright yellow.
-Bins inside the Value Area → lower transparency (more solid).
-Bins outside the Value Area → higher transparency (faded).
This makes it easy to visually distinguish:
-Core RSI activity (VA)
-Extremes (oversold/overbought)
-The single dominant zone (POC)
🔹 Calculations
This section summarizes the core logic behind the script and highlights the main building blocks that power the profile.
1. Profile Structure and Bin Initialization
A custom Profile type groups together configuration, bins and drawing objects. During initialization, the script splits the 0 to 100 RSI range into evenly spaced bins, each represented by a Bin record:
method initBins(Profile p) =>
p.bins := array.new()
float step = 100.0 / p.binCount
for i = 0 to p.binCount - 1
float low = i * step
float high = (i + 1) * step
p.bins.push(Bin.new(low, high, 0.0, box(na)))
2. Filling the Profile Over the Lookback Window
On the last bar, the script clears previous drawings and walks backward through the selected lookback window. For each historical bar, it reads the RSI and volume series and feeds them into the profile:
if barstate.islast
myProfile.reset()
int start = math.max(0, bar_index - lookback)
int end = bar_index
for i = 0 to (end - start)
float r = rsi
float v = volume
if not na(r)
myProfile.add(r, v)
The add method converts each RSI value into a bin index and accumulates either a frequency count or the bar volume, depending on the chosen mode:
method add(Profile p, float rsiValue, float volumeValue) =>
int idx = int(rsiValue / (100.0 / p.binCount))
if idx >= p.binCount
idx := p.binCount - 1
if idx < 0
idx := 0
Bin targetBin = p.bins.get(idx)
float addedValue = p.useVolume ? volumeValue : 1.0
targetBin.value += addedValue
3. Finding POC and Building the Value Area
Inside the draw method, the script first scans all bins to determine the maximum value and the total sum. The bin with the highest value becomes the POC. The value area is then constructed by expanding from that center bin until the desired percentage of total activity is covered:
for in p.bins
totalVal += b.value
if b.value > maxVal
maxVal := b.value
pocIdx := i
float vaTarget = totalVal * (p.vaPercent / 100.0)
float currentVaVol = maxVal
int upIdx = pocIdx
int downIdx = pocIdx
while currentVaVol < vaTarget
float upVol = (upIdx < p.binCount - 1) ? p.bins.get(upIdx + 1).value : 0.0
float downVol = (downIdx > 0) ? p.bins.get(downIdx - 1).value : 0.0
if upVol == 0 and downVol == 0
break
if upVol >= downVol
upIdx += 1
currentVaVol += upVol
else
downIdx -= 1
currentVaVol += downVol
Indicateur

Rolling Z-Score Trend [QuantAlgo]🟢 Overview
The Rolling Z-Score Trend measures how far the current price deviates from its rolling mean in terms of standard deviations. It transforms price data into standardized scores to identify overbought and oversold conditions while tracking momentum shifts.
The indicator displays a Z-Score line showing price deviation from statistical norms, with background momentum columns showing the rate of change in these deviations. This helps traders and investors identify mean reversion opportunities and momentum shifts across different asset classes and timeframes.
🟢 How It Works
The indicator uses the Z-Score formula: Z = (X - μ) / σ, where X is the current closing price, μ is the rolling mean, and σ is the rolling standard deviation over a user-defined lookback period. This creates a dynamic baseline that adapts to changing market conditions and standardizes price movements for interpretation across different assets and volatility conditions. The raw Z-Score undergoes 3-period EMA smoothing to reduce noise while maintaining responsiveness to market signals.
Beyond the basic Z-Score calculation, the indicator measures the rate of change in Z-Score values between successive bars, displayed as background momentum columns. This momentum component shows acceleration and deceleration of statistical deviations. All calculations are processed through confirmation filters, displaying signals only on confirmed bars to reduce premature signals based on incomplete price action.
🟢 How to Use
1. Z-Score Interpretation and Threshold Zones
Positive Values (Above Zero) : Price trading above statistical mean, suggesting bullish momentum or potential overbought conditions
Negative Values (Below Zero) : Price trading below statistical mean, suggesting bearish momentum or potential oversold conditions
Zero Line Crosses : Signal transitions between statistical regimes and potential trend changes
Upper Threshold Zone : Area above entry threshold (default 1.5) indicating potential overbought conditions
Lower Threshold Zone : Area below negative entry threshold (default -1.5) indicating potential oversold conditions
Extreme Values (±2.0 or higher) : Statistically significant deviations that may indicate reversal opportunities
2. Momentum Background Analysis and Info Table
Green Columns : Accelerating positive momentum in Z-Score values
Red Columns : Accelerating negative momentum in Z-Score values
Column Height : Magnitude of momentum change between bars
Momentum Divergence : When columns contradict primary Z-Score direction, often signals impending reversals
Info Table : Displays real-time numerical values for both Z-Score and momentum, including trend direction indicators and bar-to-bar change calculations for position management
3. Preconfigured Settings
Default : Balanced performance across multiple timeframes and asset classes for general trading and medium-term position management.
Scalping : Responsive setup for ultra-short-term trading on 1-15 minute charts with frequent signals and increased sensitivity to quick price movements.
Swing Trading : Optimized for multi-day positions with noise filtering, focusing on larger price swings. Most effective on 1-4 hour and daily timeframes.
Trend Following : Maximum smoothing that prioritizes established trends over short-term volatility. Generates fewer signals for daily and weekly charts.
Indicateur

Trend Reversal Probability [Algoalpha]Introducing Trend Reversal Probability by AlgoAlpha – a powerful indicator that estimates the likelihood of trend reversals based on an advanced custom oscillator and duration-based statistics. Designed for traders who want to stay ahead of potential market shifts, this indicator provides actionable insights into trend momentum and reversal probabilities.
Key Features :
🔧 Custom Oscillator Calculation: Combines a dual SMA strategy with a proprietary RSI-like calculation to detect market direction and strength.
📊 Probability Levels & Visualization: Plots average signal durations and their statistical deviations (±1, ±2, ±3 SD) on the chart for clear visual guidance.
🎨 Dynamic Color Customization: Choose your preferred colors for upward and downward trends, ensuring a personalized chart view.
📈 Signal Duration Metrics: Tracks and displays signal durations with columns representing key percentages (80%, 60%, 40%, and 20%).
🔔 Alerts for High Probability Events: Set alerts for significant reversal probabilities (above 84% and 98% or below 14%) to capture key trading moments.
How to Use :
Add the Indicator: Add Trend Reversal Probability to your favorites by clicking the star icon.
Market Analysis: Use the plotted probability levels (average duration and ±SD bands) to identify overextended trends and potential reversals. Use the color of the duration counter to identify the current trend.
Leverage Alerts: Enable alerts to stay informed of high or extreme reversal probabilities without constant chart monitoring.
How It Works :
The indicator begins by calculating a custom oscillator using short and long simple moving averages (SMA) of the midpoint price. A proprietary RSI-like formula then transforms these values to estimate trend direction and momentum. The duration between trend reversals is tracked and averaged, with standard deviations plotted to provide probabilistic guidance on trend longevity. Additionally, the indicator incorporates a cumulative probability function to estimate the likelihood of a trend reversal, displaying the result in a data table for easy reference. When probability levels cross key thresholds, alerts are triggered, helping traders take timely action.
Indicateur

GaussianDistributionLibrary "GaussianDistribution"
This library defines a custom type `distr` representing a Gaussian (or other statistical) distribution.
It provides methods to calculate key statistical moments and scores, including mean, median, mode, standard deviation, variance, skewness, kurtosis, and Z-scores.
This library is useful for analyzing probability distributions in financial data.
Disclaimer:
I am not a mathematician, but I have implemented this library to the best of my understanding and capacity. Please be indulgent as I tried to translate statistical concepts into code as accurately as possible. Feedback, suggestions, and corrections are welcome to improve the reliability and robustness of this library.
mean(source, length)
Calculate the mean (average) of the distribution
Parameters:
source (float) : Distribution source (typically a price or indicator series)
length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
Returns: Mean (μ)
stdev(source, length)
Calculate the standard deviation (σ) of the distribution
Parameters:
source (float) : Distribution source (typically a price or indicator series)
length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
Returns: Standard deviation (σ)
skewness(source, length, mean, stdev)
Calculate the skewness (γ₁) of the distribution
Parameters:
source (float) : Distribution source (typically a price or indicator series)
length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
mean (float) : the mean (average) of the distribution
stdev (float) : the standard deviation (σ) of the distribution
@return Skewness (γ₁)
skewness(source, length)
Overloaded skewness to calculate from source and length
Parameters:
source (float) : Distribution source (typically a price or indicator series)
length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
@return Skewness (γ₁)
mode(mean, stdev, skewness)
Estimate mode - Most frequent value in the distribution (approximation based on skewness)
Parameters:
mean (float) : the mean (average) of the distribution
stdev (float) : the standard deviation (σ) of the distribution
skewness (float) : the skewness (γ₁) of the distribution
@return Mode
mode(source, length)
Overloaded mode to calculate from source and length
Parameters:
source (float) : Distribution source (typically a price or indicator series)
length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
@return Mode
median(mean, stdev, skewness)
Estimate median - Middle value of the distribution (approximation)
Parameters:
mean (float) : the mean (average) of the distribution
stdev (float) : the standard deviation (σ) of the distribution
skewness (float) : the skewness (γ₁) of the distribution
@return Median
median(source, length)
Overloaded median to calculate from source and length
Parameters:
source (float) : Distribution source (typically a price or indicator series)
length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
@return Median
variance(stdev)
Calculate variance (σ²) - Square of the standard deviation
Parameters:
stdev (float) : the standard deviation (σ) of the distribution
@return Variance (σ²)
variance(source, length)
Overloaded variance to calculate from source and length
Parameters:
source (float) : Distribution source (typically a price or indicator series)
length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
@return Variance (σ²)
kurtosis(source, length, mean, stdev)
Calculate kurtosis (γ₂) - Degree of "tailedness" in the distribution
Parameters:
source (float) : Distribution source (typically a price or indicator series)
length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
mean (float) : the mean (average) of the distribution
stdev (float) : the standard deviation (σ) of the distribution
@return Kurtosis (γ₂)
kurtosis(source, length)
Overloaded kurtosis to calculate from source and length
Parameters:
source (float) : Distribution source (typically a price or indicator series)
length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
@return Kurtosis (γ₂)
normal_score(source, mean, stdev)
Calculate Z-score (standard score) assuming a normal distribution
Parameters:
source (float) : Distribution source (typically a price or indicator series)
mean (float) : the mean (average) of the distribution
stdev (float) : the standard deviation (σ) of the distribution
@return Z-Score
normal_score(source, length)
Overloaded normal_score to calculate from source and length
Parameters:
source (float) : Distribution source (typically a price or indicator series)
length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
@return Z-Score
non_normal_score(source, mean, stdev, skewness, kurtosis)
Calculate adjusted Z-score considering skewness and kurtosis
Parameters:
source (float) : Distribution source (typically a price or indicator series)
mean (float) : the mean (average) of the distribution
stdev (float) : the standard deviation (σ) of the distribution
skewness (float) : the skewness (γ₁) of the distribution
kurtosis (float) : the "tailedness" in the distribution
@return Z-Score
non_normal_score(source, length)
Overloaded non_normal_score to calculate from source and length
Parameters:
source (float) : Distribution source (typically a price or indicator series)
length (int) : Window length for the distribution (must be >= 30 for meaningful statistics)
@return Z-Score
method init(this)
Initialize all statistical fields of the `distr` type
Namespace types: distr
Parameters:
this (distr)
method init(this, source, length)
Overloaded initializer to set source and length
Namespace types: distr
Parameters:
this (distr)
source (float)
length (int)
distr
Custom type to represent a Gaussian distribution
Fields:
source (series float) : Distribution source (typically a price or indicator series)
length (series int) : Window length for the distribution (must be >= 30 for meaningful statistics)
mode (series float) : Most frequent value in the distribution
median (series float) : Middle value separating the greater and lesser halves of the distribution
mean (series float) : μ (1st central moment) - Average of the distribution
stdev (series float) : σ or standard deviation (square root of the variance) - Measure of dispersion
variance (series float) : σ² (2nd central moment) - Squared standard deviation
skewness (series float) : γ₁ (3rd central moment) - Asymmetry of the distribution
kurtosis (series float) : γ₂ (4th central moment) - Degree of "tailedness" relative to a normal distribution
normal_score (series float) : Z-score assuming normal distribution
non_normal_score (series float) : Adjusted Z-score considering skewness and kurtosis Bibliothèque

Likelihood of Winning - Probability Density FunctionIn developing the "Likelihood of Winning - Probability Density Function (PDF)" indicator, my aim was to offer traders a statistical tool to quantify the probability of reaching target prices. This indicator, grounded in risk assessment principles, enables users to analyze potential outcomes based on the normal distribution, providing insights into market dynamics.
The tool's flexibility allows for customization of the data series, lookback periods, and target settings for both long and short scenarios. It features a color-coded visualization to easily distinguish between probabilities of hitting specified targets, enhancing decision-making in trading strategies.
I'm excited to share this indicator with the trading community, hoping it will enhance data-driven decision-making and offer a deeper understanding of market risks and opportunities. My goal is to continuously improve this tool based on user feedback and market evolution, contributing to more informed trading practices.
This indicator leverages the "NormalDistributionFunctions" library, enabling easy integration into other indicators or strategies. Users can readily embed advanced statistical analysis into their trading tools, fostering innovation within the Pine Script community. Indicateur

NormalDistributionFunctionsLibrary "NormalDistributionFunctions"
The NormalDistributionFunctions library encompasses a comprehensive suite of statistical tools for financial market analysis. It provides functions to calculate essential statistical measures such as mean, standard deviation, skewness, and kurtosis, alongside advanced functionalities for computing the probability density function (PDF), cumulative distribution function (CDF), Z-score, and confidence intervals. This library is designed to assist in the assessment of market volatility, distribution characteristics of asset returns, and risk management calculations, making it an invaluable resource for traders and financial analysts.
meanAndStdDev(source, length)
Calculates and returns the mean and standard deviation for a given data series over a specified period.
Parameters:
source (float) : float: The data series to analyze.
length (int) : int: The lookback period for the calculation.
Returns: Returns an array where the first element is the mean and the second element is the standard deviation of the data series for the given period.
skewness(source, mean, stdDev, length)
Calculates and returns skewness for a given data series over a specified period.
Parameters:
source (float) : float: The data series to analyze.
mean (float) : float: The mean of the distribution.
stdDev (float) : float: The standard deviation of the distribution.
length (int) : int: The lookback period for the calculation.
Returns: Returns skewness value
kurtosis(source, mean, stdDev, length)
Calculates and returns kurtosis for a given data series over a specified period.
Parameters:
source (float) : float: The data series to analyze.
mean (float) : float: The mean of the distribution.
stdDev (float) : float: The standard deviation of the distribution.
length (int) : int: The lookback period for the calculation.
Returns: Returns kurtosis value
pdf(x, mean, stdDev)
pdf: Calculates the probability density function for a given value within a normal distribution.
Parameters:
x (float) : float: The value to evaluate the PDF at.
mean (float) : float: The mean of the distribution.
stdDev (float) : float: The standard deviation of the distribution.
Returns: Returns the probability density function value for x.
cdf(x, mean, stdDev)
cdf: Calculates the cumulative distribution function for a given value within a normal distribution.
Parameters:
x (float) : float: The value to evaluate the CDF at.
mean (float) : float: The mean of the distribution.
stdDev (float) : float: The standard deviation of the distribution.
Returns: Returns the cumulative distribution function value for x.
confidenceInterval(mean, stdDev, size, confidenceLevel)
Calculates the confidence interval for a data series mean.
Parameters:
mean (float) : float: The mean of the data series.
stdDev (float) : float: The standard deviation of the data series.
size (int) : int: The sample size.
confidenceLevel (float) : float: The confidence level (e.g., 0.95 for 95% confidence).
Returns: Returns the lower and upper bounds of the confidence interval. Bibliothèque

Normal Distribution Asymmetry & Volatility ZonesNormal Distribution Asymmetry & Volatility Zones Indicator provides insights into the skewness of a price distribution and identifies potential volatility zones in the market. The indicator calculates the skewness coefficient, indicating the asymmetry of the price distribution, and combines it with a measure of volatility to define buy and sell zones.
The key features of this indicator include :
Skewness Calculation : It calculates the skewness coefficient, a statistical measure that reveals whether the price distribution is skewed to the left (negative skewness) or right (positive skewness).
Volatility Zones : Based on the skewness and a user-defined volatility threshold, the indicator identifies buy and sell zones where potential price movements may occur. Buy zones are marked when skewness is negative and prices are below a volatility threshold. Sell zones are marked when skewness is positive and prices are above the threshold.
Signal Source Selection : Traders can select the source of price data for analysis, allowing flexibility in their trading strategy.
Customizable Parameters : Users can adjust the length of the distribution, the volatility threshold, and other parameters to tailor the indicator to their specific trading preferences and market conditions.
Visual Signals : Buy and sell zones are visually displayed on the chart, making it easy to identify potential trade opportunities.
Background Color : The indicator changes the background color of the chart to highlight significant zones, providing a clear visual cue for traders.
By combining skewness analysis and volatility thresholds, this indicator offers traders a unique perspective on potential market movements, helping them make informed trading decisions. Please note that trading involves risks, and this indicator should be used in conjunction with other analysis and risk management techniques. Indicateur

Indicateur

RSI is in Normal Distribution?Does RSI Follow a Normal Distribution?
The value of RSI was converted to a value between 0~2, 2~4, ..., 98~100, and the number of samples was graphed.
The Z values are expressed so that the values corresponding to 30 and 70 of the RSI can be compared with the standard normal distribution.
Additionally, when using the RSI period correction function of the 'RSI Candle Advanced V2' indicator that I made before, it shows no change in standard deviation.
RSI는 정규분포를 따를까요
RSI의 값을 0~2, 2~4, ..., 98~100 사이 값으로 변환하고 그 표본 갯수를 그래프로 표현하였습니다.
Z 값은 RSI의 30, 70에 해당하는 값을 표준정규분포와 비교할 수 있도록 표현하였습니다.
추가적으로 제가 예전에 만들었던 'RSI Candle Advanced V2' 지표의 RSI 기간 보정 함수를 사용할 경우 표준편차의 변화가 없음을 보입니다.
Indicateur

Indicateur

Bibliothèque

Bibliothèque

ctndLibrary "ctnd"
Description:
Double precision algorithm to compute the cumulative trivariate normal distribution
found in A.Genz, Numerical computation of rectangular bivariate and trivariate normal
and t probabilities”, Statistics and Computing, 14, (3), 2004. The cumulative trivariate
normal is needed to price window barrier options, see G.F. Armstrong, Valuation formulae
or window barrier options”, Applied Mathematical Finance, 8, 2001.
References:
link.springer.com
www.tandfonline.com
citeseerx.ist.psu.edu
The Complete Guide to Option Pricing Formulas, 2nd ed. (Espen Gaarder Haug)
CTND(LIMIT1, LIMIT2, LIMIT3, SIGMA1, SIGMA2, SIGMA3)
Returns the Cumulative Trivariate Normal Distribution
Parameters:
LIMIT1 : float,
LIMIT2 : float,
LIMIT3 : float,
SIGMA1 : float,
SIGMA2 : float,
SIGMA3 : float,
Returns: float. Bibliothèque

Bibliothèque

Bibliothèque

Indicateur

Indicateur

Probability Distribution HistogramProbability Distribution Histogram
During data exploration it is often useful to plot the distribution of the data one is exploring. This indicator plots the distribution of data between different bins.
Essentially, what we do is we look at the min and max of the entire data set to determine its range. When we have the range of the data, we decide how many bins we want to divide this range into, so that the more bins we get, the smaller the range (a.k.a. width) for each bin becomes. We then place each data point in its corresponding bin, to see how many of the data points end up in each bin. For instance, if we have a data set where the smallest number is 5 and the biggest number is 105, we get a range of 100. If we then decide on 20 bins, each bin will have a width of 5. So the left-most bin would therefore correspond to values between 5 and 10, and the bin to the right would correspond to values between 10 and 15, and so on.
Once we have distributed all the data points into their corresponding bins, we compare the count in each bin to the total number of data points, to get a percentage of the total for each bin. So if we have 100 data points, and the left-most bin has 2 data points in it, that would equal 2%. This is also known as probability mass (or well, an approximation of it at least, since we're dealing with a bin, and not an exact number).
Usage
This is not an indicator that will give you any trading signals. This indicator is made to help you examine data. It can take any input you give it and plot how that data is distributed.
The indicator can transform the data in a few ways to help you get the most out of your data exploration. For instance, it is usually more accurate to use logarithmic data than raw data, so there is an option to transform the data using the natural logarithmic function. There is also an option to transform the data into %-Change form or by using data differencing.
Another option that the indicator has is the ability to trim data from the data set before plotting the distribution. This can help if you know there are outliers that are made up of corrupted data or data that is not relevant to your research.
I also included the option to plot the normal distribution as well, for comparison. This can be useful when the data is made up of residuals from a prediction model, to see if the residuals seem to be normally distributed or not.
Indicateur

ema exhaustion (exa)The exa is an oscillator that combines fisher transform with distance from moving average and it is based on a theory that exhaustion can be derived from how far price is able to extend from a moving average, on average.
The fisher transform converts price into a gaussian normal distribution, also known as a bell curve {1}. A normal distribution is a type of probability distribution for a real-valued random variable {2}. Applying this method to the price of an asset can help to identify probabilities, but it will never identify certainties.
‘exa’ is an abbreviation for ema exhaustion. It can be used to identify when price is probable to revert to the mean but I prefer using it to confirm entries that are signaled following a reversion to the mean (aka buying the dip in bull markets). When price gets oversold into support, in a bull trend, then that can provide a good opportunity to enter long. However that isn’t necessarily the case when the same metrics indicate oversold conditions in a bear trend. In this situation the exa is best suited for identifying profit taking opportunities on shorts.
The default settings are a 9 lookback period and a 50 ema. By default signals will be derived from how far price is from the 50 ema relative to the probable distribution of the last 9 periods. If the exa is above 2, or below -2, then the price is in the 80th percentile of the prior 9 candles. Being outside of 3, or -3, represents the 90th percentile and 4, or -4, represents the 95th percentile.
Those ranges will never indicate a necessity of reverting to the mean, but they will indicate a higher and higher probability. I prefer to use this oscillator in combination with an indicator(s) that identifies the trend. When the oscillator reaches -2 in a bull trend then it can confirm long entry signals, whereas if it reaches +2 in a bull trend then it can be used to confirm signals to take profit.
Crossovers are especially significant because they indicate a shift in the tide. When the exa reaches 2 without crossing over then it is very much in a position to move to 3 or 4+. When it crosses above 2 then it is an indication that price is extended from the mean and exhausted.
This is certainly not a situation that implies price will revert to the mean, it simply provides confirmation.
The default settings are what I have been finding most effective personally, however that is mostly a function of the trend following tools that I use. The same principles should apply with all settings and I would encourage users to experiment with various lookback periods and emas.
{1} www.investopedia.com
{2} en.wikipedia.org
Indicateur
