Theil-Sen Line Filter [BackQuant]Theil-Sen Line Filter  
  A robust, median-slope baseline that tracks price while resisting outliers. Designed for the chart pane as a clean, adaptive reference line with optional candle coloring and slope-flip alerts. 
 What this is 
 A trend filter that estimates the underlying slope of price using a Theil-Sen style median of past slopes, then advances a baseline by a controlled fraction of that slope each bar. The result is a smooth line that reacts to real directional change while staying calm through noise, gaps, and single-bar shocks.
 Why Theil-Sen 
 Classical moving averages are sensitive to outliers and shape changes. Ordinary least squares is sensitive to large residuals. The Theil-Sen idea replaces a single fragile estimate with the median of many simple slopes, which is statistically robust and less influenced by a few extreme bars. That makes the baseline steadier in choppy conditions and cleaner around regime turns.
 What it plots 
  
  Filtered baseline  that advances by a fraction of the robust slope each bar.
  Optional candle coloring  by baseline slope sign for quick trend read.
  Alerts  when the baseline slope turns up or down.
  
 How it behaves (high level) 
  
  Looks back over a fixed window and forms many “current vs past” bar-to-bar slopes.
  Takes the median of those slopes to get a robust estimate for the bar.
  Optionally caps the magnitude of that per-bar slope so a single volatile bar cannot yank the line.
  Moves the baseline forward by a user-controlled fraction of the estimated slope. Lower fractions are smoother. Higher fractions are more responsive.
  
 Inputs and what they do 
  
  Price Source  — the series the filter tracks. Typical is close; HL2 or HLC3 can be smoother.
  Window Length  — how many bars to consider for slopes. Larger windows are steadier and slower. Smaller windows are quicker and noisier.
  Response  — fraction of the estimated slope applied each bar. 1.00 follows the robust slope closely; values below 1.00 dampen moves.
  Slope Cap Mode  — optional guardrail on each bar’s slope:
  
  None  — no cap.
  ATR  — cap scales with recent true range.
  Percent  — cap scales with price level.
  Points  — fixed absolute cap in price points.
  
  ATR Length / Mult, Cap Percent, Cap Points  — tune the chosen cap mode’s size.
  UI Settings  — show or hide the line, paint candles by slope, choose long and short colors.
  
 How to read it 
  
  Up-slope  baseline and green candles indicate a rising robust trend. Pullbacks that do not flip the slope often resolve in trend direction.
  Down-slope  baseline and red candles indicate a falling robust trend. Bounces against the slope are lower-probability until proven otherwise.
  Flat or frequent flips  suggest a range. Increase window length or decrease response if you want fewer whipsaws in sideways markets.
  
 Use cases 
  
  Bias filter  — only take longs when slope is up, shorts when slope is down. It is a simple way to gate faster setups.
  Stop or trail reference  — use the line as a trailing guide. If price closes beyond the line and the slope flips, consider reducing exposure.
  Regime detector  — widen the window on higher timeframes to define major up vs down regimes for asset rotation or risk toggles.
  Noise control  — enable a cap mode in very volatile symbols to retain the line’s continuity through event bars.
  
 Tuning guidance 
  
  Quick swing trading  — shorter window, higher response, optionally add a percent cap to keep it stable on large moves.
  Position trading  — longer window, moderate response. ATR cap tends to scale well across cycles.
  Low-liquidity or gappy charts  — prefer longer window and a points or ATR cap. That reduces jumpiness around discontinuities.
  
 Alerts included 
  
  Theil-Sen Up Slope  — baseline’s one-bar change crosses above zero.
  Theil-Sen Down Slope  — baseline’s one-bar change crosses below zero.
  
 Strengths 
  
  Robust to outliers through median-based slope estimation.
  Continuously advances with price rather than re-anchoring, which reduces lag at turns.
  User-selectable slope caps to tame shock bars without over-smoothing everything.
  Minimal visuals with optional candle painting for fast regime recognition.
  
 Notes 
This is a filter, not a trading system. It does not account for execution, spreads, or gaps. Pair it with entry logic, risk management, and higher-timeframe context if you plan to use it for decisions.
趨勢分析
Fisher Volume Transform | AlphaNattFisher Volume Transform | AlphaNatt 
A powerful oscillator that applies the  Fisher Transform  - converting price into a Gaussian normal distribution - while incorporating  volume weighting  to identify high-probability reversal points with institutional participation.
 "The Fisher Transform reveals what statistics professors have known for decades: when you transform market data into a normal distribution, turning points become crystal clear." 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 🎲 THE MATHEMATICS 
 Fisher Transform Formula: 
The Fisher Transform converts any bounded dataset into a Gaussian distribution:
 y = 0.5 × ln((1 + x) / (1 - x)) 
Where x is normalized price (-1 to 1 range)
 Why This Matters: 
 
 Market extremes become statistically identifiable
 Turning points are amplified and clarified
 Removes the skew from price distributions
 Creates nearly instantaneous signals at reversals
 
 Volume Integration: 
