Mera Mera - Ying Yang & Inside, OutsideMera Mera
It is a structure that traps the previous candle formed in the same direction.
When the structure is Buy oriented, a blue dot is formed below it, when it is Sell oriented, a red dot is formed above it.
Sell Mera Mera, Buy Mera Mera alarm is available.
Ying Yang
It is a structure that traps the next candle formed in the same process.
When the structure is in Buy transactions, a blue triangle is formed under it, when it is in Sell transactions, a red triangle is formed under it.
Ying Yang Sell, Ying Yang Buy alert is available.
The calculation of inner bar and outer bar values is different.
After this formation, a transaction is sought by following the candle fractal formations.
Necessary visuals are below.
Forecasting
Position Size & Stop-Loss CalculatorPine Script Code for Position Size & Stop-Loss Calculator Indicator
This Pine Script indicator for TradingView will allow you to input your trading parameters and see the calculated Stop-Loss Price plotted on the chart, along with the recommended number of shares and maximum dollar risk displayed as a text label.
CHILLGUY Breakout & RSI Reversal Alertbreakout and reversed alerts so you have the best times to know when to buy and when to sell and also the holding or selling pressure
Fibonacci PivotsCreates Golden Zones based off the Pivots Standard with Daily Timeframe
-updated version with selectable TF
Price Statistical Strategy-Z Score V 1.01
Price Statistical Strategy – Z Score V 1.01
Overview
A technical breakdown of the logic and components of the “Price Statistical Strategy – Z Score V 1.01”.
This script implements a smoothed Z-Score crossover mechanism applied to the closing price to detect potential statistical deviations from local price mean. The strategy operates solely on price data (close) and includes signal spacing control and momentum-based candle filters. No volume-based or trend-detection components are included.
Core Methodology
The strategy is built on the statistical concept of Z-Score, which quantifies how far a value (closing price) is from its recent average, normalized by standard deviation. Two moving averages of the raw Z-Score are calculated: a short-term and a long-term smoothed version. The crossover between them generates long entries and exits.
Signal Conditions
Entry Condition:
A long position is opened when the short-term smoothed Z-Score crosses above the long-term smoothed Z-Score, and additional entry conditions are met.
Exit Condition:
The position is closed when the short-term Z-Score crosses below the long-term Z-Score, provided the exit conditions allow.
Signal Gapping:
A minimum number of bars (Bars gap between identical signals) must pass between repeated entry or exit signals to reduce noise.
Momentum Filter:
Entries are prevented during sequences of three or more consecutively bullish candles, and exits are prevented during three or more consecutively bearish candles.
Z-Score Function
The Z-Score is calculated as:
Z = (Close - SMA(Close, N)) / STDEV(Close, N)
Where N is the base period selected by the user.
Input Parameters
Enable Smoothed Z-Score Strategy
Enables or disables the Z-Score strategy logic. When disabled, no trades are executed.
Z-Score Base Period
Defines the number of bars used to calculate the simple moving average and standard deviation for the Z-Score. This value affects how responsive the raw Z-Score is to price changes.
Short-Term Smoothing
Sets the smoothing window for the short-term Z-Score. Higher values produce smoother short-term signals, reducing sensitivity to short-term volatility.
Long-Term Smoothing
Sets the smoothing window for the long-term Z-Score, which acts as the reference line in the crossover logic.
Bars gap between identical signals
Minimum number of bars that must pass before another signal of the same type (entry or exit) is allowed. This helps reduce redundant or overly frequent signals.
Trade Visualization Table
A table positioned at the bottom-right displays live PnL for open trades:
Entry Price
Unrealized PnL %
Text colors adapt based on whether unrealized profit is positive, negative, or neutral.
Technical Notes
This strategy uses only close prices — no trend indicators or volume components are applied.
All calculations are based on simple moving averages and standard deviation over user-defined windows.
Designed as a minimal, isolated Z-Score engine without confirmation filters or multi-factor triggers.
TrendLine + AlertsThe TrendLine + Alerts indicator is an advanced technical analysis tool designed to quickly identify trend direction using various moving averages and RMSD deviation. It dynamically generates buy and sell signals and visually marks entry points with price labels on the chart. Additionally, an optional transaction table can be toggled on or off, displaying buy and sell prices along with the percentage returns of individual trades and an aggregated summary row, facilitating the evaluation of trading strategy performance.
🔧 Key Features:
- Supports multiple moving average types: SMA, EMA, HMA, DEMA, TEMA, RMA, FRAMA
- Dynamic trend analysis based on RMSD deviation, adaptable to current market conditions
- Color-coded trend indication: green for uptrends, red for downtrends
- Alert generation: real-time buy and sell signals (TrendLine BUY / SELL)
- Price labels on the chart for better visualization of entry/exit points
- Interactive settings panel allowing selection of data source (open, close, high, low etc.), adjustable moving average length, and RMSD deviation multiplier
- Optionally displays a dynamic transaction table (toggleable via chart settings) that shows:
- Buy: entry prices
- Sell: exit prices
- Percent: percentage return of each trade, displayed as a number
- A summary row that aggregates the percentage returns, offering a quick evaluation of trading performance
⚙️ Settings:
- Ability to select the data source: open, close, high, low, oc2, hl2, occ3, hlc3, ohlc4, hlcc4
- Adjustable moving average length
- Customizable RMSD deviation multiplier
- Toggle switch to enable or disable the transaction table
🚀 Application:
Ideal for traders seeking an effective method to identify trends and turning points in the market. It is suitable for both short-term day trading and long-term trend analysis, with adjustable settings to suit individual trading strategies.
CPR by DSKThis CPR (Central Pivot Range) indicator is designed to provide multi-timeframe insights and simplify trend analysis for traders of all levels. Key features include:
1. Dynamic CPR Levels
Automatically adapts and displays CPR levels based on the current chart timeframe (Daily, Weekly, or Monthly).
Useful for identifying intraday or swing trading opportunities.
2. Market Sentiment Summary Table
A compact summary table indicates the market bias (Bullish/Bearish) using the relative position of the price to the Daily, Weekly, and Monthly CPR Pivots.
Helps you instantly assess the prevailing trend across key timeframes.
3. Target Achievement Status
The summary also highlights if any CPR-based targets or key levels have been hit, offering valuable confirmation for trade setups and exits.
This indicator is ideal for traders seeking a quick, visual overview of market structure and trend strength using the well-known CPR method.
MTF - Quantum Fibonacci ATR/ADR Levels & Targets V_2.0# Quantum Fibonacci Wave Mechanics v2.0 Release Notes
## 🚀 New Features
- Added multi-timeframe alert system for buy/sell signals
- Implemented dynamic label management with price values
- New mid-level trigger option for additional signals
- New EMA trigger option for confirmation signals
- Signal bar highlighting option
- Customizable line widths for all levels
## 🎨 Visual Improvements
- Completely redesigned label system (left-aligned with offsets)
- More intuitive input organization
- Better color customization options
## ⚙️ Technical Upgrades
- Upgraded to Pine Script v6
- Reduced repainting with stricter confirmation checks
- Optimized performance with proper variable initialization
## ⚠️ Note for Existing Users
- Some color parameters have been renamed
- Label positioning has changed (now with configurable offset)
- Review new mid-level trigger option in strategy settings
## 🐛 Bug Fixes
- Fixed potential repainting issues in signal generation
- Improved label cleanup between periods
- More robust security function implementation
## ⚠️ Caution for Mid-Level & EMA Signals
- Mid-Level Reversals may trigger premature entries in ranging markets.
- EMA crossovers can lag; confirm with price action.
CAFX Liquidity Pro V1CAFX Liquidity Pro Indicator
Precision Engineered for Smart Profit-Taking
The CAFX Liquidity Pro Indicator is a powerful trading tool designed to help traders pinpoint high-probability liquidity zones, making it ideal for setting accurate and strategic take profit levels. By identifying where institutional interest is likely to reside, this indicator highlights the areas where price is most likely to react, reverse, or pause—giving you the edge in locking in profits before the market shifts.
Whether you're scalping, day trading, or swing trading, the CAFX Liquidity Pro provides clear visual cues that simplify your decision-making process and enhance your trade management. With a focus on precision and reliability, it helps you avoid emotional exits and instead base your take profits on real market behavior and liquidity dynamics.
Use CAFX Liquidity Pro to stay one step ahead—because knowing where to exit is just as important as knowing when to enter.
EMA5/21 + VWAP + MACD HistogramScript Summary: EMA + VWAP + MACD + RSI Strategy
Objective: Combine multiple technical indicators to identify market entry and exit opportunities, aiming to increase signal accuracy.
Indicators Used:
EMAs (Exponential Moving Averages): Periods of 5 (short-term) and 21 (long-term) to identify trend crossovers.
VWAP (Volume Weighted Average Price): Serves as a reference to determine if the price is in a fair value zone.
MACD (Moving Average Convergence Divergence): Standard settings of 12, 26, and 9 to detect momentum changes.
RSI (Relative Strength Index): Period of 14 to identify overbought or oversold conditions.
Entry Rules:
Buy (Long): 5-period EMA crosses above the 21-period EMA, price is above VWAP, MACD crosses above the signal line, and RSI is above 40.
Sell (Short): 5-period EMA crosses below the 21-period EMA, price is below VWAP, MACD crosses below the signal line, and RSI is below 60.
Exit Rules:
For long positions: When the 5-period EMA crosses below the 21-period EMA or MACD crosses below the signal line.
For short positions: When the 5-period EMA crosses above the 21-period EMA or MACD crosses above the signal line.
Visual Alerts:
Buy and sell signals are highlighted on the chart with green (buy) and red (sell) arrows below or above the corresponding candles.
Indicator Plotting:
The 5 and 21-period EMAs, as well as the VWAP, are plotted on the chart to facilitate the visualization of market conditions.
This script is a versatile tool for traders seeking to combine multiple technical indicators into a single strategy. It can be used across various timeframes and assets, allowing adjustments according to the trader's profile and market characteristics.
Juliano Einhardt Ulguim, Brazil, 05/27/2025.
CPD Approach Algo [ValiantTrader]CPD Approach Algo Indicator Explained
This indicator, created by ValiantTrader, is a sophisticated tool for analyzing price action and market structure across different timeframes. Here's how it works and how traders use it:
Core Functionality
The CPD (Candle Price Distribution) Approach Algo divides the price range into horizontal zones and analyzes several key metrics within each zone:
Price Distribution: Shows where price has spent most time (high concentration areas)
Volume Clusters: Identifies zones with significant trading volume
Pressure Zones: Detects buying/selling pressure in specific price levels
Candle Differences: Highlights transitions between zones
How Traders Use It
1. Identifying Key Levels
The colored zones (green for buy, red for sell, gray neutral) show where price has historically reacted
Dense candle clusters indicate strong support/resistance areas
2. Volume Analysis
Volume clusters reveal where most trading activity occurred
High volume zones often act as magnets for price or reversal points
3. Pressure Detection
The pressure zones (with ↑ and ↓ arrows) show where buying or selling pressure was strongest
Helps identify potential breakout or reversal points
4. Multi-Timeframe Analysis
The custom timeframe input allows analyzing higher timeframe structure while viewing lower timeframe charts
Helps align trades with the dominant timeframe's structure
5. Transition Analysis
The delta values between zones show how price is moving between levels
Positive deltas (green) show upward momentum, negative (red) show downward
Practical Trading Applications
Support/Resistance Trading: Fade price at dense candle clusters with opposing pressure
Breakout Trading: Trade breaks from low-candle-count zones into high-volume zones
Mean Reversion: Trade returns to high-volume value areas after deviations
Trend Confirmation: Consistent pressure in one direction confirms trend strength
The indicator provides a comprehensive view of market structure by combining price, volume, and time elements across customizable timeframes, helping traders make more informed decisions about potential entries, exits, and key levels to watch.
Weekly COT ReportsThis is a separate pane that displays weekly COT reports reported on the CFTC website.
If the Currency is the base it will display on top of the midline. If the Currency is the quote it will display under the midline with the longs and shorts reversed so that all rising long positions put pressure to the upside and all rising shorts put pressure to the downside.
This version contains 16 weeks of data, updated every weekend.
It is based on midnight U.S. Central time.
It works best on the four-hour time frame.
The USD is found under "Market data & Economic Analysis" / Commitment of Traders / ICE Futures U.S. / Futures Only / Short Format
USD Code-098662.
All other are found under "Market data & Economic Analysis" / Commitment of Traders / Chicago Mercantile Exchange / Futures Only / Short Format
EUR Code-099741
CAD Code-090741
AUD Code-232741
GBP Code-096742
JPY Code-097741
NZD Code-112741
CHF Code-092741
CryptoNeo - Crypto Stablecoin MatrixThe CryptoNeo – Crypto Stablecoin Matrix is a forward-looking indicator that decodes broad crypto market sentiment by analyzing how stablecoins behave across spot and futures markets.
Stablecoins are the lifeblood of the crypto ecosystem, and how they move can offer early insight into future market direction. This tool leverages that behavior to forecast potential price action across major cryptocurrencies like BTC, ETH, SOL, DOGE, and other large-cap coins that tend to move in sync with the broader market.
Originally derived from a suite of alpha signals developed for a systematic crypto trading algorithm, this indicator compresses advanced stablecoin flow analytics into a clear and intuitive visual format — designed specifically for discretionary traders.
It is optimized for trading on the 30-minute to 4-hour timeframes, where the nuances of capital flow are most actionable. Whether you’re swing trading majors or scouting key pivot points, this tool provides a fresh edge rooted in stablecoin dynamics.
The Matrix is composed of four core components that signal changes in sentiment, capital flow, and market positioning:
1. Stablecoin Futures Flow (Bullish/Bearish)
Detects shifts in leveraged positioning in the futures market based on proprietary flow dynamics.
🟩 Green squares = bullish futures flow (long bias)
🟥 Red squares = bearish futures flow (short bias)
Helps identify directional sentiment through futures-driven stablecoin movement.
2. Stablecoin Spot Flow (Bullish/Bearish)
Analyzes momentum in spot market stablecoin activity to reveal potential accumulation or distribution.
🟢 Green circles = bullish spot flow (buying pressure)
🔴 Red circles = bearish spot flow (selling pressure)
Offers early signals of demand or profit-taking pressure.
3. Futures Oversold/Overbought Level 1
Identifies early signs of exhaustion or trend slowing based on leveraged market conditions.
🟢 Green diamonds = early oversold signal
🔴 Red diamonds = early overbought signal
Useful for catching subtle turning points or slowing momentum.
4. Futures Oversold/Overbought Level 2
Flags rare and extreme positioning events that may precede major reversals.
🟢 Large green diamonds = deep oversold condition
🔴 Large red diamonds = deep overbought condition
Highlights moments of extreme imbalance or sentiment peaks.
Customization & Flexibility
Adjustable sensitivity settings allow you to fine-tune:
Bullish and bearish Spot and Futures Flow
Thresholds for Level 1 and Level 2 Overbought/Oversold signals
This ensures traders can align signal responsiveness with their trading style and market conditions.
Best Used For:
Swing trading crypto majors (BTC, ETH, SOL, DOGE, etc.)
Timeframes between 30 minutes and 4 hours
Identifying trend reversals and accumulation zones
Tracking macro market sentiment using stablecoin behavior
Trucker Doug Master Indicator for Making Money📈 Trucker Doug Master Indicator for Making Money™
This all-in-one indicator was built for speed, clarity, and dominance — designed by a trader, for traders who hate fluff and want to get paid.
🔥 What It Does:
TP/SL/R:R Overlay: Automatically plots entry, stop-loss, and 5 take-profit levels (including a "TP LAMBO" target) based on your custom ATR multiplier and risk percentage. Each TP level includes its R:R ratio, so you can instantly see if the trade is worth it.
Live Volume Analysis: Displays Relative Volume (RVOL) as a percentage, with color-coded states (red = weak, black = neutral, yellow = increasing, green = explosive). Also shows average volume for context.
ATR Value: Dynamically calculated and displayed so you always know your volatility baseline.
MACD & RSI Values: Shown in the overlay box for a quick read — no extra indicators cluttering your chart.
EMA/SMA Lines: Clean, adjustable moving averages (default: EMA 5, EMA 9, SMA 50) plotted directly on the chart.
Fuse Visual Explainer™: Marks EMA 5 crossing EMA 9 (colored dot) and EMA 5 crossing SMA 50 (black X) directly where they intersect. Helps you visually confirm momentum or momentum reversals in real time.
⚙️ Fully Customizable in Settings:
Toggle on/off: TP lines, the volume/ATR table, EMA/SMA lines, RSI/MACD display, Fuse visuals.
Adjust:
TP multipliers (TP1–TP4, Lambo)
Stop-loss offset %
ATR period
Volume average period
Line colors for each TP level, SL, entry, and even the R:R label
Table text size and position
TP/SL line length (how far it stretches left/right)
💡 Why It’s Awesome:
No more layering 5 indicators. No more eyeballing risk-to-reward. No more guessing if volume is legit. This is a precision tool for real traders.
Built for those who are tired of chart noise and want everything that matters — clean, calculated, and completely in your control.
ML: Lorentzian Classification Premium█ OVERVIEW
Lorentzian Classification Premium represents the culmination of two years of collaborative development with over 1,000 beta testers from the TradingView community. Building upon the foundation of the open-source version, this premium edition introduces powerful enhancements that transform how machine-learning classification can be applied to market analysis.
The premium version maintains the core Lorentzian distance-based classification algorithm while expanding its capabilities through triple the feature dimensionality (up to 15 features), sophisticated mean-reversion detection, first-pullback identification, and a comprehensive signal taxonomy that goes far beyond simple buy/sell signals. Whether you're building automated trading systems, conducting deep market research, or integrating proprietary indicators into ML workflows, this tool provides the advanced edge needed for professional-grade analysis.
█ BACKGROUND
Lorentzian Classification analyzes market structures, especially those exhibiting non-linear distortions under stress, by employing advanced distance metrics like the Lorentzian metric, prominent in fields such as relativity theory. Where traditional indicators assume flat space, we embrace the curve. The heart of this approach is the Lorentzian distance metric—a sophisticated mathematical tool. This framework adeptly navigates the complex curves and distortions of market space, aiming to provide insights that traditional analysis might miss, especially during moments of extreme volatility. It analyzes historical data from a multi-dimensional feature space consisting of various technical indicators of your choosing. Where traditional approaches fail, Lorentzian space reveals the true geometry of market dynamics.
Neighborhoods in Different Geometries: In the above figure, the Lorentzian metric creates distinctive cross-patterns aligned with feature axes (RSI, CCI, ADX), capturing both local similarity and dimensional extremes. This unique geometry allows the algorithm to recognize similar market conditions that Euclidean spheres and Manhattan diamonds would miss entirely. In LC Premium, users can have up to 15 features -- you are not limited to 3-dimensions.
Among the thousands of distance metrics discovered by mathematicians, each perceives data through its own geometric lens. The Lorentzian metric stands apart with its unique ability to capture market behavior during volatile events.
█ COMMUNITY-DRIVEN EVOLUTION
It has been profoundly humbling over the past 2 years to witness this indicator's evolution through the collaborative efforts of our incredible community. This journey has been shaped by thousands of user suggestions and validated through real-world application.
A particularly amazing milestone was the development of a complete community-driven Python port, which meticulously matched even the most minute PineScript quirks. Building on this solid foundation, a new command-line interface (CLI) has opened up exciting possibilities for chart-specific parameter optimization:
Early insights from parameter optimization research: Through grid-search testing across thousands of parameter combinations, the analysis identifies which parameters have the biggest effects on performance and maps regions of stability across different market regimes. This reveals that optimal neighbor counts vary significantly based on market conditions—opening up incredible potential for timeframe-specific optimization.
This is just one of the insights gleaned so far from this ongoing investigation. The potential for chart-specific optimization for any given timeframe could transform how traders approach parameter selection.
Demand from power users for extra capabilities—while keeping the open-source version simple—sparked this Premium release. The open-source branch remains maintained, but the premium tier adds unique features for those who need an analytical edge and to leverage their own custom indicators as feature series for the algorithm.
█ KEY PREMIUM FEATURES
📈 First Pullback Detection System
Automatically identifies high-probability trend-continuation entries after initial momentum moves.
Detects when price retraces to optimal entry zones following breakouts or trend initiations.
Green/red triangle signals often fire before main classification arrows.
Dedicated alerts for both bullish and bearish pullback opportunities.
Based on veryfid's extensive research into pullback mechanics and market structure.
🔄 Dynamic Kernel Regression Envelope
Powerful, zero-setup confluence layer that immediately communicates trend shifts.
Dual-kernel system creates a visual envelope between trend estimates.
Color gradient dynamically represents prediction strength and market conviction.
Crossovers provide additional confirmation without cluttering your chart.
Professional visualization that rivals institutional-grade analysis tools.
✨ Massively Expanded Dimensionality: 10 Custom Sources, 5 Built-In Sources
Transform the indicator from 5 built-in standard to 15 total total features—triple the analytical power.
Integrate ANY TradingView indicator as a machine learning feature.
Built-in normalization ensures all indicators contribute equally regardless of scale.
Create theme-based systems: pure volume analysis, multi-timeframe momentum, or hybrid approaches.
📊 Tiered Mean Reversion Signals with Scalping Alerts
Regular (🔄) and Strong (⬇️/⬆️) mean reversion signals based on statistical extremes.
Opportunities often arise before candle close—perfect for scalping entries.
Visual markers appear at high-probability reversal zones.
Four specialized alert types: upward/downward for both regular and strong reversals.
Pre-optimized probability thresholds, no fine-tuning required.
📅 Daily Kernel Trend Filter
Instantly cleans up noisy intraday charts by aligning with higher timeframe trends.
Swing traders report immediate signal quality improvement.
Automatically deactivates on daily+ timeframes (intelligent context awareness).
Reduces counter-trend signals by up to 60% on lower timeframes.
Simple toggle—no complex multi-timeframe setup required.
📋 Professional Backtesting Stream (-6 to +6)
Multiple distinct signal types (including pullbacks, mean reversions, and kernel deviations) vs. basic binary (buy/sell) output for nuanced analysis.
Enables detailed walk-forward analysis and ML model training.
Compatible with external backtesting frameworks via numeric stream.
Rare precision for TradingView indicators—usually only found in institutional tools.
Perfect for quants building sophisticated strategy layers.
⚡ Performance Optimizations
Faster distance calculations through algorithmic improvements.
Reduced indicator load time (measured via Pine Profiler).
Handles 15 active features without timeouts—critical for multi-chart setups.
Optimized for live auto-trading bots requiring minimal latency.
🎨 Full Visual Customization & Accessibility
Complete color control for all visual elements.
Colorblind-safe default palette with customization options.
Dark mode optimization for extended trading sessions.
Professional appearance matching your trading workspace.
Accessibility features meeting modern UI standards.
🛠️ Advanced Training Modes
Downsampling mode for training on diverse market conditions; Down-sampling and remote-fractals for exotic pattern discovery.
Remote fractals option extends analysis to deep historical patterns.
Reset factor control for fine-tuning neighbor diversity; Reset-factor tuning to control neighbor diversity.
Appeals to systematic traders exploring exotic data approaches.
Prevents temporal clustering bias in model training.
█ HOW TO USE
Understanding the Approach (Core Concept):
Lorentzian Classification uses a k-Nearest Neighbors (k-NN) algorithm. It searches for historical price action "neighborhoods" similar to the current market state. Instead of a simple straight-line (Euclidean) distance, it primarily uses a Lorentzian distance metric, which can account for market "warping" or distortions often seen during high volatility or significant events. Each historical neighbor "votes" on what happened next in its context, and these votes aggregate into a classification score for the current bar.
Interpreting Bar Scores & Signals (Interpreting the Chart):
Bar Prediction Values: Numbers over each candle (e.g., ranging from -8 to +8 if Neighbors Count is 8) represent the aggregated vote from the nearest neighbors. Strong positive scores (e.g., +7, +8) indicate a strong bullish consensus among historical analogs. Strong negative scores (e.g., -7, -8) indicate a strong bearish consensus. Scores near zero suggest neutrality or conflicting signals from neighbors. The intensity of bar colors (if Use Confidence Gradient is on) often reflects these scores.
Main Arrows (Main Buy/Sell Labels): Large ▲/▼ labels are the primary entry signals generated when the overall classification (after filters) is bullish or bearish.
Pullback Triangles: Small green/red ▲/▼ identify potential trend continuation entries. These signals often appear after an initial price move and a subsequent minor retracement, suggesting the trend might resume. This is based on recognizing patterns where a brief counter-movement is followed by a continued advance in the initial trend direction.
Mean-Reversion Symbols: 🔄 (Regular Reversion) appears when price has crossed the average band of the Dynamic Kernel Regression Envelope. ⬇️/⬆️ (Strong Reversion) means price has crossed the far band of the envelope, indicating a more extreme deviation and potentially a stronger reversion opportunity.
Custom Mean Reversion Deviation Markers (Deviation Dots): If Enable Custom Mean Reversion Alerts is on, these dots appear when price deviates from the main kernel regression line by a user-defined ATR multiple, signaling a custom-defined reversion opportunity.
Kernel Regression Lines & Envelope: The Main Kernel Estimate (thicker line) is an adaptive moving average that smooths price and helps identify trend direction. Its color indicates the current trend bias. The Envelope (outer bands and a midline) creates a channel around price, and its interaction with price generates mean reversion signals.
Key Input Groups & Their Purpose:
🔧 GENERAL SETTINGS:
Reduce Price-Time Warping : Toggles the distance metric. When enabled, it reduces the characteristic "warping" effect of the default Lorentzian metric, making the distance calculation more Euclidean in nature. This may be suited for periods exhibiting less pronounced price-time distortions.
Source : Price data for calculations (default: close ).
Neighbors Count : The 'k' in k-NN – number of historical analogs considered.
Max Bars Back : How far back the indicator looks for historical patterns.
Show Exits / Use Dynamic Exits : Controls visibility and logic for exit signals.
Include Full History (Use Remote Fractals) : Allows model to pick "exotic" fractals from deep chart history.
Use Downsampling / Reset Factor : Advanced training parameters affecting neighbor selection.
Show Trade Stats / Use Worst Case Estimates : Displays a real-time performance table (for calibration only).
🎛️ DEFINE CUSTOM SOURCES (OPTIONAL):
Integrate up to 10 external data series (e.g., from other indicators) as features. Each can be optionally normalized. Load the external indicator on your chart first for it to appear in the dropdown.
🧠 FEATURE ENGINEERING:
Configure up to 15 features for the k-NN algorithm. Select type (RSI, WT, CCI, ADX, Custom Sources), parameters, and enable/disable. Start simple (3-5 features) and add complexity gradually. Normalize features with vastly different scales.
🖥️ DISPLAY SETTINGS:
Controls visibility of chart elements: bar colors, prediction values/labels, envelope, etc.
Align Signal with Current Bar : If true, pullback signals appear on the current bar (calculated on closed data). If false (default), they appear on the next bar.
Use ATR Offset : Positions bar prediction values using ATR for visibility.
🧮 FILTERS SETTINGS:
Refine raw classification signals: Volatility, Regime, ADX, EMA/SMA, and Daily Kernel filters.
🌀 KERNEL SETTINGS (Main Kernel):
Adjust parameters for the primary Nadaraya-Watson Kernel Regression line. Lookback Window , Relative Weighting , Regression Level , Lag control sensitivity and smoothness.
✉️ ENVELOPE SETTINGS (for Mean Reversion):
Configure the dynamic Kernel Regression Envelope. ATR Length , Near/Far ATR Factor define band width.
🎨 COLOR SETTINGS (Colors):
Customize colors for all visual elements; override every palette element.
General Approach to Using the Indicator (Suggested Workflow):
Load defaults and observe behavior: Familiarize yourself with the indicator's behavior.
Feature Engineering: Experiment with features, considering momentum, trend, and volatility. Add/replace features gradually.
Apply Filters: Refine signals according to your trading style.
Contextualize: Use kernels and envelope to understand broader trend and potential overbought/oversold areas.
Observe Signals: Pay attention to the interplay of main signals, pullbacks, and mean reversions. Watch interplay of main, pullback & mean-reversion signals.
Calibrate (Not Backtest): Use the "Trade Stats" table for real-time feedback on current settings. This is for calibration, *not a substitute for rigorous backtesting.*
Iterate & refine: Adjust settings, observe outcomes, and refine your approach.
█ ACKNOWLEDGMENTS
This premium version wouldn't exist without the invaluable contributions of:
veryfid for his groundbreaking ideas on unifying pullback detection with Lorentzian Classification, but most of all for always believing in and encouraging me and so many others. For being a mentor and, most importantly, a friend. We all miss you.
RikkiTavi for his help in creating the settings optimization framework and for other invaluable theoretical discussions.
The 1,000+ beta testers worldwide who provided continuous feedback over two years.
The Python porting team who created the foundation for advanced optimization; for the cross-language clone.
The broader TradingView community for making this one of the platform's most popular indicators.
█ FUTURE DEVELOPMENT
The Premium version will continue to evolve based on community feedback. Planned enhancements include:
Specialized exit model trained independently from entry signals (ML-based exit model).
Feature hub with pre-normalized, commonly requested indicators (Pre-normalized feature hub).
Better risk-management options (Enhanced risk-management options).
Fully automated settings optimization (Auto-settings optimization tool).
Parabolic-Fibonacci MA ForecastThis indicator displays a series of projected price levels based on Fibonacci moving averages. For each selected Fibonacci period, it calculates a simple moving average (SMA) and mirrors the distance from the current price to that SMA in the opposite direction, creating a vertical forecast distance. These forecast distances are drawn forward into the future using geometric spacing (squared increments: 1², 2², 3², etc.), creating a fan-like or polyline visual structure.
Users can choose between three display modes:
Fan: Lines drawn from the current price to projected values at increasing intervals
Polyline: Forecast points connected to form a jagged projection path
Both: Displays both fan and polyline structures simultaneously
Options are provided to adjust the number of Fibonacci lines (up to 12), line width, and colors for lines above/below price or up/down slope.
This tool can help visualize directional price tendencies using multiple SMA-based forecasts in a spatially meaningful layout.
Linear Regression ForecastDescription:
This indicator computes a series of simple linear regressions anchored at the current bar, using look-back windows from 2 bars up to the user-defined maximum. Each regression line is projected forward by the same number of bars as its look-back, producing a family of forecast endpoints. These endpoints are then connected into a continuous polyline: ascending segments are drawn in green, and descending segments in red.
Inputs:
maxLength – Maximum number of bars to include in the longest regression (minimum 2)
priceSource – Price series used for regression (for example, close, open, high, low)
lineWidth – Width of each line segment
Calculation:
For each window size N (from 2 to maxLength):
• Compute least-squares slope and intercept over the N most recent bars (with bar 0 = current bar, bar 1 = one bar ago, etc.).
• Project the regression line to bar_index + N to obtain the forecast price.
Collected forecast points are sorted by projection horizon and then joined:
• First segment: current bar’s price → first forecast point
• Subsequent segments: each forecast point → next forecast point
Segment colors reflect slope direction: green for non-negative, red for negative.
Usage:
Apply this overlay to any price chart. Adjust maxLength to control the depth and reach of the forecast fan. Observe how shorter windows produce nearer-term, more reactive projections, while longer windows yield smoother, more conservative forecasts. Use the colored segments to gauge the overall bias of the fan at each step.
Limitations:
This tool is for informational and educational purposes only. It relies on linear regression assumptions and past price behavior; it does not guarantee future performance. Users should combine it with other technical or fundamental analyses and risk management practices.
TP/SL Overlay with Volume/ATR TableThis is a Take Profit and Stop Loss indicator that plots the TP/SL levels, along with the Risk/Reward ratios on the chart similar to an auto fib overlay. These levels are ATR based and are dynamic, based on the current price. It also includes heads-up display that shows the Relative Volume, ATR and several TP levels. All settings and configurations are editable from the settings menu, as well. I created this to make it easier to estimate TP levels without having to pull up a calculator or the "Long" tool that TradingView provides. Hope you like it!
Range Progress TrackerRANGE PROGRESS TRACKER(RPT)
PURPOSE
This indicator helps traders visually and statistically understand how much of the typical price range (measured by ATR) has already been covered in the current period (Daily, Weekly, or Monthly). It includes key features to assist in trend exhaustion analysis, reversal spotting, and smart alerting.
CORE LOGIC
The indicator calculates the current range of the selected time frame (e.g., Daily), which is:
Current Range = High - Low
This is then compared to the ATR (Average True Range) of the same time frame, which represents the average price movement range over a defined period (default is 14).
The comparison is expressed as a percentage, calculated with this formula:
Range % = (Current Range / ATR) × 100
This percentage shows how much of the “average expected move” has already occurred.
WHY IT MATTERS
When the current range approaches or exceeds 100% of ATR, it means the price has already moved as much as it typically does in a full session.
This indicates a lower probability of continuing the trend with a new high or low, especially when the price is already near the session's high or low.
This setup can signal:
A possible consolidation phase
A reversal in trend
The market entering a corrective phase
SMART ALERTS
The indicator can alert you when:
A new high is made after the range percentage exceeds your set threshold.
A new low is made after the range percentage exceeds your set threshold.
You can adjust the Range % Alert Threshold in the settings to tailor it to your trading style.
SectorRotationRadarThe Sector Rotation Radar is a powerful visual analysis tool designed to track the relative strength and momentum of a stock compared to a benchmark index and its associated sector ETF. It helps traders and investors identify where an asset stands within the broader market cycle and spot rotation patterns across sectors and timeframes.
🔧 Key Features:
Benchmark Comparison: Measures the relative performance (strength and momentum) of the current symbol against a chosen benchmark (default: SPX), highlighting over- or underperformance.
Automatic Sector Detection: Automatically links stocks to their relevant sector ETFs (e.g., XLK, XLF, XLU), based on an extensive internal symbol map.
Multi-Timeframe Analysis: Supports simultaneous comparison across the current, next, and even third-higher timeframes (e.g., Daily → Weekly → Monthly), providing a bigger-picture perspective of trend shifts.
Tail Visualization: Displays a "trail" of price behavior over time, visualizing how the asset has moved in terms of relative strength and momentum across a user-defined period.
Quadrant-Based Layout: The chart is divided into four dynamic main zones, each representing a phase in the strength/momentum cycle:
🔄 Improving: Gaining strength and momentum
🚀 Leading: High strength and high momentum — top performers
💤 Weakening: Losing momentum while still strong
🐢 Lagging: Low strength and low momentum — underperformers
Clean Chart Visualization:
Background grid with axis labels
Dynamic tails and data points for each symbol
Option to include the associated sector ETF for context
Descriptive labels showing exact strength/momentum values per point
⚙️ Customization Options:
Benchmark Selector: Choose any symbol to compare against (e.g., SPX, Nasdaq, custom index)
Start Date Control: Option to fix a historical start point or use the current data range
Trail Length: Set the number of previous data points to display
Additional Timeframes: Enable analysis of one or two higher timeframes beyond the current
Sector ETF Display: Toggle to show or hide the related sector ETF alongside the asset
📚 Technical Architecture:
The indicator relies on external modules for:
Statistical modeling
Relative strength and momentum calculations
Chart rendering and label drawing
These components work together to compute and display a dynamic, real-time map of asset performance over time.
🧠 Use Case:
Sector Rotation Radar is ideal for traders looking to:
Spot stocks or sectors rotating into strength or weakness
Confirm alignment across multiple timeframes
Identify sector leaders and laggards
Understand how a symbol is positioned relative to the broader market and its peers
This tool is especially valuable for swing traders, sector rotation strategies, and macro-aware investors who want a visual edge in decision-making.
Tangent Extrapolation ForecastTangent Extrapolation Forecast
This indicator visually projects price direction by drawing a smoothed sequence of tangent lines based on recent price movements. For each bar in a user-defined lookback window, it calculates the slope over a smoothing period and extends the projected price forward. The resulting polyline forecast connect the endpoints of the extrapolations, and is color-coded to reflect directional changes: green for upward moves, red for downward, and gray for flat segments. This tool can assist traders in visualizing short-term momentum and potential trend continuity without introducing artificial future gaps.
Inputs:
Bars to Use: Number of historical bars used in the forecast.
Slope Smoothing Window: The number of bars used to calculate slope for projection.
Source: Price input for calculations (default is close).
This indicator does not generate buy/sell signals. It is intended as a visual aid to support discretionary analysis.
Malama's big MACDPurpose: Malama's Big MACD is a multi-faceted Pine Script indicator designed for traders on short timeframes (1-5 minute charts) to identify high-probability trading opportunities. It combines a Stochastic Price Predictor (SPP) with a comprehensive set of technical indicators, including MACD, RSI, moving average crossovers, ATR, volume spikes, and a custom JKH RSI, to generate robust buy and sell signals. The indicator aims to solve the problem of filtering out market noise in fast-moving markets by integrating probability-based predictions with traditional technical analysis, providing traders with clear entry/exit signals, trend visualization, and risk management levels.
Originality and Usefulness
This script is a unique mashup of a Stochastic Price Predictor (SPP) and a comprehensive indicator suite, tailored for short-term trading. The SPP uses a Monte Carlo simulation combined with ATR and Stochastic RSI to forecast price movements, while the comprehensive indicator suite leverages MACD crossovers, RSI overbought/oversold conditions, moving average crossovers, volume spikes, and a custom JKH RSI for confirmation. Unlike standalone MACD or RSI indicators available in TradingView’s public library, this script’s originality lies in its hybrid approach, blending probabilistic forecasting with multiple confirmatory signals to enhance reliability. The integration of user-defined sentiment input and customizable risk management levels further differentiates it from generic open-source alternatives, making it particularly useful for scalpers and day traders seeking precise, actionable signals.
How It Works
The script operates in two primary modules: the Stochastic Price Predictor (SPP) and the Comprehensive Indicator Suite, which work together to generate and confirm trading signals. Signal strength is calculated to quantify the confidence of bullish or bearish conditions.
Stochastic Price Predictor (SPP):
Core Logic: The SPP forecasts price movements using a Monte Carlo simulation based on historical returns, ATR-based volatility, and Stochastic RSI filtering. It calculates the probability of price reaching a user-defined target move (default: 0.3%) within a specified forecast horizon (default: 3 bars).
Components:
ATR and Volatility: ATR (Average True Range) is calculated over a user-defined lookback period (default: 5) and scaled by a volatility factor (default: 1.5) to estimate price volatility. A volatility ratio (current volatility vs. average) filters out signals during extreme volatility (>2x average).
Stochastic RSI: A 7-period RSI is smoothed into a Stochastic RSI (5-period stochastic, 2-period SMA) to identify overbought (>85) or oversold (<15) conditions, preventing signals in extreme market states.
Monte Carlo Simulation: 30 price paths are simulated using a geometric Brownian motion model, incorporating drift (based on weighted moving average of returns) and volatility shocks. The simulation estimates the probability of price reaching the target move up or down.
Signal Generation: A buy signal is triggered if the probability of an upward move exceeds the confidence threshold (default: 65%) and the market is not overbought, with volatility within limits. A sell signal is triggered similarly for downward moves.
Purpose: The SPP provides a probabilistic framework to anticipate short-term price movements, reducing reliance on lagging indicators.
Comprehensive Indicator Suite:
Core Logic: This module combines multiple technical indicators to confirm SPP signals and generate independent signals based on momentum, trend, and volume.
Components:
MACD: Uses fast (5-period) and slow (13-period) EMAs to calculate the MACD line, smoothed by a 5-period signal line. A crossover above a threshold (default: 0.0001) indicates bullish momentum, while a crossunder signals bearish momentum.
RSI: A 14-period RSI identifies overbought (>70) or oversold (<30) conditions to filter signals.
Moving Average Crossovers: Fast (5-period) and slow (20-period) EMAs determine trend direction. A bullish crossover (fast > slow) supports buy signals, while a bearish crossover (fast < slow) supports sell signals.
Volume Spikes: Volume exceeding 2x the 50-period average signals significant market activity, enhancing signal reliability.
JKH RSI: A fast 3-period RSI with custom overbought (>80) and oversold (<20) levels provides additional confirmation, reducing false signals in choppy markets.
Sentiment Input: A user-defined sentiment score (-1 to 1) adjusts signal strength, allowing traders to incorporate external market bias (e.g., news or fundamentals).
Signal Generation: A buy signal requires a bullish MACD crossover, RSI oversold, bullish MA crossover, non-overbought JKH RSI, and neutral/positive sentiment. A sell signal requires the opposite conditions.
Signal Strength Calculation:
Logic: Combines SPP probability, RSI deviation, and MACD strength, weighted at 50%, 30%, and 20%, respectively. Sentiment input scales the final strength (0–100).
Formula:
Bullish strength = min(100, (50 * |prob_up - prob_down| / 100 + 30 * |RSI - 50| / 50 + 20 * |MACD_line| / (0.1 * ATR)) * (1 + max(0, sentiment)))
Bearish strength is calculated similarly, using the absolute negative sentiment.
Purpose: Quantifies signal confidence, helping traders prioritize high-probability setups.
Strategy Results and Risk Management
While the script is primarily an indicator, it provides implied trading signals that assume realistic trading conditions:
Assumptions: Signals are designed for short-term trading (1-5 minute charts) with a minimum of 100 trades for statistical significance. The script assumes typical commission (e.g., 0.1% per trade) and slippage (e.g., 0.05%) for liquid markets. Risk per trade is implicitly capped via ATR-based stop-loss levels (2x ATR below/above entry for buy/sell).
Default Settings:
Lookback (5), volatility factor (1.5), and forecast horizon (3) are optimized for short timeframes.
ATR-based stop-loss and profit target levels (2x ATR) provide a risk-reward ratio of approximately 1:1.
Confidence threshold (65%) balances signal frequency and reliability.
Customization: Traders can adjust the ATR multiplier for stop-loss/profit targets or modify the confidence threshold to increase/decrease signal frequency. Lowering the target move (e.g., to 0.2%) or shortening the forecast horizon (e.g., to 2 bars) can tighten risk parameters for scalping.
Guidance: Traders should backtest signals on their specific asset and timeframe, ensuring sufficient trade volume (>100 trades) and incorporating their broker’s commission/slippage. Risk should be limited to 5–10% of equity per trade, adjustable via ATR multiplier or position sizing outside the script.
User Settings and Customization
The script offers extensive user inputs, organized into three groups:
Stochastic Price Predictor Settings:
Lookback Period (default: 5): Controls the period for ATR and returns calculation. Shorter periods increase sensitivity.
Volatility Factor (default: 1.5): Scales ATR for volatility shocks in the Monte Carlo simulation.
Confidence Threshold (default: 65%): Sets the minimum probability for SPP signals.
Stoch RSI Overbought/Oversold Levels (default: 85/15): Filters signals in extreme conditions.
Forecast Horizon (default: 3): Number of bars for price prediction.
Target Move (default: 0.3%): Expected price movement for probability calculation.
Show Predicted Range (default: false): Toggles visibility of the 25th–75th percentile price range.
Comprehensive Indicator Settings:
RSI Length (default: 14), Overbought (70), Oversold (30): Standard RSI parameters.
ATR Length (default: 14): Period for ATR calculation.
Volume Spike Multiplier (default: 2.0): Threshold for detecting volume spikes.
Sentiment Input (default: 0.0, range: -1 to 1): Scales signal strength based on external bias.
MACD Fast/Slow/Signal Lengths (default: 5/13/5), Crossover Threshold (0.0001): Controls MACD sensitivity.
MA Fast/Slow Lengths (default: 5/20): Defines trend direction.
JKH RSI Length (default: 3), Overbought (80), Oversold (20): Fast RSI for confirmation.
Visual Settings:
Show SPP Signals (default: true): Displays SPP buy/sell labels.
Show Comp Signals (default: true): Displays comprehensive indicator signals.
Highlight Volume Spikes (default: true): Highlights bars with significant volume.
Show ATR Levels (default: true): Plots stop-loss and profit-target lines.
Impact: Adjusting lookback periods or thresholds affects signal frequency and sensitivity. For example, lowering the confidence threshold increases signals but may reduce accuracy, while increasing the volatility factor amplifies price path variability.
Visualizations and Chart Setup
The script plots clear, relevant elements on the chart to aid decision-making:
Trend Line: Plots the close price, colored green (bullish, fast MA > slow MA), red (bearish), or orange (neutral).
SPP Signals: Green "BUY (SPP)" labels below bars and red "SELL (SPP)" labels above bars when conditions are met.
Predicted Range: Optional blue step lines showing the 25th–75th percentile price range from the Monte Carlo simulation, with a semi-transparent fill.
Comprehensive Signals:
Blue upward triangles for bullish MACD crossovers, orange downward triangles for bearish crossovers.
Green circles above bars for RSI overbought, red circles below for oversold.
Green "BUY (Comp)" labels (offset by 1x ATR below) and red "SELL (Comp)" labels (offset by 1x ATR above) for comprehensive signals.
Green upward triangles for bullish MA crossovers, red downward triangles for bearish crossovers.
Volume Spikes: Yellow background highlights bars with volume >2x the 50-period average.
ATR Levels: Purple dotted lines for stop-loss (close - 2x ATR) and profit target (close + 2x ATR).
Moving Averages: Fast MA (blue, 5-period) and slow MA (red, 20-period) for trend reference.
Clarity: Only relevant elements are plotted, ensuring traders can quickly identify trends, signals, and risk levels without clutter.