Session Highlighter (Asia/London/NY)Session Highlighter (Asia/London/NY)
This custom TradingView indicator visually highlights the three major trading sessions — Asia, London, and New York — directly on your chart.
Asia Session (8 PM – 4 AM NY Time) is shaded light red
London Session (3 AM – 11 AM NY Time) is shaded light green
New York Session (8 AM – 5 PM NY Time) is shaded light brown
This makes it easy to quickly see which session you’re in, identify overlaps (such as London–New York), and analyze session-based price behavior.
You can customize the colors in the settings panel to match your chart theme.
Indicatori e strategie
MultiScalpMACDThis indicator, the "Custom MACD MTF," is an adaptive version of the classic Moving Average Convergence Divergence (MACD) that automatically adjusts its parameters based on the chart's timeframe. It is designed to provide more fine-tuned momentum readings for traders who focus on specific intraday timeframes.
Overview
The "Custom MACD MTF" modifies the standard MACD calculation by applying unique settings for the 5-minute, 15-minute, and 1-hour charts. For all other timeframes, it reverts to the user-defined default values. This dynamic adjustment allows the indicator to better reflect the momentum characteristics of different trading sessions without requiring manual changes from the user.
Key Features
Adaptive Parameters: The indicator automatically uses optimized MACD settings for popular timeframes:
5-minute: Fast Length = 3, Slow Length = 10, Signal Length = 16
15-minute: Fast Length = 8, Slow Length = 17, Signal Length = 9
1-hour: Fast Length = 12, Slow Length = 26, Signal Length = 9
Momentum-Based Histogram: The histogram bars are colored to provide a clear visual cue about changes in momentum. A light gray bar indicates that momentum is increasing (the current bar is higher than the previous one), while a dark gray bar indicates that momentum is decreasing.
Clear Visual Plots: The indicator plots a pink MACD line, a black signal line, and a gray zero line for easy interpretation of crossovers and trend direction.
How to Interpret
This indicator can be used in the same way as a traditional MACD, but with added sensitivity on the specified timeframes. Traders can look for MACD and signal line crossovers, zero-line crosses, and divergences to identify potential trade signals. The histogram's color change provides an early warning that momentum is either accelerating or decelerating, which can precede a change in price direction.
Settings
Fast Length (Default): The default fast EMA period used for all timeframes except 5m, 15m, and 1h.
Slow Length (Default): The default slow EMA period used for all timeframes except 5m, 15m, and 1h.
Signal Length (Default): The default signal line EMA period used for all timeframes except 5m, 15m, and 1h.
Source: The price source for the MACD calculation (default is Close).
DMI Histogram IndicatorThe Directional Movement Index (DMI) was originally developed by J. Welles Wilder Jr. in 1978. Wilder introduced the DMI along with the Average Directional Index (ADX) in his book, “New Concepts in Technical Trading Systems,” which became a foundational reference for technical analysis.
The indicator can be a bit intimidating for people to interpret if they aren't familiar with it. So this DMI Histogram uses the underlying DMI data to present a different way to visualize the price movement and trend. The goal is to help provide insight into the rising or falling momentum behind the price, at times when the chart itself may not be as obvious. This could potentially help spot a momentum divergence before it plays out on the chart.
The user has the option of displaying ADX reversals as red and green arrows. The ADX is the trend indicator portion of the DMI. When it changes direction, that sometimes leads to shift in who is exerting the most influence on the price, buyers or sellers.
The user also has the option of coloring the candlesticks to match the histogram.
This indicator is meant to be combined with other indicators and other chart analysis tools.
Market Structure - BOS LinesMarket Structure - BOS Lines individuazione delle 3cf e segnalazione con il bos
Session Based ADXThis is an ADX indicator that allows you to focus on specific time frames. it also has a feature to put a 20 or a 25 line so you can see when the moving average crosses above it.
20 EMA Cross 50 EMA + 4-5 Week Consolidation + Volume BreakoutBullish cross with consolidation and volume breakout
EMA (20, 50, 100, 200) incl. TIMEFRAME!Multi-Timeframe EMA Indicator
Indicator designed for TradingView that plots up to four distinct Exponential Moving Average (EMA) lines on your chart. The script is highly flexible, allowing you to configure each EMA's length and color individually. Additionally, it features a crucial timeframe parameter, which enables you to apply the EMAs from a different, higher timeframe directly to your current chart.
Key Features:
Four Independent EMAs : The indicator calculates and displays four separate EMA lines simultaneously. The default lengths are set to the popular values of 20, 50, 100, and 200, which are commonly used for short-term, medium-term, and long-term trend analysis.
Customizable Length and Color: You have full control over each EMA. In the indicator's settings, you can easily change the length of each moving average to suit your trading strategy. You can also customize the color of each line, making it easy to distinguish them on the chart.
Multi-Timeframe Analysis (MTF) : The most powerful feature is the timeframe parameter. By entering a different timeframe (e.g., "D" for daily, "W" for weekly, or "60" for hourly), the indicator will calculate the EMAs based on that specific timeframe's data, regardless of your chart's current resolution. This is invaluable for traders who want to see long-term trends on a short-term chart without having to switch timeframes.
Heavy Buy/Sell + Traps + FVG (Options) – Cleanthis script under testing stage so it is not accurate so please make buy & sell decision wisely
Anrazzi - EMAs/ATR - 1.0.2Description:
The Anrazzi - EMAs/ATR indicator is a versatile tool for technical traders looking to monitor multiple moving averages alongside the Average True Range (ATR) on any chart. Designed for simplicity and customization, it allows traders to visualize up to six moving averages with configurable type, color, and length, while keeping real-time volatility information via ATR directly on the chart.
This indicator is perfect for spotting trends, identifying support/resistance zones, and gauging market volatility for intraday or swing trading strategies.
Key Features:
Supports up to six independent moving averages (MA1 → MA6)
Each MA is fully customizable:
Enable/disable individually
Type: EMA or SMA
Length
Color
ATR Display:
Custom timeframe
Color and position configurable
Adjustable multiplier
Compact and organized settings for easy configuration
Lightweight and efficient code for smooth chart performance
Watermark
Inputs / Settings:
MA Options: MA1 → MA6 (Enable/Disable, Type, Length, Color)
Additional Settings: ATR (Enable, Timeframe, Color, Multiplier)
How to Use:
Enable the moving averages you want to track
Configure type, length, and color for each MA
Enable ATR if needed and adjust settings
Watch MAs plotted dynamically and ATR in bottom-right corner
Recommended For:
Day traders and swing traders
Trend-following strategies
Volatility analysis and breakout detection
Traders needing a compact multi-MA dashboard
Session Based ADXAn ADX indicator with the added feature of inputting specific times. It also allows you to have a ADX 25 and ADX 20 line to visually see when the MA crosses over.
Note: By default, the line is white. Just simply change to whatever color preference you would like.
Camarilla 4-Scenario Scanner --MCXCamrilla values L3,L4,H3,H4 gives where the mcx commodities and based on that we can trade
Sero📌 sero Indicator – Guide & Explanation
What the Indicator Does
The sero Indicator is a custom oscillator designed to identify market momentum shifts between bullish (pump) and bearish (dump) phases. It works by normalizing price action using a range calculation, then smoothing it with an EMA. The resulting line (sero value) oscillates on a scale around 0 to 100, giving clear visual cues about momentum strength.
Key concepts inside the code:
c0 → The average price for each bar (High + Low + Close ÷ 3).
a1 & a2 → The 15-bar highest and lowest values of this average price.
a3 → The range (difference between high and low).
sero → A smoothed (EMA-based) normalized oscillator that fluctuates with momentum strength.
The indicator then highlights pumps (upward momentum) and dumps (downward momentum ) with color-coded line breaks.
How It Looks on Chart
When loaded, you’ll see:
A yellow oscillator line (sero) moving up and down.
Red segments on the line → mark slow or strong pumps (bullish momentum).
Green segments on the line → mark slow or strong dumps (bearish momentum).
These color changes act as momentum confirmation signals.
Signals & Interpretation
sero Line (Yellow)
The main oscillator line.
Higher readings = strong bullish momentum.
Lower readings = strong bearish momentum.
Red Segments (Pump Detection)
Appear when sero rises above its previous value.
Thicker Red Line = Stronger pump (sero > 20).
Suggests upward price acceleration.
Green Segments (Dump Detection)
Appear when sero falls below its previous value.
Thicker Green Line = Stronger dump (sero < 20).
Suggests downward price acceleration.
How to Use the sero Indicator
✅ Trend Confirmation
Use sero alongside your main chart to confirm trend direction.
Sustained red (pump) signals = bullish phase.
Sustained green (dump) signals = bearish phase.
✅ Momentum Shifts
Watch for changes in color (from green → red or red → green). These flips may indicate a potential reversal or acceleration in trend.
✅ Threshold Levels (20 level)
The code emphasizes the 20 threshold:
Pump signals above 20 → more reliable bullish confirmation.
Dump signals below 20 → stronger bearish conviction.
✅ Entry & Exit Support
Enter long trades when yellow line rises and red pump segments form.
Enter short trades when yellow line falls and green dump segments form.
Consider exits when momentum color weakens or flips direction.
Best Practices
Always combine with price action, support/resistance, or volume analysis.
Works best on shorter timeframes (intraday scalping/day trading).
Avoid relying on a single pump/dump signal – wait for consistency across multiple bars.
Summary
The sero Indicator is a momentum oscillator that visually highlights bullish and bearish momentum using dynamic color changes. Traders can use it to spot pumps, dumps, and trend shifts more easily than with traditional oscillators.
I welcome your feedback on this analysis/minds/indicator, as it will inform and enhance my future work.
Regards,
Shunya.Trade
world wide web shunya dot trade
BTC 2024 Toolkit (MAs, BB, Niveles, Eventos)Main uptrend following the March 2024 ATH; correction in April (before/after the halving) and capitulation in August with a rebound.
Key zones drawn in the script: 73–74k (resistance/ceiling), 68–70k, and 64.2k/61.3k/58.4k (pullbacks), plus 49–53k (August floor).
The 50/100/200 MAs are sloping upward at the yearly close; Bollinger Bands are free of prolonged excesses.
Bias: Bullish, buy on pullbacks/pullbacks.
Entry A (breakout throwback): Wait for a breakout and a pullback that respects 73–74k as new support.
Entry B (range pullback): Staggered buys at 68–70k and, if there is further weakness, at 64–65k.
Invalidation/Stop: Daily close < 59–60k (loss of range/structure).
Targets:
TP1: 92–95k (natural post-breakout extension).
TP2: 100k+ if MAs remain upward and momentum holds.
Rationale: The 73–74k level is the "pivot" for the year; buying the pullback to that area (or to 68–70k) offers a better risk/reward than chasing the price. The stop below 60k limits exposure if the breakout fails.
Sessions Highs/LowsThis indicator plots the High and Low of the three main trading sessions:
Asia (20:00–03:00) – green lines
London (03:00–08:00) – blue lines
New York (08:00–13:00) – red lines
Features:
Levels update in real time during each session.
When a new session starts, the previous lines are deleted – only the latest active sessions remain visible.
Default session times are set to Asia (20:00–03:00), London (03:00–08:00), and New York (08:00–13:00), but you can adjust them to your own custom hours in the settings.
Colors can also be customized.
Use cases:
Quickly visualize session ranges.
Track session highs/lows for breakouts, fakeouts, and reactions around liquidity zones.
SMT Divergences Dual Lookback - MoonTradesThis Pine Script, titled "SMT Divergences Dual Lookback", is designed to detect and visualize divergences between two comparison symbols (symbols A and B) using two different lookback periods. The script specifically identifies bullish and bearish divergences based on pivot highs and lows and marks them on the chart with color-coded labels.
Bullish Divergence (Swing High) is marked when a price swing low diverges from a pivot low, indicating potential upward momentum.
Bearish Divergence (Swing Low) is marked when a price swing high diverges from a pivot high, indicating potential downward momentum.
The script works with two customizable comparison symbols and can also apply a specific timeframe for divergence detection (separate from the chart’s default timeframe). The results are displayed with labels showing the corresponding symbols, helping traders identify potential reversal points or continuation trends.
Users can customize the lookback periods and the colors for the divergence markers. This tool aids in technical analysis for traders who focus on multi-timeframe and multi-symbol divergence strategies.
EMA (9, 21, 40, 200) - sachinlchaudhariThis is a combine indicator for Exponential Moving Averages EMA (9, 21, 40, 200).
It also displays the Average True Range (ATR) value and Relative Strength Index (RSI) value.
Omega ATR Indicator📖 Introduction
The Ω ATR Indicator was created to provide a more complete and professional framework for volatility analysis than the classic Average True Range (ATR).
While the traditional ATR is a useful tool, it has limitations: it delivers a simple rolling average of volatility, but it does not adapt to market regimes, it does not highlight extreme events, and it often leaves the trader with incomplete information about risk.
The Ω ATR takes the same foundation and elevates it into a multi-dimensional volatility dashboard, adding statistical layers, adaptive calculations, and clear visual references that allow traders to interpret volatility in a way that is immediately actionable.
🔎 What makes it different from a standard ATR?
This indicator introduces several features beyond the classic formula:
True Range Core – plots the raw True Range (TR) for each bar, providing a direct, bar-by-bar view of volatility impulses.
Standard & Adjusted ATR – includes both the conventional ATR (smoothed average) and an Adjusted ATR that automatically corrects for extreme conditions by incorporating percentile rescaling.
Percentile Volatility Levels – dynamically calculated extreme thresholds (99.8%, 75%, 50%, 25%), plotted as dotted levels across the chart. These act as reference lines for “normal” vs. “abnormal” volatility, useful for spotting unusual price expansions or contractions.
Linear Regression Volatility Trend – overlays a regression line of volatility, showing whether the market is moving toward expansion (rising vol), contraction (falling vol), or stability.
Monetary Value Translation – the indicator converts volatility into points, ticks, and dollar values (based on the instrument’s point value). This allows futures traders and high-value instruments users to immediately see how much volatility is “worth” in cash terms.
Interactive Table Display – a real-time statistics table is displayed directly on the chart, showing:
SMA of ATR in $ and points
Percentile-based volatility range (VAR) in $ and points
Tick equivalences, for quick position sizing
⚡ How traders can use it
The Ω ATR Indicator is designed to be versatile, fitting both discretionary traders and systematic strategy developers.
Risk Management: ATR-based stop losses and position sizing are significantly improved by using the adjusted ATR and percentile thresholds. Traders can size their positions according to volatility regimes, not just raw averages.
Breakout & Exhaustion Detection: When TR or ATR values spike above the 99.8% or 95% percentile levels, this often corresponds to breakout conditions or volatility exhaustion — useful for breakout strategies, mean-reversion setups, and volatility fades.
Market Regime Identification: The regression line helps distinguish if volatility is rising (trending environment, larger swings expected) or compressing (range-bound environment, lower risk opportunities).
Multi-Asset Flexibility: Works equally well on equities, futures, crypto, and FX. Its point/tick/dollar conversion makes it especially powerful for futures traders who need to quantify risk precisely.
Scalping to Swing Trading: On lower timeframes, it acts as a micro-volatility detector; on higher timeframes, it functions as a strategic risk gauge for position management.
⚙️ Settings and Customization
Length: The ATR lookback period (default = 34).
Shorter lengths (14–21) for intraday traders who want fast response.
Longer lengths (34–55) for swing/position traders who want smoother readings.
AVG / ADJ AVG: Toggle to display the standard ATR or the adjusted ATR.
Volatility Levels: Enable/disable up to 4 percentile-based levels (1st = 25%, 2nd = 50%, 3rd = 75%, 4th = 99.8%). Recommended: keep 3 levels active for clarity.
Color Controls: All plots and levels are fully customizable to match your chart style.
Table Display: Positioned on the chart (default: middle-right) with key values updated in real time.
🧭 Best Practices for Use
Combine with Trend Tools: Volatility readings are most powerful when combined with trend filters or volume analysis. For example, a breakout with both high volatility and trend confirmation is stronger than either alone.
ATR Stops: Use the Adjusted ATR rather than the standard one when trailing stops in highly volatile instruments like crypto or Nasdaq futures, as it adapts to outlier spikes.
Dollar Risk Translation: Use the dollar-value outputs to predefine maximum acceptable risk per trade (e.g., “I only risk $250 per position”). This bridges volatility to portfolio risk management.
Event Monitoring: Around economic events or earnings, expect volatility spikes above higher percentile levels. The indicator makes these moves instantly visible.
📌 Summary
The Ω ATR Indicator is not just “another ATR.” It is a comprehensive volatility framework that transforms volatility from a simple statistic into an actionable trading signal.
By combining:
the classic ATR,
an adjusted ATR,
percentile extremes,
regression-based volatility trends,
and real-time dollar conversions,
…this tool allows traders to precisely understand, visualize, and act on volatility in ways that a standard ATR simply cannot provide.
Whether you are scalping intraday moves, swing trading equities, or managing futures positions, the Ω ATR equips you with a professional-grade volatility dashboard that clarifies risk, highlights opportunity, and adapts across all markets and timeframes.
👉 Designed and developed by OmegaTools for traders who demand precision, clarity, and adaptability in their volatility analysis.
DistributionTestLibrary "DistributionTest"
Comprehensive statistical distribution library for quantitative finance and trading applications.
Provides complete statistical functions including PDF, CDF, quantile (inverse CDF), survival functions, random sampling, and moment calculations for essential probability distributions.
All code has been verified (using AI) against authoritative mathematical sources, including:
- Wikipedia: en.wikipedia.org
- Wolfram MathWorld: mathworld.wolfram.com
- All formulas have been cross-validated for mathematical accuracy.
See: Distributions.UTests for extensive unit tests covering all functions and edge cases.
Supported Distributions:
Normal : Gaussian distribution with mean (μ) and standard deviation (σ) - Foundation of MPT, CAPM, and traditional risk models (assumptions often violated by fat tails)
Uniform : Continuous uniform distribution over interval - Essential for Monte Carlo simulations and random sampling in trading systems
Triangular : Triangular distribution with min, max, and mode parameters - Expert judgment modeling with optimistic/pessimistic/most likely scenarios
Beta : Beta distribution with shape parameters α and β over interval - Bayesian finance, mean reversion modeling, and proportion parameters (hit rates, portfolio weights)
Log-Normal : Log-normal distribution for positive values (stock prices, volatility) - Black-Scholes options pricing foundation, ensures non-negative asset prices
Student's t : Heavy-tailed distribution with degrees of freedom parameter - Heavy-tail VaR calculations, superior for extreme risk at >98.5% confidence levels
Laplace : Double exponential distribution with location and scale parameters - Volatility modeling with sharp peaks and heavy tails for market regime changes
Exponential : Exponential distribution for time-to-event modeling - Time-to-event modeling for trade duration and market microstructure analysis
Gamma : Gamma distribution for extreme values and waiting times - Operational risk, aggregate loss modeling, and flexible skewed phenomena
Core Statistical Functions:
PDF : Probability density function - likelihood of specific values
CDF : Cumulative distribution function - probability of values ≤ x
Quantile : Inverse CDF - critical for Value-at-Risk (VaR) calculations
Survival : Tail probability function - probability of values > x
Sample : Random number generation for Monte Carlo simulations
Moments : Mean, variance, skewness, kurtosis for distribution characterization
Object-Oriented Interface:
import Kabua/Distributions/1 as dist
// Risk Management Examples
normal = dist.createNormal(0.0, 0.02) // 2% daily vol for basic VaR
studentt = dist.createStudentT(5.0) // Heavy-tailed returns for stress testing
var_95 = studentt.quantile(0.05) // 5% Value-at-Risk threshold
tail_risk = studentt.survival(2.0) // P(X > 2.0) extreme event probability
// Options Pricing Examples
lognormal = dist.createLogNormal(0.05, 0.2) // Stock with 5% drift, 20% vol
stock_price = lognormal.sample(1234) // Simulate future stock price
call_prob = lognormal.survival(110.0) // P(Stock > Strike) for call option
// Monte Carlo Backtesting
uniform = dist.createUniform(0.0, 1.0) // Random number generation
random_sequence = uniform.sample(1234) // Randomize trade order
// Expert Judgment Modeling
triangular = dist.createTriangular(0.8, 1.2, 1.0) // Price target: pessimistic/optimistic/most likely
expected_target = triangular.mean() // Expected price target
// Bayesian Analysis
beta = dist.createBeta(8.0, 2.0) // Success rate prior (80% hit rate)
hit_rate_sample = beta.sample(1234) // Sample hit rate for strategy
// Market Microstructure
exponential = dist.createExponential(0.1) // Trade arrival rate (10 trades/minute)
time_to_next_trade = exponential.sample(1234) // Time until next trade
Trading Applications by Use Case:
Options Pricing : Log-Normal (Black-Scholes foundation)
Risk Management : Student's t (VaR), Normal (traditional), Laplace (regime changes)
Monte Carlo Simulation : Uniform (random generation), Normal (baseline scenarios)
Uncertainty Modeling : Triangular (expert judgment), Beta (Bayesian priors)
Market Microstructure : Exponential (trade timing), Gamma (event clustering)
Portfolio Theory : Normal (MPT), Beta (mean reversion), Log-Normal (growth)
Distribution Selection Guide:
Need non-negative values? → Log-Normal, Exponential, Gamma
Modeling extreme events? → Student's t, Laplace, Gamma
Expert judgment with bounds? → Triangular, Beta
Traditional finance models? → Normal (with caveats)
Random sampling/simulation? → Uniform (foundation)
Time-to-event modeling? → Exponential, Gamma
Bayesian analysis? → Beta, Normal (conjugate priors)
Important Limitations:
Normal Distribution : Severely underestimates tail risk, assumes symmetric returns
Log-Normal : Cannot model negative returns, assumes constant volatility
Student's t : Symmetric (no skewness), infinite variance for low df
Uniform : Unrealistic for actual return modeling, simulation foundation only
Beta : Bounded to , may need scaling for real-world applications
Triangular : Limited flexibility, requires expert bounds estimation
Laplace : Sharp peak assumption may not fit all return distributions
Exponential : Memoryless property may not reflect market clustering
Gamma : Complex parameterization, may require calibration
createNormal(mu, sigma)
Create Normal distribution N(μ, σ²)
Parameters:
mu (float) : Mean parameter (location)
sigma (float) : Standard deviation parameter (scale > 0)
Returns: Distribution Normal distribution instance
createUniform(min, max)
Create Uniform distribution U(min, max)
Parameters:
min (float) : Minimum value (lower bound)
max (float) : Maximum value (upper bound > min)
Returns: Distribution Uniform distribution instance
createTriangular(min, max, mode)
Create Triangular distribution
Parameters:
min (float) : Minimum value (lower bound)
max (float) : Maximum value (upper bound > min)
mode (float) : Mode value (min ≤ mode ≤ max)
Returns: Distribution Triangular distribution instance
createBeta(alpha, beta)
Create Beta distribution Beta(α, β)
Parameters:
alpha (float) : First shape parameter (α > 0)
beta (float) : Second shape parameter (β > 0)
Returns: Distribution Beta distribution instance
createLogNormal(mu, sigma)
Create Log-Normal distribution
Parameters:
mu (float) : Mean of underlying normal distribution (location)
sigma (float) : Standard deviation of underlying normal distribution (scale > 0)
Returns: Distribution Log-Normal distribution instance
createStudentT(nu)
Create Student's t-distribution
Parameters:
nu (float) : Degrees of freedom (ν > 0)
Returns: Distribution Student's t-distribution instance
createLaplace(mu, b)
Create Laplace distribution (Double Exponential)
Parameters:
mu (float) : Location parameter (mean)
b (float) : Scale parameter (b > 0)
Returns: Distribution Laplace distribution instance
createExponential(lambda)
Create Exponential distribution
Parameters:
lambda (float) : Rate parameter (λ > 0)
Returns: Distribution Exponential distribution instance
createGamma(alpha, beta)
Create Gamma distribution
Parameters:
alpha (float) : Shape parameter (α > 0)
beta (float) : Scale parameter (β > 0)
Returns: Distribution Gamma distribution instance
method pdf(this, x)
Probability density function (polymorphic dispatch)
Namespace types: Distribution
Parameters:
this (Distribution) : Distribution instance
x (float) : Value to evaluate
Returns: float PDF value f(x)
method cdf(this, x)
Cumulative distribution function (polymorphic dispatch)
Namespace types: Distribution
Parameters:
this (Distribution) : Distribution instance
x (float) : Value to evaluate
Returns: float CDF value P(X ≤ x)
method quantile(this, p)
Quantile function - inverse CDF (polymorphic dispatch)
Namespace types: Distribution
Parameters:
this (Distribution) : Distribution instance
p (float) : Probability (0 < p < 1)
Returns: float Quantile value x such that P(X ≤ x) = p
method survival(this, x)
Survival function (polymorphic dispatch)
Namespace types: Distribution
Parameters:
this (Distribution) : Distribution instance
x (float) : Value to evaluate
Returns: float Survival value P(X > x) = 1 - F(x)
method sample(this, seed)
Random sampling (polymorphic dispatch)
Namespace types: Distribution
Parameters:
this (Distribution) : Distribution instance
seed (int) : Random seed for deterministic output
Returns: float Random sample from distribution
method mean(this)
Distribution mean (polymorphic dispatch)
Namespace types: Distribution
Parameters:
this (Distribution) : Distribution instance
Returns: float Expected value E
method variance(this)
Distribution variance (polymorphic dispatch)
Namespace types: Distribution
Parameters:
this (Distribution) : Distribution instance
Returns: float Variance Var
method stddev(this)
Distribution standard deviation (polymorphic dispatch)
Namespace types: Distribution
Parameters:
this (Distribution) : Distribution instance
Returns: float Standard deviation σ = √Var
method skewness(this)
Distribution skewness (polymorphic dispatch)
Namespace types: Distribution
Parameters:
this (Distribution) : Distribution instance
Returns: float Skewness coefficient
method kurtosis(this)
Distribution kurtosis (polymorphic dispatch)
Namespace types: Distribution
Parameters:
this (Distribution) : Distribution instance
Returns: float Kurtosis coefficient
method testProperties(this, numSamples, seed)
Test statistical properties of a distribution
Namespace types: Distribution
Parameters:
this (Distribution) : Distribution instance
numSamples (int) : Number of samples to generate (default: 1000)
seed (int) : Random seed for reproducible tests (default: 9999)
Returns: string Statistical summary for validation
Distribution
Distribution Core statistical distribution with polymorphic interface
Fields:
distributionType (series DistributionType) : Type of statistical distribution
param1 (series float) : First parameter (μ for Normal/LogNormal, min for Uniform/Triangular, α for Beta, ν for StudentT, μ for Laplace, λ for Exponential, α for Gamma)
param2 (series float) : Second parameter (σ for Normal/LogNormal, max for Uniform/Triangular, β for Beta/Gamma, b for Laplace, unused for StudentT/Exponential)
param3 (series float) : Third parameter (mode for Triangular, unused for others)
Grand Master's Candlestick Dominance (ATR Enhanced)### Grand Master's Candlestick Dominance (ATR Enhanced)
**Overview**
Unleash the ancient wisdom of Japanese candlestick charting with a modern twist! This comprehensive Pine Script v5 strategy and indicator scans for over 75 classic and advanced candlestick patterns (bullish, bearish, and neutral), assigning dynamic strength scores (1-10) to each for precise signal filtering. Enhanced with Average True Range (ATR) for volatility-aware body size validation, it dominates the markets by combining timeless pattern recognition with robust confirmation layers. Whether used as a backtestable strategy or visual indicator, it empowers traders to spot high-probability reversals, continuations, and indecision setups with surgical accuracy.
Inspired by Steve Nison's *Japanese Candlestick Charting Techniques*, this tool elevates pattern analysis beyond basics—think Hammers, Engulfing patterns, Morning Stars, and rare gems like Abandoned Baby or Concealing Baby Swallow—all consolidated into intelligent arrays for real-time averaging and prioritization.
**Key Features**
- **Extensive Pattern Library**:
- **Bullish (25+ patterns)**: Hammer (8.0), Bullish Engulfing (10.0), Morning Star (7.0), Three White Soldiers (9.0), Dragonfly Doji (8.0), and more (e.g., Rising Three, Unique Three River Bottom).
- **Bearish (25+ patterns)**: Hanging Man (8.0), Bearish Engulfing (10.0), Evening Star (7.0), Three Black Crows (9.0), Gravestone Doji (8.0), and exotics like Upside Gap Two Crows or Stalled Pattern.
- **Neutral/Indecision (34+ patterns)**: Doji variants (Long-Legged, Four Price), Spinning Tops, Harami Crosses, and multi-bar setups like Upside Tasuki Gap or Advancing Block.
Each pattern includes duration tracking (1-5 bars) and ATR-adjusted body/shadow criteria for relevance in volatile conditions.
- **Smart Confirmation Filters** (All Toggleable):
- **Trend Alignment**: 20-period SMA (customizable) ensures entries align with the prevailing trend; optional higher timeframe (e.g., Daily) MA crossover for multi-timeframe confluence.
- **Support/Resistance (S/R)**: Pivot-based levels with 0.01% tolerance to confirm bounces or breaks.
- **Volume Surge**: 20-period volume MA with 1.5x spike multiplier to validate momentum.
- **ATR Body Sizing**: Filters small bodies (<0.3x ATR) and long bodies (>0.8x ATR) for context-aware pattern reliability.
- **Follow-Through**: Ensures post-pattern confirmation via bullish/bearish closes or closes beyond prior bars.
Minimum average strength (default 7.0) and individual pattern thresholds (5.0) prevent weak signals.
- **Entry & Exit Logic**:
- **Long Entry**: Bullish average strength ≥7.0 (outweighing bearish), uptrend, volume spike, near support, follow-through, and HTF alignment.
- **Short Entry**: Mirror for bearish dominance in downtrends near resistance.
- **Exits**: Bearish/neutral shift, or fixed TP (5%) / SL (2%)—pyramiding disabled, 10% equity sizing.
- Backtest range: Jan 1, 2020 – Dec 31, 2025 (editable). Initial capital: $10,000.
- **Interactive Dashboard** (Top-Right Panel):
Real-time insights including:
- Market phase (e.g., "Bullish Phase (Avg Str: 8.2)"), active pattern (e.g., "BULLISH: Bullish Engulfing (Str: 10.0, Bars: 2)"), and trend status.
- Strength breakdowns (Bull/Bear/Neutral counts & averages).
- Filter status (e.g., "Volume: ✔ Spike", "ATR: Enabled (L:0.8, S:0.3)").
- Backtest stats: Total trades, win rate, streak, and last entry/exit details (price & timestamp).
Toggle mode: Strategy (live trades) or Indicator (signals only).
- **Advanced Alerts** (15+ Toggleable Types):
Set up via TradingView's "Any alert() function call" for bar-close triggers:
- Entry/Exit signals with strength & pattern details.
- Strong patterns (≥2 bullish/bearish), neutral indecision, volume spikes.
- S/R breakouts, HTF reversals, high-confidence singles (≥8.0 strength).
- Conflicting signals, MA crossovers, ATR volatility bursts, multi-bar completions.
Example: "STRONG BULLISH PATTERN detected! Strength: 9.5 | Top Pattern: Three White Soldiers | Trend: Up".
**Customization & Usage Tips**
- **Inputs Groups**: Strategy toggles, confirmations, exits, backtest dates, and 15+ alert switches—all intuitively grouped.
- **Optimization**: Tune min strengths for aggressive (lower) or conservative (higher) trading; enable/disable filters to suit your style (e.g., disable S/R for scalping).
- **Best For**: Forex, stocks, crypto on 1H–Daily charts. Test on historical data to refine TP/SL.
- **Limitations**: No external data installs; relies on built-in TA functions. Patterns are probabilistic—combine with your risk management.
Master the candles like a grandmaster. Deploy on TradingView, backtest relentlessly, and let dominance begin! Questions? Drop a comment.
*Version: 1.0 | Updated: September 2025 | Credits: Built on Pine Script v5 with nods to Nison's timeless techniques.*
Pi Cycle Top Indicator//@version=5
indicator("Pi Cycle Top Indicator", shorttitle="Pi Cycle Top Indicator", overlay=true)
// Price source
xPrice = close
// Moving averages
xSMA1 = ta.sma(xPrice, 350) * 2
xSMA5 = ta.sma(xPrice, 111)
// Plot MAs
plot(xSMA1, title="MA 350 * 2", linewidth=4, color=color.green)
plot(xSMA5, title="MA 111", linewidth=4, color=color.orange)