Unlike standard Fisher Transform, this version weights price by relative volume:
 
 High volume moves get more weight
 Low volume moves get filtered out
 Identifies institutional participation
 Reduces false signals from retail chop
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 💎 KEY ADVANTAGES 
 
 Statistical Edge:  Transforms price into normal distribution where extremes are mathematically defined
 Volume Confirmation:  Only signals with volume support
 Early Reversal Detection:  Fisher Transform amplifies turning points
 Clean Signals:  Gaussian distribution reduces noise
 No Lag:  Mathematical transformation, not averaging
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 ⚙️ SETTINGS OPTIMIZATION 
 Fisher Period (5-30): 
 
 5-9:  Very sensitive, many signals
 10:  Default - balanced sensitivity
 15-20:  Moderate smoothing
 25-30:  Major reversals only
 
 Volume Weight (0.1-1.0): 
 
 0.1-0.3:  Minimal volume influence
 0.5-0.7:  Balanced price/volume
 0.7:  Default - strong volume weight
 0.8-1.0:  Volume dominant
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 📊 TRADING SIGNALS 
 Primary Signals: 
 
 Zero Cross Up:  Bullish momentum shift
 Zero Cross Down:  Bearish momentum shift
 Signal Line Cross:  Early reversal warning
 Extreme Readings (±75):  Potential reversal zones
 
 Visual Interpretation: 
 
 Cyan zones:  Bullish momentum
 Magenta zones:  Bearish momentum
 Gradient intensity:  Strength of move
 Histogram:  Raw momentum power
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 🎯 OPTIMAL USAGE 
 Best Market Conditions: 
 
 Range-bound markets (reversals clear)
 High volume periods
 Major support/resistance levels
 Divergence hunting
 
 Trading Strategies: 
 1. Extreme Reversal: 
Enter when oscillator exceeds ±75 and reverses
 2. Zero Line Momentum: 
Trade crosses of zero line with volume confirmation
 3. Signal Line Strategy: 
Early entry on signal line crosses
 4. Divergence Trading: 
Price makes new high/low but Fisher doesn't
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 Developed by AlphaNatt | Quantitative Trading Systems 
 Version:  1.0
 Classification:  Statistical Transform Oscillator
 Not financial advice. Always DYOR.
Logarithmic Bollinger Bands with Secondary BandThe Logarithmic Bollinger Bands indicator is a variation of standard Bollinger Bands that applies the calculation on a logarithmic scale rather than directly on price values. This approach is particularly useful in markets where assets experience exponential growth or large percentage-based moves, as it allows the bands to adapt proportionally instead of being distorted by absolute price changes. The indicator calculates a moving average of the log-transformed price (the basis), then adds and subtracts multiples of the standard deviation of the log price to form the upper and lower bands. Finally, the results are converted back to normal price scale for plotting. In addition to the primary bands set at 2.0 standard deviations, this version includes a secondary band set at 0.5 standard deviations, offering a closer inner envelope around the mean.
To use this indicator
Traders can observe how price interacts with both the inner and outer bands. The outer 2.0 standard deviation bands represent traditional Bollinger-style boundaries, highlighting potential overbought or oversold conditions when price pushes beyond them. 
The inner 0.5 bands provide an earlier signal of price compression and breakout potential, as moves outside these tighter bands often precede larger volatility expansions. 
Together, these dual layers give traders a way to monitor both short-term fluctuations and broader trend extremes, making it easier to spot opportunities for entries, exits, or risk management in markets where percentage-based scaling is more meaningful than raw price levels.
Custom Price Labels (10 liquidity key levels)A simple indicator for liquidity key level trader: 
Add your key level price and key note. 
You can adjust the color and font. 
How to find key level: 
Daily high and Low for key event 
eg: NVDA earning, Jackson Hole Day Pump, AI bubble report day dump, Aug Labor Data Revision day dump. If market is consolidating, these key event price level are trend target and reversal level. 
Trend Following S/R Fibonacci StrategyTrend Following S/R Fibonacci Strategy
Trend Following S/R Fibonacci Strategy
Distance from EMAThis indicator measures the percentage distance from an EMA. When price gets too far away from it's EMA, it can show that the trend is overheated
Auto-Anchored MA with Deviation BandsAuto-Anchored MA with Deviation Bands
✨ Features
📈 Auto-Anchored MA: Calculates moving averages (EMA, SMA, EWMA, WMA, VWAP, TEMA) anchored to user-defined periods (Hour, Day, Week, etc.).📏 Deviation Bands: Plots upper/lower bands using Percentage or Standard Deviation modes for volatility analysis.⚙️ Customizable Timeframes: Choose anchor periods from Hour to Year for flexible trend analysis.🎨 Visuals: Displays MA and bands with gradient fills, customizable colors, and adjustable display bars.⏱️ Countdown Table: Shows bars since the last anchor for easy tracking.🛠️ Smoothing: Applies smoothing to bands for cleaner visuals.  
🛠️ How to Use
Add to Chart: Apply the indicator on TradingView.  
Configure Inputs:  
Anchor Settings: Select anchor period (e.g., Day, Week).  
MA Settings: Choose MA type (e.g., VWAP, TEMA).  
Deviation Settings: Set deviation mode (Percentage/Std Dev) and multipliers.  
Display Settings: Adjust bars to display, colors, and gradient fill.
Analyze: View MA, deviation bands, and countdown table on the chart.  
Track Trends: Use bands as dynamic support/resistance and monitor anchor resets.
🎯 Why Use It?
Dynamic Analysis: Auto-anchors MA to key timeframes for adaptive trend tracking.  
Volatility Insight: Deviation bands highlight potential breakouts or reversals.  
Customizable: Tailor MA type, timeframe, and visuals to your trading style.  
User-Friendly: Clear visuals and countdown table simplify analysis.
📝 Notes
Ensure sufficient bars for accurate MA and deviation calculations.  
Gradient fill enhances readability but can be disabled for simplicity.  
Best used with complementary indicators like RSI or Bollinger Bands for robust strategies.
Happy trading! 🚀📈
MS - Çoklu Onay Stratejisi (AL-SAT)"VOLUME, MA50, RSI, DMI, ATR
5 conditions, all turning positive at the same time gives a buy signal; one of them turning negative gives a sell signal. This should be evaluated with weekly data. Not financial advice."
BTC 1D — Trend START/END Signals (clean, no repaint)
This strategy is designed primarily for BTC on the daily (1D) timeframe in TradingView.
BUY (start of uptrend)
Fast EMA is above Slow EMA.
Price breaks above the previous Donchian high.
Optional filters (if enabled): volume surge and strong momentum/RSI.
Only one BUY per uptrend—no additional buys until a SELL occurs.
SELL (end of uptrend)
Price falls below the previous Donchian low, or
Price drops below the Slow EMA, or
Momentum flips bearish (DI− > DI+ or RSI ≤ threshold).
One SELL marks the end of the uptrend.
Savitzky-Golay Hampel Filter | AlphaNattSavitzky-Golay Hampel Filter | AlphaNatt 
A revolutionary indicator combining  NASA's satellite data processing  algorithms with  robust statistical outlier detection  to create the most scientifically advanced trend filter available on TradingView.
 "This is the same mathematics that processes signals from the Hubble Space Telescope and analyzes data from the Large Hadron Collider - now applied to financial markets." 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 🚀 SCIENTIFIC PEDIGREE 
 Savitzky-Golay Filter Applications: 
 
 NASA:  Satellite telemetry and space probe data processing
 CERN:  Particle physics data analysis at the LHC
 Pharmaceutical:  Chromatography and spectroscopy analysis
 Astronomy:  Processing signals from radio telescopes
 Medical:  ECG and EEG signal processing
 
 Hampel Filter Usage: 
 
 Aerospace:  Cleaning sensor data from aircraft and spacecraft
 Manufacturing:  Quality control in precision engineering
 Seismology:  Earthquake detection and analysis
 Robotics:  Sensor fusion and noise reduction
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 🧬 THE MATHEMATICS 
 1. Savitzky-Golay Filter 
The SG filter performs  local polynomial regression  on data points:
 
 Fits a polynomial of degree  n  to a sliding window of data
 Evaluates the polynomial at the center point
 Preserves higher moments (peaks, valleys) unlike moving averages
 Maintains derivative information for true momentum analysis
 Originally published in  Analytical Chemistry  (1964)
 
 Mathematical Properties: 
 
 Optimal smoothing  in the least-squares sense
 Preserves statistical moments  up to polynomial order
 Exact derivative calculation  without additional lag
 Superior frequency response  vs traditional filters
 
 2. Hampel Filter 
A robust outlier detector based on  Median Absolute Deviation  (MAD):
 
 Identifies outliers using robust statistics
 Replaces spurious values with polynomial-fitted estimates
 Resistant to up to 50% contaminated data
 MAD is 1.4826 times more robust than standard deviation
 
 Outlier Detection Formula: 
 |x - median| > k × 1.4826 × MAD 
Where k is the threshold parameter (typically 3 for 99.7% confidence)
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 💎 WHY THIS IS SUPERIOR 
 vs Moving Averages: 
 
 Preserves peaks and valleys (critical for catching tops/bottoms)
 No lag penalty for smoothness
 Maintains derivative information
 Polynomial fitting > simple averaging
 
 vs Other Filters: 
 
 Outlier immunity (Hampel component)
 Scientifically optimal smoothing
 Preserves higher-order features
 Used in billion-dollar research projects
 
 Unique Advantages: 
 
 Feature Preservation:  Maintains market structure while smoothing
 Spike Immunity:  Ignores false breakouts and stop hunts
 Derivative Accuracy:  True momentum without additional indicators
 Scientific Validation:  60+ years of academic research
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 ⚙️ PARAMETER OPTIMIZATION 
 1. Polynomial Order (2-5) 
 
 2 (Quadratic):  Maximum smoothing, gentle curves
 3 (Cubic):  Balanced smoothing and responsiveness  (recommended) 
 4-5 (Higher):  More responsive, preserves more features
 
 2. Window Size (7-51) 
 
 Must be odd number
 Larger = smoother but more lag
 Formula: 2×(desired smoothing period) + 1
 Default 21 = analyzes 10 bars each side
 
 3. Hampel Threshold (1.0-5.0) 
 
 1.0:  Aggressive outlier removal (68% confidence)
 2.0:  Moderate outlier removal (95% confidence)
 3.0:  Conservative outlier removal (99.7% confidence)  (default) 
 4.0+:  Only extreme outliers removed
 
 4. Final Smoothing (1-7) 
 
 Additional WMA smoothing after filtering
 1 = No additional smoothing
 3-5 = Recommended for most timeframes
 7 = Ultra-smooth for position trading
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 📊 TRADING STRATEGIES 
 Signal Recognition: 
 
 Cyan Line:  Bullish trend with positive derivative
 Pink Line:  Bearish trend with negative derivative
 Color Change:  Trend reversal with polynomial confirmation
 
 1. Trend Following Strategy 
 
 Enter when price crosses above cyan filter
 Exit when filter turns pink
 Use filter as dynamic stop loss
 Best in trending markets
 
 2. Mean Reversion Strategy 
 
 Enter long when price touches filter from below in uptrend
 Enter short when price touches filter from above in downtrend
 Exit at opposite band or filter color change
 Excellent for range-bound markets
 
 3. Derivative Strategy (Advanced) 
 
 The SG filter preserves derivative information
 Acceleration = second derivative > 0
 Enter on positive first derivative + positive acceleration
 Exit on negative second derivative (momentum slowing)
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 📈 PERFORMANCE CHARACTERISTICS 
 Strengths: 
 
 Outlier Immunity:  Ignores stop hunts and flash crashes
 Feature Preservation:  Catches tops/bottoms better than MAs
 Smooth Output:  Reduces whipsaws significantly
 Scientific Basis:  Not curve-fitted or optimized to markets
 
 Considerations: 
 
 Slight lag in extreme volatility (all filters have this)
 Requires odd window sizes (mathematical requirement)
 More complex than simple moving averages
 Best with liquid instruments
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 🔬 SCIENTIFIC BACKGROUND 
 Savitzky-Golay Publication: 
 "Smoothing and Differentiation of Data by Simplified Least Squares Procedures" 
- Abraham Savitzky & Marcel Golay
- Analytical Chemistry, Vol. 36, No. 8, 1964
 Hampel Filter Origin: 
 "Robust Statistics: The Approach Based on Influence Functions" 
- Frank Hampel et al., 1986
- Princeton University Press
These techniques have been validated in thousands of scientific papers and are standard tools in:
 
 NASA's Jet Propulsion Laboratory
 European Space Agency
 CERN (Large Hadron Collider)
 MIT Lincoln Laboratory
 Max Planck Institutes
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 💡 ADVANCED TIPS 
 
 News Trading:  Lower Hampel threshold before major events to catch spikes
 Scalping:  Use Order=2 for maximum smoothness, Window=11 for responsiveness
 Position Trading:  Increase Window to 31+ for long-term trends
 Combine with Volume:  Strong trends need volume confirmation
 Multiple Timeframes:  Use daily for trend, hourly for entry
 Watch the Derivative:  Filter color changes when first derivative changes sign
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 ⚠️ IMPORTANT NOTICES 
 
 Not financial advice - educational purposes only
 Past performance does not guarantee future results
 Always use proper risk management
 Test settings on your specific instrument and timeframe
 No indicator is perfect - part of complete trading system
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 🏆 CONCLUSION 
The Savitzky-Golay Hampel Filter represents the  pinnacle of scientific signal processing  applied to financial markets. By combining polynomial regression with robust outlier detection, traders gain access to the same mathematical tools that:
 
 Guide spacecraft to other planets
 Detect gravitational waves from black holes
 Analyze particle collisions at near light-speed
 Process signals from deep space
 
This isn't just another indicator - it's  rocket science for trading .
 "When NASA needs to separate signal from noise in billion-dollar missions, they use these exact algorithms. Now you can too." 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 Developed by AlphaNatt 
 Version:  1.0
 Release:  2025
 Pine Script:  v6
 "Where Space Technology Meets Market Analysis" 
 Not financial advice. Always DYOR
PCV (Darren.L-V2)Description:
This indicator combines Bollinger Bands, CCI, and RVI to help identify high-probability zones on M15 charts.
Features:
Bollinger Bands (BB) – displayed on the main chart in light gray. Helps visualize overbought and oversold price levels.
CCI ±100 levels + RVI – displayed in a separate sub-window:
CCI only shows the ±100 reference lines.
RVI displays a cyan main line and a red signal line.
Valid Zone Detection:
Candle closes outside the Bollinger Bands.
RVI crosses above +100 or below -100 (CCI level reference).
Candle closes back inside the BB, confirming a price rebound.
Requires two touches in the same direction to confirm the zone.
Only zones within 20–30 pips range are considered valid.
Usage:
Helps traders spot reversal or bounce zones with clear visual signals.
Suitable for all indices, Forex, and crypto on M15 timeframe.
VWAP Pro v6 (Color + Bands)AI helped me code VWAP
When price goes above VWAP line, VWAP line will turn green to indicate buyers are in control.
When price goes below VWAP line, VWAP line will turn red to indicate sellers are in control. 
VWAP line stays blue when price is considered fair value. 
Laguerre-Kalman Adaptive Filter | AlphaNattLaguerre-Kalman Adaptive Filter |AlphaNatt 
A sophisticated trend-following indicator that combines  Laguerre polynomial filtering  with  Kalman optimal estimation  to create an ultra-smooth, low-lag trend line with exceptional noise reduction capabilities.
 "The perfect trend line adapts to market conditions while filtering out noise - this indicator achieves both through advanced mathematical techniques rarely seen in retail trading." 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 🎯 KEY FEATURES 
 
 Dual-Filter Architecture:  Combines two powerful filtering methods for superior performance
 Adaptive Volatility Adjustment:  Automatically adapts to market conditions
 Minimal Lag:  Laguerre polynomials provide faster response than traditional moving averages
 Optimal Noise Reduction:  Kalman filtering removes market noise while preserving trend
 Clean Visual Design:  Color-coded trend visualization (cyan/pink)
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 📊 THE MATHEMATICS 
 1. Laguerre Filter Component 
The Laguerre filter uses a cascade of four all-pass filters with a single gamma parameter:
 
 4th order IIR (Infinite Impulse Response) filter
 Single parameter (gamma) controls all filter characteristics
 Provides smoother output than EMA with similar lag
 Based on Laguerre polynomials from quantum mechanics
 
 2. Kalman Filter Component 
Implements a simplified Kalman filter for optimal estimation:
 
 Prediction-correction algorithm from aerospace engineering
 Dynamically adjusts based on estimation error
 Provides mathematically optimal estimate of true price trend
 Reduces noise while maintaining responsiveness
 
 3. Adaptive Mechanism 
 
 Monitors market volatility in real-time
 Adjusts filter parameters based on current conditions
 More responsive in trending markets
 More stable in ranging markets
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 ⚙️ INDICATOR SETTINGS 
 
 Laguerre Gamma (0.1-0.99):  Controls filter smoothness. Higher = smoother but more lag
 Adaptive Period (5-100):  Lookback for volatility calculation
 Kalman Noise Reduction (0.1-2.0):  Higher = more noise filtering
 Trend Threshold (0.0001-0.01):  Minimum change to register trend shift
 
 Recommended Settings: 
 
 Scalping:  Gamma: 0.6, Period: 10, Noise: 0.3
 Day Trading:  Gamma: 0.8, Period: 20, Noise: 0.5 (default)
 Swing Trading:  Gamma: 0.9, Period: 30, Noise: 0.8
 Position Trading:  Gamma: 0.95, Period: 50, Noise: 1.2
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 📈 TRADING SIGNALS 
 Primary Signals: 
 
 Cyan Line:  Bullish trend - price above filter and filter ascending
 Pink Line:  Bearish trend - price below filter or filter descending
 Color Change:  Potential trend reversal point
 
 Entry Strategies: 
 
 Trend Continuation:  Enter on pullback to filter line in trending market
 Trend Reversal:  Enter on color change with volume confirmation
 Breakout:  Enter when price crosses filter with momentum
 
 Exit Strategies: 
 
 Exit long when line turns from cyan to pink
 Exit short when line turns from pink to cyan
 Use filter as trailing stop in strong trends
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 ✨ ADVANTAGES OVER TRADITIONAL INDICATORS 
 Vs. Moving Averages: 
 
 Significantly less lag while maintaining smoothness
 Adaptive to market conditions
 Better noise filtering
 
 Vs. Standard Filters: 
 
 Dual-filter approach provides optimal estimation
 Mathematical foundation from signal processing
 Self-adjusting parameters
 
 Vs. Other Trend Indicators: 
 
 Cleaner signals with fewer whipsaws
 Works across all timeframes
 No repainting or lookahead bias
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 🎓 MATHEMATICAL BACKGROUND 
 The Laguerre filter was developed by John Ehlers, applying Laguerre polynomials (used in quantum mechanics) to financial markets. These polynomials provide an elegant solution to the lag-smoothness tradeoff that plagues traditional moving averages. 
 The Kalman filter, developed by Rudolf Kalman in 1960, is used in everything from GPS systems to spacecraft navigation. It provides the mathematically optimal estimate of a system's state given noisy measurements. 
 By combining these two approaches, this indicator achieves what neither can alone: a smooth, responsive trend line that adapts to market conditions while filtering out noise. 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 💡 TIPS FOR BEST RESULTS 
 
 Confirm with Volume:  Strong trends should have increasing volume
 Multiple Timeframes:  Use higher timeframe for trend, lower for entry
 Combine with Momentum:  RSI or MACD can confirm filter signals
 Market Conditions:  Adjust noise parameter based on market volatility
 Backtesting:  Always test settings on your specific instrument
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 ⚠️ IMPORTANT NOTES 
 
 No indicator is perfect - always use proper risk management
 Best suited for trending markets
 May produce false signals in choppy/ranging conditions
 Not financial advice - for educational purposes only
 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 🚀 CONCLUSION 
The Laguerre-Kalman Adaptive Filter represents a  significant advancement  in technical analysis, bringing institutional-grade mathematical techniques to retail traders. Its unique combination of polynomial filtering and optimal estimation provides a  clean, reliable trend-following tool  that adapts to changing market conditions.
Whether you're scalping on the 1-minute chart or position trading on the daily, this indicator provides  clear, actionable signals  with minimal false positives.
 "In the world of technical analysis, the edge comes from using better mathematics. This indicator delivers that edge." 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 
 Developed by AlphaNatt | Professional Quantitative Trading Tools 
 Version:  1.0
 Last Updated:  2025
 Pine Script:  v6
 License:  Open Source
 Not financial advice. Always DYOR
AVWAP+RSI Confluence — 1R TesterRSI + 1R ATR - Monthly P\&L (v4) 
WHAT THIS STRATEGY DOES (OVERVIEW)
* Pine strategy (v4) that combines a simple momentum trigger with a symmetric 1R ATR risk model and an on-chart Monthly/Yearly P\&L table.
* Momentum filter: trades only when RSI crosses its own SMA in the direction of the trend (price vs Trend EMA).
* Risk engine: exits use fixed 1R ATR brackets captured at entry (no drifting targets/stops).
* Accounting: the table aggregates percentage returns by month and year using strategy equity.
ENTRY LOGIC (LONGS & OPTIONAL SHORTS)
Indicators used:
* RSI(rsiLen) and its SMA: SMA(RSI, rsiMaLen)
* Trend filter: EMA(emaTrendLen) on price
Longs:
1. RSI crosses above its RSI SMA
2. RSI > rsiBuyThr (filters weak momentum)
3. Close > EMA(emaTrendLen)
Shorts (optional via enableShort):
1. RSI crosses below its RSI SMA
2. RSI < rsiSellThr
3. Close < EMA(emaTrendLen)
EXIT LOGIC AND RISK MODEL (1R ATR)
* On entry, snapshot ATR(atrLen) into atrAtEntry and the average fill price into entryPx.
* Longs: stop = entryPx - ATR \* atrMult; target = entryPx + ATR \* atrMult
* Shorts: mirrored.
* Stops and targets are posted immediately and remain fixed for the life of the trade.
POSITION SIZING AND COSTS
* Default position size: 25% of equity per trade (adjustable in Properties/inputs).
* Commission percent and a small slippage are set in strategy() so backtests include friction by default.
MONTHLY / YEARLY P\&L TABLE (HOW IT WORKS)
* Uses strategy equity to compute bar returns: equity / equity\  - 1.
* Compounds bar returns into current month and current year; commits each finished period at month/year change (or last bar).
* Renders rows as years; columns Jan..Dec plus a Year total column.
* Cells colored by sign; precision and maximum rows are controlled by inputs.
* Values represent percentage returns, not currency P\&L.
VISUAL AIDS
* Two pivot trails (pivot high/low) are plotted for context only; they do not affect entries or exits.
CUSTOMIZATION TIPS
* Raise rsiBuyThr (long) or lower rsiSellThr (short) to filter weak momentum.
* Increase emaTrendLen to tighten trend alignment.
* Adjust atrLen and atrMult to fit your timeframe/instrument volatility.
* Leave enableShort = false if you prefer long-only behavior or shorting is constrained.
NON-REPAINTING AND BACKTEST NOTES
* Signals use bar-close crosses of built-in indicators (RSI, EMA, ATR); no future bars are referenced.
* calc\_on\_every\_tick = true for responsive visuals; Strategy Tester evaluates on bar close in history.
* Backtest stop/limit fills are simulated and may differ from live execution/liquidity.
DISCLAIMERS
* Educational use only. This is not financial advice. Markets involve risk. Past performance does not guarantee future results.
INPUTS (QUICK REFERENCE)
* rsiLen, rsiMaLen, rsiBuyThr, rsiSellThr
* emaTrendLen
* atrLen, atrMult, enableShort
* leftBars, rightBars, prec, showTable, maxYearsRows
SHORT TAGLINE
RSI momentum with 1R ATR brackets and a built-in Monthly/Yearly P\&L table.
TAGS
strategy, RSI, ATR, trend, risk-management, backtest, Pine-v4
Greer Gap# Greer Gap Indicator (No mitigation: i.e. removing false signals)
## Summary
The **Greer Gap Indicator** identifies **Fair Value Gaps (FVGs)** and introduces specialized **Greer Bull Gaps (Blue)** and **Greer Bear Gaps (Orange)** to highlight high-probability trading opportunities. Unlike traditional FVG indicators, it avoids hindsight bias by not removing historical gaps based on future price action, ensuring transparency in signal accuracy. Built upon LuxAlgo’s FVG logic, it adds unique filtering: only the first Greer Gap after an opposite gap is plotted if its level (min for Bull, max for Bear) is not higher/lower than the previous Greer Gap of the same type, while all valid gaps are recorded for comparison. Traders can use these gaps as support/resistance or entry signals, customizable via timeframe, look back, and display options.
## Description
This indicator detects and displays **Fair Value Gaps (FVGs)** on the chart, with a focus on specialized **Greer Gaps**:
- **Bullish Gaps (Green)**: Areas where the low of the current candle is above the high of a previous candle (look back period), indicating potential upward momentum.
- **Bearish Gaps (Red)**: Areas where the high of the current candle is below the low of a previous candle, indicating potential downward momentum.
- **Greer Bull Gaps (Blue)**: A bullish gap that is above the latest bearish gap's max. Only the first such gap after a bearish gap is plotted if it meets criteria (not higher than the previous Greer Bull Gap's min), but all valid ones are recorded for comparison.
- **Greer Bear Gaps (Orange)**: A bearish gap that is below the latest bullish gap's min. Only the first such gap after a bullish gap is plotted if it meets criteria (not lower than the previous Greer Bear Gap's max), but all valid ones are recorded.
## How It Works
The script uses a dynamic look back period to detect FVGs. It maintains a record of all detected gaps and applies additional logic for Greer Gaps:
- **Greer Bull Gaps**: Checks if the new bullish gap's min is above the latest bearish gap's max. Plots only if it's the first since the last bearish gap and its min is <= previous Greer Bull min (or first one).
- **Greer Bear Gaps**: Checks if the new bearish gap's max is below the latest bullish gap's min. Plots only if it's the first since the last bullish gap and its max is >= previous Greer Bear max (or first one).
- **Resets**: A new bearish gap resets the Greer Bull Gap flag, and a new bullish gap resets the Greer Bear Gap flag.
## How to Use
- **Timeframe**: Set a higher timeframe (e.g., 'D' for daily) to detect gaps from that timeframe on the current chart.
- **Look back Period**: Adjust to change gap detection sensitivity (default: 34). Use 2 if you want to compare to LuxAlgo
- **Extend**: Controls how far right the gap boxes extend.
- **Show Options**: Toggle visibility of all bullish/bearish gaps or Greer Gaps.
- **Colors**: Customize colors for each gap type.
- **Application**: Use Greer Gaps as potential support/resistance levels or entry signals, but combine with other analysis for confirmation.
## Originality and Credits
This script is inspired by and builds upon the **"Fair Value Gap  "** indicator by LuxAlgo (available on TradingView:  ()).  
**Credits**: Thanks to LuxAlgo for the core FVG detection logic.  
**Significant Changes**:
- Added **Greer Bull and Bear Gap** logic for filtered, directional gaps with reset mechanisms.
- Introduced recording of all valid Greer Gaps without plotting all, to compare levels without hindsight bias.
- **No mitigation/removal of gaps**: Unlike LuxAlgo's approach, which mitigates (removes or alters) gaps based on future price action (e.g., when filled), this can create a hindsight bias where incorrect signals disappear over time. If a signal is used for a trade and later removed due to new data, it doesn't reflect real-time performance accurately. The Greer Gap avoids this by using gap comparisons to validate signals without altering historical boxes, ensuring transparency in when signals were right or wrong.
Stockbee ComboBearCustom indicator for identifying stocks that meet the Stockbee's ComboBear criteria. This can be used as a standalone indicator or use it to screen for stocks in Pine Screener.
ComboBearCustom indicator for identifying stocks that meet the Stockbee's ComboBear criteria. This can be used as a standalone indicator or use it to screen for stocks in Pine Screener.
Stockbee ComboBullCustom indicator for identifying stocks that meet the ComboBull criteria. This can be used as a standalone indicator or use it to screen for stocks in Pine Screener.
Valid Monthly LevelsValid Monthly Levels (No Sweeps) + Smart Labels
This tool automatically plots the highs and lows of each completed monthly candle and tracks their validity in real time. A level is considered valid until it has been swept (price trades strictly beyond that high or low). Once swept, the line and label can either be removed or dimmed depending on your settings.
Key features:
Monthly highs and lows: Each month’s range is marked with horizontal levels that extend forward.
Valid vs. swept logic: Levels are only valid until breached; swept levels can be hidden or kept as dotted/grey lines.
Smart labels: Each level is labeled with the month and year (e.g., Sep ’25 H/L). On higher timeframes, labels sit at the candle; on lower timeframes, labels automatically shift to the right edge so they don’t disappear off-screen.
Customizable appearance: Choose colors for highs, lows, and swept levels; adjust line styles; and limit how many past months are shown.
Clutter control: Cap the maximum number of labels, so your chart stays readable even on small intraday timeframes.
This indicator is useful for traders who track monthly supply/demand extremes, liquidity sweeps, and higher-timeframe context when executing on lower timeframes.
Dual Relative Strength (Fast & Slow, Single Baseline)Dual-Period RS Setup (Fast + Slow)
1. Fast RS (Early Leadership)
	•	Indicator: Relative Strength (by modhelius)
	•	Comparative Symbol: NIFTY
	•	Period: 26 weeks (~6 months)
	•	Purpose: Detects early shifts in relative strength before price fully confirms.
⸻
2. Slow RS (Confirmation)
	•	Add the same indicator again.
	•	Comparative Symbol: NIFTY
	•	Period: 52 weeks (1 year)
	•	Purpose: Confirms sustained leadership. Helps filter noise & false positives.
Dual Relative Strength (vs NIFTY) Nikrun1. Fast RS (Early Leadership)
	•	Indicator: Relative Strength (by modhelius)
	•	Comparative Symbol: NIFTY
	•	Period: 26 weeks (~6 months)
	•	Purpose: Detects early shifts in relative strength before price fully confirms.
⸻
2. Slow RS (Confirmation)
	•	Add the same indicator again.
	•	Comparative Symbol: NIFTY
	•	Period: 52 weeks (1 year)
	•	Purpose: Confirms sustained leadership. Helps filter noise & false positives.
⸻
3. Visuals
	•	Style tip:
	•	Make RS(26) = blue line (fast, responsive).
	•	Make RS(52) = thicker black/green line (slow, authority).
	•	Keep zero line visible so you instantly see outperformance/underperformance.
⸻
Market Opening Time### TradingView Pine Script "Market Opening Time" Explanation
This Pine Script (`@version=5`) is an indicator that visually highlights market trading sessions (Sydney, London, New York, etc.) by changing the chart's background color. It adjusts for U.S. and Australian Daylight Saving Time (DST).
---
#### **1. Overview**
- **Purpose**: Changes the chart's background color based on UTC time zones to highlight market sessions.
- **Features**:
  - Automatically adjusts for U.S. DST (2nd Sunday of March to 1st Sunday of November) and Australian DST (1st Sunday of October to 1st Sunday of April).
  - Assigns colors to four time zones (00:00, 06:30, 14:00, 21:00).
- **Use Case**: Helps forex/stock traders identify active market sessions.
---
#### **2. Key Logic**
- **DST Detection**:
  - `f_isUSDst`: Checks U.S. DST status.
  - `f_isAustraliaDst`: Checks Australian DST status.
- **Time Adjustment** (`f_getAdjustedTime`):
  - U.S. DST off: Shifts `time3` (14:00) forward by 1 hour.
  - Australian DST off: Shifts `time4` (21:00) forward by 1 hour.
- **Time Conversion** (`f_timeToMinutes`): Converts time (e.g., "14:00") to minutes (e.g., 840).
- **Current Time** (`f_currentTimeInMinutes`): Gets UTC time in minutes.
- **Background Color** (`f_getBackgroundColor`):
  - Applies colors based on time ranges:
    - 00:00–06:30: Orange (Asia)
    - 06:30–14:00: Purple (London)
    - 14:00–21:00: Blue (New York, DST-adjusted)
    - 21:00–00:00: Red (Sydney, DST-adjusted)
    - Outside ranges: Gray
---
#### **3. Settings**
- **Time Zones**:
  - `time1` = 00:00 (Orange)
  - `time2` = 06:30 (Purple)
  - `time3` = 14:00 (Blue, DST-adjusted)
  - `time4` = 21:00 (Red, DST-adjusted)
- **Colors**: Transparency set to 90 for visibility.
---
#### **4. Example**
- **September 5, 2025, 10:25 PM JST (13:25 UTC)**:
  - U.S. DST active, Australian DST inactive.
  - 13:25 UTC falls between `time2` (06:30) and `time3` (14:00) → Background is **Purple** (London session).
- **Effect**: Background color changes dynamically to reflect active sessions.
---
#### **5. Customization**
- Modify `time1`–`time4` or colors for different sessions.
- Add time zones for other markets (e.g., Tokyo).
---
#### **6. Notes**
- Uses UTC; ensure chart is set to UTC.
- DST rules are U.S./Australia-specific; verify for other regions.
A simple, visual tool for tracking market sessions.
----
### TradingView Pine Script「Market Opening Time」解説
このPine Script(`@version=5`)は、市場の取引時間帯(シドニー、ロンドン、ニューヨークなど)を背景色で視覚化するインジケーターです。米国とオーストラリアの夏時間(DST)を考慮し、時間帯を調整します。
---
#### **1. 概要**
- **目的**: UTC基準の時間帯に基づき、チャートの背景色を変更して市場セッションを強調。
- **機能**:
  - 米国DST(3月第2日曜~11月第1日曜)とオーストラリアDST(10月第1日曜~4月第1日曜)を自動調整。
  - 4つの時間帯(00:00、06:30、14:00、21:00)に色を割り当て。
- **用途**: FXや株式トレーダーが市場のアクティブ時間を把握。
---
#### **2. 主要ロジック**
- **DST判定**:
  - `f_isUSDst`: 米国DSTを判定。
  - `f_isAustraliaDst`: オーストラリアDSTを判定。
- **時間調整** (`f_getAdjustedTime`):
  - 米国DST非適用時: `time3`(14:00)を1時間遅延。
  - オーストラリアDST非適用時: `time4`(21:00)を1時間遅延。
- **時間変換** (`f_timeToMinutes`): 時間(例: "14:00")を分単位(840)に変換。
- **現在時刻** (`f_currentTimeInMinutes`): UTCの現在時刻を分単位で取得。
- **背景色** (`f_getBackgroundColor`):
  - 時間帯に応じた色を適用:
    - 00:00~06:30: オレンジ(アジア)
    - 06:30~14:00: 紫(ロンドン)
    - 14:00~21:00: 青(ニューヨーク、DST調整)
    - 21:00~00:00: 赤(シドニー、DST調整)
    - 時間外: グレー
---
#### **3. 設定**
- **時間帯**:
  - `time1` = 00:00(オレンジ)
  - `time2` = 06:30(紫)
  - `time3` = 14:00(青、DST調整)
  - `time4` = 21:00(赤、DST調整)
- **色**: 透明度90で視認性確保。
---
#### **4. 使用例**
- **2025年9月5日22:25 JST(13:25 UTC)**:
  - 米国DST適用、豪DST非適用。
  - 13:25は`time2`(06:30)~`time3`(14:00)の間 → 背景色は**紫**(ロンドン)。
- **効果**: 時間帯に応じて背景色が変化し、市場セッションを直感的に把握。
---
#### **5. カスタマイズ**
- 時間帯(`time1`~`time4`)や色を変更可能。
- 他の市場(例: 東京)に対応する時間帯を追加可能。
---
#### **6. 注意点**
- UTC基準のため、チャート設定をUTCに。
- DSTルールは米国・オーストラリア準拠。他地域では要確認。
シンプルで視覚的な市場時間インジケーターです。
Composite Sentiment Indicator (SPY/QQQ/SOXX + VixFix)# Multi-Index Composite Sentiment Indicator
A comprehensive sentiment indicator that works across SPY, QQQ, SOXX, and custom symbols. Combines volatility, options flow, macro factors, technicals, and seasonality into a single z-score composite.
## What It Does
Takes multiple market sentiment inputs (VIX, put/call ratios, breadth, yields, etc.) and smooshes them into one normalized line. When the composite is high = markets getting spooked. When it's low = markets getting complacent.
## Key Features
- **Multi-Index Support**: Automatically adapts for SPY (uses VIX), QQQ (uses VXN), SOXX (uses VixFix), or custom symbols
- **VixFix Integration**: Larry Williams' VixFix for indices without dedicated VIX measures  
- **Signal MA**: Choose from SMA/EMA/WMA/HMA/TEMA/DEMA with color coding (red above MA = risk-on, green below = risk-off)
- **September Focus**: Built-in seasonality weighting for September weakness patterns
- **Comprehensive Components**: Volatility, options sentiment, macro factors, technicals, and sector-specific metrics
## How to Use
**Basic Setup:**
1. Pick your index (SPY/QQQ/SOXX)
2. Choose signal MA type and length (EMA 21 is a good start)
3. Watch for extreme readings and MA crossovers
**Color Signals:**
- Red composite = above signal MA = bearish sentiment 
- Green composite = below signal MA = bullish sentiment
- Extreme high readings (red background) = potential tops
- Extreme low readings (green background) = potential bottoms
**For Different Indices:**
- **QQQ**: Uses NASDAQ VIX (VXN) when available, falls back to VixFix
- **SOXX**: Includes semiconductor cycle indicators, uses VixFix for volatility
- **Custom**: Adapts automatically, relies on VixFix and general market metrics
## Components Included
**Volatility**: VIX/VXN/VixFix, term structure, historical vol
**Options**: Put/call ratios, SKEW index  
**Macro**: DXY, 10Y yields, yield curve, TIPS spreads
**Technical**: RSI deviation, momentum
**Seasonality**: September effects, quad witching, month-end patterns
**Breadth**: S&P 500 and NASDAQ breadth measures
## Pro Tips
- Works well on Daily Timeframe
- September gets extra weight automatically - watch for August setup signals
- Keltner envelope breaks often mark sentiment exhaustion points
- Use alerts for extreme readings and MA crossovers
Works best when you understand that sentiment extremes often mark turning points, not continuation signals. High readings don't mean "keep shorting" - they mean "start looking for reversal setups."
## Settings Worth Tweaking
- Signal MA type/length for your timeframe
- Component weights based on what matters for your index
- Envelope multipliers for your risk tolerance
- VixFix parameters if default doesn't fit your symbol's volatility
The table shows all current component readings so you can see what's driving the signal. Good for context and debugging weird readings.






















