Machine Learning BBPct [BackQuant]Machine Learning BBPct
What this is (in one line)
A Bollinger Band %B oscillator enhanced with a simplified K-Nearest Neighbors (KNN) pattern matcher. The model compares today’s context (volatility, momentum, volume, and position inside the bands) to similar situations in recent history and blends that historical consensus back into the raw %B to reduce noise and improve context awareness. It is informational and diagnostic—designed to describe market state, not to sell a trading system.
Background: %B in plain terms
Bollinger %B measures where price sits inside its dynamic envelope: 0 at the lower band, 1 at the upper band, ~ 0.5 near the basis (the moving average). Readings toward 1 indicate pressure near the envelope’s upper edge (often strength or stretch), while readings toward 0 indicate pressure near the lower edge (often weakness or stretch). Because bands adapt to volatility, %B is naturally comparable across regimes.
Why add (simplified) KNN?
Classic %B is reactive and can be whippy in fast regimes. The simplified KNN layer builds a “nearest-neighbor memory” of recent market states and asks: “When the market looked like this before, where did %B tend to be next bar?” It then blends that estimate with the current %B. Key ideas:
• Feature vector . Each bar is summarized by up to five normalized features:
– %B itself (normalized)
– Band width (volatility proxy)
– Price momentum (ROC)
– Volume momentum (ROC of volume)
– Price position within the bands
• Distance metric . Euclidean distance ranks the most similar recent bars.
• Prediction . Average the neighbors’ prior %B (lagged to avoid lookahead), inverse-weighted by distance.
• Blend . Linearly combine raw %B and KNN-predicted %B with a configurable weight; optional filtering then adapts to confidence.
This remains “simplified” KNN: no training/validation split, no KD-trees, no scaling beyond windowed min-max, and no probabilistic calibration.
How the script is organized (by input groups)
1) BBPct Settings
• Price Source – Which price to evaluate (%B is computed from this).
• Calculation Period – Lookback for SMA basis and standard deviation.
• Multiplier – Standard deviation width (e.g., 2.0).
• Apply Smoothing / Type / Length – Optional smoothing of the %B stream before ML (EMA, RMA, DEMA, TEMA, LINREG, HMA, etc.). Turning this off gives you the raw %B.
2) Thresholds
• Overbought/Oversold – Default 0.8 / 0.2 (inside ).
• Extreme OB/OS – Stricter zones (e.g., 0.95 / 0.05) to flag stretch conditions.
3) KNN Machine Learning
• Enable KNN – Switch between pure %B and hybrid.
• K (neighbors) – How many historical analogs to blend (default 8).
• Historical Period – Size of the search window for neighbors.
• ML Weight – Blend between raw %B and KNN estimate.
• Number of Features – Use 2–5 features; higher counts add context but raise the risk of overfitting in short windows.
4) Filtering
• Method – None, Adaptive, Kalman-style (first-order),
or Hull smoothing.
• Strength – How aggressively to smooth. “Adaptive” uses model confidence to modulate its alpha: higher confidence → stronger reliance on the ML estimate.
5) Performance Tracking
• Win-rate Period – Simple running score of past signal outcomes based on target/stop/time-out logic (informational, not a robust backtest).
• Early Entry Lookback – Horizon for forecasting a potential threshold cross.
• Profit Target / Stop Loss – Used only by the internal win-rate heuristic.
6) Self-Optimization
• Enable Self-Optimization – Lightweight, rolling comparison of a few canned settings (K = 8/14/21 via simple rules on %B extremes).
• Optimization Window & Stability Threshold – Governs how quickly preferred K changes and how sensitive the overfitting alarm is.
• Adaptive Thresholds – Adjust the OB/OS lines with volatility regime (ATR ratio), widening in calm markets and tightening in turbulent ones (bounded 0.7–0.9 and 0.1–0.3).
7) UI Settings
• Show Table / Zones / ML Prediction / Early Signals – Toggle informational overlays.
• Signal Line Width, Candle Painting, Colors – Visual preferences.
Step-by-step logic
A) Compute %B
Basis = SMA(source, len); dev = stdev(source, len) × multiplier; Upper/Lower = Basis ± dev.
%B = (price − Lower) / (Upper − Lower). Optional smoothing yields standardBB .
B) Build the feature vector
All features are min-max normalized over the KNN window so distances are in comparable units. Features include normalized %B, normalized band width, normalized price ROC, normalized volume ROC, and normalized position within bands. You can limit to the first N features (2–5).
C) Find nearest neighbors
For each bar inside the lookback window, compute the Euclidean distance between current features and that bar’s features. Sort by distance, keep the top K .
D) Predict and blend
Use inverse-distance weights (with a strong cap for near-zero distances) to average neighbors’ prior %B (lagged by one bar). This becomes the KNN estimate. Blend it with raw %B via the ML weight. A variance of neighbor %B around the prediction becomes an uncertainty proxy ; combined with a stability score (how long parameters remain unchanged), it forms mlConfidence ∈ . The Adaptive filter optionally transforms that confidence into a smoothing coefficient.
E) Adaptive thresholds
Volatility regime (ATR(14) divided by its 50-bar SMA) nudges OB/OS thresholds wider or narrower within fixed bounds. The aim: comparable extremeness across regimes.
F) Early entry heuristic
A tiny two-step slope/acceleration probe extrapolates finalBB forward a few bars. If it is on track to cross OB/OS soon (and slope/acceleration agree), it flags an EARLY_BUY/SELL candidate with an internal confidence score. This is explicitly a heuristic—use as an attention cue, not a signal by itself.
G) Informational win-rate
The script keeps a rolling array of trade outcomes derived from signal transitions + rudimentary exits (target/stop/time). The percentage shown is a rough diagnostic , not a validated backtest.
Outputs and visual language
• ML Bollinger %B (finalBB) – The main line after KNN blending and optional filtering.
• Gradient fill – Greenish tones above 0.5, reddish below, with intensity following distance from the midline.
• Adaptive zones – Overbought/oversold and extreme bands; shaded backgrounds appear at extremes.
• ML Prediction (dots) – The KNN estimate plotted as faint circles; becomes bright white when confidence > 0.7.
• Early arrows – Optional small triangles for approaching OB/OS.
• Candle painting – Light green above the midline, light red below (optional).
• Info panel – Current value, signal classification, ML confidence, optimized K, stability, volatility regime, adaptive thresholds, overfitting flag, early-entry status, and total signals processed.
Signal classification (informational)
The indicator does not fire trade commands; it labels state:
• STRONG_BUY / STRONG_SELL – finalBB beyond extreme OS/OB thresholds.
• BUY / SELL – finalBB beyond adaptive OS/OB.
• EARLY_BUY / EARLY_SELL – forecast suggests a near-term cross with decent internal confidence.
• NEUTRAL – between adaptive bands.
Alerts (what you can automate)
• Entering adaptive OB/OS and extreme OB/OS.
• Midline cross (0.5).
• Overfitting detected (frequent parameter flipping).
• Early signals when early confidence > 0.7.
These are purely descriptive triggers around the indicator’s state.
Practical interpretation
• Mean-reversion context – In range markets, adaptive OS/OB with ML smoothing can reduce whipsaws relative to raw %B.
• Trend context – In persistent trends, the KNN blend can keep finalBB nearer the mid/upper region during healthy pullbacks if history supports similar contexts.
• Regime awareness – Watch the volatility regime and adaptive thresholds. If thresholds compress (high vol), “OB/OS” comes sooner; if thresholds widen (calm), it takes more stretch to flag.
• Confidence as a weight – High mlConfidence implies neighbors agree; you may rely more on the ML curve. Low confidence argues for de-emphasizing ML and leaning on raw %B or other tools.
• Stability score – Rising stability indicates consistent parameter selection and fewer flips; dropping stability hints at a shifting backdrop.
Methodological notes
• Normalization uses rolling min-max over the KNN window. This is simple and scale-agnostic but sensitive to outliers; the distance metric will reflect that.
• Distance is unweighted Euclidean. If you raise featureCount, you increase dimensionality; consider keeping K larger and lookback ample to avoid sparse-neighbor artifacts.
• Lag handling intentionally uses neighbors’ previous %B for prediction to avoid lookahead bias.
• Self-optimization is deliberately modest: it only compares a few canned K/threshold choices using simple “did an extreme anticipate movement?” scoring, then enforces a stability regime and an overfitting guard. It is not a grid search or GA.
• Kalman option is a first-order recursive filter (fixed gain), not a full state-space estimator.
• Hull option derives a dynamic length from 1/strength; it is a convenience smoothing alternative.
Limitations and cautions
• Non-stationarity – Nearest neighbors from the recent window may not represent the future under structural breaks (policy shifts, liquidity shocks).
• Curse of dimensionality – Adding features without sufficient lookback can make genuine neighbors rare.
• Overfitting risk – The script includes a crude overfitting detector (frequent parameter flips) and will fall back to defaults when triggered, but this is only a guardrail.
• Win-rate display – The internal score is illustrative; it does not constitute a tradable backtest.
• Latency vs. smoothness – Smoothing and ML blending reduce noise but add lag; tune to your timeframe and objectives.
Tuning guide
• Short-term scalping – Lower len (10–14), slightly lower multiplier (1.8–2.0), small K (5–8), featureCount 3–4, Adaptive filter ON, moderate strength.
• Swing trading – len (20–30), multiplier ~2.0, K (8–14), featureCount 4–5, Adaptive thresholds ON, filter modest.
• Strong trends – Consider higher adaptive_upper/lower bounds (or let volatility regime do it), keep ML weight moderate so raw %B still reflects surges.
• Chop – Higher ML weight and stronger Adaptive filtering; accept lag in exchange for fewer false extremes.
How to use it responsibly
Treat this as a state descriptor and context filter. Pair it with your execution signals (structure breaks, volume footprints, higher-timeframe bias) and risk management. If mlConfidence is low or stability is falling, lean less on the ML line and more on raw %B or external confirmation.
Summary
Machine Learning BBPct augments a familiar oscillator with a transparent, simplified KNN memory of recent conditions. By blending neighbors’ behavior into %B and adapting thresholds to volatility regime—while exposing confidence, stability, and a plain early-entry heuristic—it provides an informational, probability-minded view of stretch and reversion that you can interpret alongside your own process.
趨勢分析
Adaptive SuperTrend Stop – Daily Stocks (by G.I.N.e Trading)Indicator: Adaptive SuperTrend Stop – Daily Stocks (by G.I.N.e Trading)
What it does
A single, easy-to-read trailing stop line designed for stocks on the daily timeframe. It adapts to trend strength and suppresses noise.
Red line = active stop for long trends.
Green line = active stop for short trends.
The opposite side can be shown faintly for context (optional).
How it works
Adaptive SuperTrend core (ATR × multiplier).
Uses ATR(22) (≈ 1 month).
The multiplier auto-scales with ADX: it tightens in strong trends and loosens in weak ones (linear interpolation between Slow and Fast multipliers using an ADX low/high band).
ATR “cap” (gap/spike control).
ATR is capped at SMA(ATR) × capMult to avoid oversized stops after abnormal moves.
Structural cushion (Donchian + ATR).
Long stop = max(SuperTrend, DonchianLow(N) + cushion × ATR)
Short stop = min(SuperTrend, DonchianHigh(N) − cushion × ATR)
This prevents the stop from sitting inside the recent range.
Gap shield (daily only).
On an adverse gap ≥ X × ATR, the cushion widens only for that bar to avoid false exits.
Regime confirmation (anti-whipsaw).
A trend switch (up ↔ down) is confirmed only after N consecutive bars agreeing with the new regime.
HMA(50) color tone (optional).
Does not drive the stop; it just shades the line (strong vs soft color) if HMA slope agrees with the trend.
Key inputs
ATR length & cap (SMA(ATR) × capMult).
ADX period/smoothing + ADX low/high band, Slow/Fast multipliers.
Donchian length & ATR cushion (+ optional gap shield: threshold and extra pad).
Confirm bars for regime change; show passive line (optional).
How to use
For longs, trail the red line; for shorts, trail the green line.
Exit when price closes through the active stop, or use it as a dynamic stop-loss.
The stop auto-tightens in strong trends and relaxes in choppy phases; the cushion helps avoid noise-stops within recent ranges.
Tuning tips
Tighter / earlier exits: raise Fast multiplier, lower Slow, reduce Donchian length or cushion, set confirm bars = 1.
Looser / let winners run: lower Fast, raise Slow, increase Donchian length or cushion, set confirm bars = 3.
If your universe is very volatile, raise ADX high and the cap multiplier slightly.
Best for
Daily equities where you want a clean, adaptive trailing stop that respects trend strength, mitigates gaps/spikes, and avoids getting trapped inside short-term ranges.
Fractal Circles#### FRACTAL CIRCLES ####
I combined 2 of my best indicators Fractal Waves (Simplified) and Circles.
Combining the Fractal and Gann levels makes for a very simple trading strategy.
Core Functionality
Gann Circle Levels: This indicator plots mathematical support and resistance levels based on Gann theory, including 360/2, 360/3, and doubly strong levels. The system automatically adjusts to any price range using an intelligent multiplier system, making it suitable for forex, stocks, crypto, or any market.
Fractal Wave Analysis: Integrates real-time trend analysis from both current and higher timeframes. Shows the current price range boundaries (high/low) and trend direction through dynamic lines and background fills, helping traders understand market structure.
Key Trading Benefits
Active Level Detection: The closest Gann level to current price is automatically highlighted in green with increased line thickness. This eliminates guesswork about which level is most likely to act as immediate support or resistance.
Real-Time Price Tracking: A customizable line follows current price with an offset to the right, projecting where price sits relative to upcoming levels. A gradient-filled box visualizes the exact distance between current price and the active Gann level.
Multi-Timeframe Context: View fractal waves from higher timeframes while maintaining current timeframe precision. This helps identify whether short-term moves align with or contradict longer-term structure.
Smart Alert System: Comprehensive alerts trigger when price crosses any Gann level, with options to monitor all levels or focus only on the active level. Reduces the need for constant chart monitoring while ensuring you never miss significant level breaks.
Practical Trading Applications
Entry Timing: Use active level highlighting to identify the most probable support/resistance for entries. The real-time distance box helps gauge risk/reward before entering positions.
Risk Management: Set stops based on Gann level breaks, particularly doubly strong levels which tend to be more significant. The gradient visualization makes it easy to see how much room price has before hitting key levels.
Trend Confirmation: Fractal waves provide immediate context about whether current price action aligns with broader market structure. Bullish/bearish background fills offer quick visual confirmation of trend direction.
Multi-Asset Analysis: The auto-scaling multiplier system works across all markets and timeframes, making it valuable for traders who monitor multiple instruments with vastly different price ranges.
Confluence Trading: Combine Gann levels with fractal wave boundaries to identify high-probability setups where multiple technical factors align.
This tool is particularly valuable for traders who appreciate mathematical precision in their technical analysis while maintaining the flexibility to adapt to real-time market conditions.
Trend Change Strength – by G.I.N.e TradingIdentifies powerful trend reversals with high follow-through potential. The sub-pane plots green bars for strong bullish shifts, red bars for strong bearish shifts, and gray bars for sideways/no-trade conditions. Bar height reflects how many “strength conditions” are met.
How it works (signals = K-of-7 conditions)
The indicator scores each bar by checking up to 7 independent strength factors:
Trend inflection: HMA slope flips with a minimum slope magnitude.
Price confirmation: Close crosses the HMA with an ATR buffer.
Directional energy: ADX above threshold and rising.
Momentum thrust: RSI exits the neutral band and MACD turns/accelerates.
Volatility expansion: ATR above its moving average and BBWidth expanding.
Volume + candle quality: Volume above MA × multiplier with a strong body location (thrust candle).
Structural breakout: Close breaks recent high/low window.
Bullish (green) when at least K bullish conditions are true.
Bearish (red) when at least K bearish conditions are true.
Lateral (gray) when a separate flat filter (low ADX, flat slope, BBWidth below its MA) is active.
Key inputs
Trend/Price: HMA length, min slope %, ATR buffer, breakout lookback.
Momentum: RSI period + neutral band, MACD (fast/slow/signal), momentum lookback.
Vol/Volatility: Volume MA period & multiplier, min candle body ratio, ATR/BBWidth expansion settings.
ADX Gate: ADX period/smoothing/threshold, optional gating.
Logic: needHits K (minimum strong conditions), confirmBars (persistence), cooldownBars (avoid rapid re-signals).
Lateral Filter: thresholds for ADX, slope %, and BBWidth vs its MA.
How to use
Trade only green/red bars (direction comes from bar color); skip gray bars.
Combine with your entries (HARSI/MACD/price action) and your exit/trailing logic.
Use needHits to control selectivity: higher K = fewer, stronger signals.
Tuning tips
More selective: increase needHits, ADX threshold, minSlope%, ATR/BB expansion multipliers, and breakout lookback.
More permissive: lower needHits, soften thresholds, reduce cooldown.
Best for
Daily stocks and intraday futures/indices when you want quality reversal entries with evidence of momentum, volatility, directionality, volume, and structure—all aligned.
Multi-Band Trend LineThis Pine Script creates a versatile technical indicator called "Multi-Band Trend Line" that builds upon the concept of the popular "Follow Line Indicator" by Dreadblitz. While the original Follow Line Indicator uses simple trend detection to place a line at High or Low levels, this enhanced version combines multiple band-based trading strategies with dynamic trend line generation. The indicator supports five different band types and provides more sophisticated buy/sell signals based on price breakouts from various technical analysis bands.
Key Features
Multi-Band Support
The indicator supports five different band types:
- Bollinger Bands: Uses standard deviation to create bands around a moving average
- Keltner Channels: Uses ATR (Average True Range) to create bands around a moving average
- Donchian Channels: Uses the highest high and lowest low over a specified period
- Moving Average Envelopes: Creates bands as a percentage above and below a moving average
- ATR Bands: Uses ATR multiplier to create bands around a moving average
Dynamic Trend Line Generation (Enhanced Follow Line Concept)
- Similar to the Follow Line Indicator, the trend line is placed at High or Low levels based on trend direction
- Key Enhancement: Instead of simple trend detection, this version uses band breakouts to trigger trend changes
- When price breaks above the upper band (bullish signal), the trend line is set to the low (optionally adjusted with ATR) - similar to Follow Line's low placement
- When price breaks below the lower band (bearish signal), the trend line is set to the high (optionally adjusted with ATR) - similar to Follow Line's high placement
- The trend line acts as dynamic support/resistance, following the price action more precisely than the original Follow Line
ATR Filter (Follow Line Enhancement)
- Like the original Follow Line Indicator, an ATR filter can be selected to place the line at a more distance level than the normal mode settled at candles Highs/Lows
- When enabled, it adds/subtracts ATR value to provide more conservative trend line placement
- Helps reduce false signals in volatile markets
- This feature maintains the core philosophy of the Follow Line while adding more precision through band-based triggers
Signal Generation
- Buy Signal: Generated when trend changes from bearish to bullish (trend line starts rising)
- Sell Signal: Generated when trend changes from bullish to bearish (trend line starts falling)
- Signals are displayed as labels on the chart
Visual Elements
- Upper and lower bands are plotted in gray
- Trend line changes color based on direction (green for bullish, red for bearish)
- Background color changes based on trend direction
- Buy/sell signals are marked with labeled shapes
How It Works
Band Calculation: Based on the selected band type, upper and lower boundaries are calculated
Signal Detection: When price closes above the upper band or below the lower band, a breakout signal is generated
Trend Line Update: The trend line is updated based on the breakout direction and previous trend line value
Trend Direction: Determined by comparing current trend line with the previous value
Alert Generation: Buy/sell conditions trigger alerts and visual signals
Use Cases
Enhanced trend following strategies: More precise than basic Follow Line due to band-based triggers
Breakout trading: Multiple band types provide various breakout opportunities
Dynamic support/resistance identification: Combines Follow Line concept with band analysis
Multi-timeframe analysis with different band types: Choose the most suitable band for your timeframe
Reduced false signals: Band confirmation provides better entry/exit points compared to simple trend following
Anti-Lateral Filter – Trio by G.I.N.e TradingThis indicator flags market regimes to help you avoid sideways chop. It plots gray columns when conditions indicate a lateral/non-trending market (do not enter), and green columns when conditions indicate a trend-ready environment (entries allowed). Direction (long/short) is not assigned—pair it with your own triggers.
How it works (4 selectable modes)
ER (Efficiency Ratio): Measures directional efficiency of price movement (Kaufman ER). Low ER ⇒ sideways; high ER ⇒ directional.
CHOP + Squeeze: Uses Choppiness Index (log TR vs range) and Bollinger Band Width percentile. High CHOP + low BBWidth ⇒ lateral; CHOP dropping + BB expanding ⇒ trend.
Donchian Trendiness: Normalized distance of close from the Donchian channel midline. Near center ⇒ lateral; near edges ⇒ trend.
Hybrid (2-of-3): Confirms trend only when at least two methods agree; similarly for lateral.
Extras
ADX gate (optional): Require ADX ≥ threshold for trend confirmation.
Consecutive-bar confirmation: confirmBars ensures regime persistence before switching.
Inputs (key)
Method selector: ER / CHOP+Squeeze / Donchian / Hybrid 2-of-3.
confirmBars (persistence), useAdxGate + adxLen/smoothing/threshold.
ER lookback & thresholds; CHOP length & BBWidth percentile; Donchian length & trendiness bounds.
How to use
Apply the indicator in a sub-pane.
Trade only on green bars (trend-ready) and stand aside on gray bars (lateral).
Combine with your entry logic (e.g., HARSI/MACD/price action) and your own risk management.
Tuning tips
More permissive (more greens): Lower ER trend threshold, raise CHOP trend max, lower Donchian trendiness min, set confirmBars=1, or disable ADX gate.
More selective (fewer greens): Do the opposite and consider higher ADX threshold.
OKX Contract Martin SAR SignalDescription:
This script combines the Parabolic SAR indicator with a Martingale trading strategy for OKX contracts, optimized for high-frequency trading on lower timeframes (e.g., 45-minute charts). It automatically identifies trend reversals, generates buy and sell signals, and provides real-time alerts for entry and exit points. Key features include:
Trend Reversal Detection: Automatically detects changes between uptrends and downtrends using SAR values.
Martingale Strategy: Incorporates a customizable acceleration factor for adapting to market volatility.
Real-Time Alerts: Sends JSON-formatted webhook alerts for automation and includes detailed signal labels on the chart.
Customizable Parameters: Fully adjustable SAR settings (start, increment, and maximum factors) for different trading styles.
This strategy is ideal for traders seeking precise contract signals with high-frequency execution. However, use caution and conduct thorough backtesting before deploying in live markets, especially for ultra-high-frequency trading.
Low of day distanceA simple indicator that tells you the distance to the low of the day in percentage terms.
Useful for quick position sizing calculations when your strategy, for instance, uses low of day stops.
ELITE TRADERS RSI TREND VIEWName: RSI (Relative Strength Index)
Type: Momentum Oscillator
Default Length: 14 (periods)
Description:
Relative Strength Index (RSI) என்பது ஒரு momentum oscillator ஆகும். இது price movement-இன் வேகத்தையும் (speed) மாற்றங்களையும் (change) அளவிடுகிறது. RSI value 0–100 scale-இல் காணப்படும்.
RSI 70-க்கு மேல் சென்றால் அது Overbought நிலையை (விலை அதிகமாக உயர்ந்தது, sell வாய்ப்பு) குறிக்கும்.
RSI 30-க்கு கீழ் வந்தால் அது Oversold நிலையை (விலை அதிகமாக குறைந்தது, buy வாய்ப்பு) குறிக்கும்.
RSI-யை பயன்படுத்தி trend strength, divergence, reversal signals மற்றும் entry/exit points கண்டுபிடிக்கலாம்.
Formula (சுருக்கமாக):
RSI = 100 – (100 / (1 + RS))
இதில்,
RS = (Average Gain / Average Loss)
Usage:
Trend confirmation
Overbought / Oversold signals
Bullish & Bearish Divergence spotting
Support/Resistance confirmation
Default Settings:
RSI Length: 14
Overbought: 70
Oversold: 30
RSI by Tamil harmonic trader rajRSI Indicator will show RSI value on chart right side as per timeframe.
AI Fib Strategy (Full Trade Plan)This indicator automatically plots Fibonacci retracements and a Golden Zone box (61.8%–65% retracement) based on the 4H candle body high/low.
Features:
Auto-detects session breaks or daily breaks (configurable).
Draws standard Fib retracement levels (0%, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%).
Highlights the Golden Zone for high-probability trade entries.
Optional Take Profit extensions (TP1, TP2, TP3).
Fully compatible with Pine Script v6.
Usage:
Best applied on intraday charts (15m, 30m, 1H).
Use the Golden Zone for entry confirmations.
Combine with candlestick patterns, order blocks, or volume for stronger signals.
RSI + OB-OS Labels + BB Trend + 2Candle Colors + MAThis Indicator plots Bollinger Bands with 2 moving averages and candles can be colored Bull/Bear based on price crossing BB or MA1, selectable by user. It has an auto fill switch when switching from BB mid line to MA1. There are Overbought Oversold RSI labels above and below the candles as well as the current RSI label at the current price. The labels for MAs are placed to the right of last candle and its offset and size is adjustable. These labels can be hidden individually or all at once.
Default BB mid line is set to 39 WMA
Default ALMA for MA1 is set to 30 with Sigma 5 and offset 0.9
Default MA2 is set to HMA 130
Impulse Convexity Trend Gate [T1][T69]OVERVIEW 🧭
• A price-only trend engine that opens a “gate” only when trend strength, acceleration, and impulse dominance align.
• Built from three cooperating parts: adaptive slope, directional convexity, and an impulse-vs-pullback ratio.
• Output is a bounded oscillator (−100…+100) plus side-specific gate states (bull/bear), with optional pullback and weakness highlights.
THE IDEA & USEFULNESS 🧪
• Not a simple mashup: each component plays a distinct role—slope for direction, convexity for acceleration agreement, and an impulse ratio to suppress correction noise.
• Adaptive EMA length (series-based) lets the midline adjust to conditions without external indicators.
• Approximation of hyperbolic tangent and clamp keep signals bounded and stable while avoiding library dependencies.
• Designed to help trend traders act only when continuation is likely, and stand down during pullbacks or chop.
HOW IT WORKS (PIPELINE) ⚙️
• Price transform
• Uses log price for scale stability.
• Adaptive midline
• Volatility-aware EMA length is clamped between minimum and maximum, then applied via a custom recursive EMA.
• Slope & convexity
• Slope (first difference of the midline) defines direction; convexity (second difference) verifies acceleration agrees with that direction.
• Impulse vs pullback ratio (R)
• Sums directional progress versus counter-direction pullbacks over a window; requires impulse to dominate.
• Normalization & score
• Slope and convexity are normalized by recent dispersion; combined into a raw score and squashed to −100…+100 using manual tanh.
• Trend gate
• Gate opens only when: R ≥ threshold, |normalized slope| ≥ threshold, and slope/convexity share the same sign.
• States & visuals
• Bull/Bear Gate Entry when gate is open, oscillator crosses ±15 in the correct direction, price is on the correct side of the midline, and slope/convexity agree.
• Pullbacks mark counter-moves while a gate is active; Weakness flags specific fade patterns after pullbacks.
FEATURES ✨
• Bull and Bear Gate Entries (green/red columns).
• Pullback shading and optional trend-weakness highlights (yellow/orange + teal/maroon).
• Background tint reflects the active side (bull or bear).
• Pure price logic; no volume or external filters required.
HOW TO USE 🎯
• Regime filter
• Trade only in the direction of the open gate; ignore signals when the gate is closed.
• Pullback entries
• During an open gate, wait for a pullback zone, then act on trend-resumption (e.g., oscillator re-push through ±15 or structure break in gate direction).
• Exits & risk
• Consider trimming when the oscillator relaxes toward 0 while the gate remains open, or when convexity flips against slope and R deteriorates.
• Timeframes & markets
• Suited for trend following on crypto/FX/indices from M30 to 4H/1D; raise thresholds on lower timeframes to reduce noise.
CONFIGURATION 🔧
• Impulse ratio gate (R ≥): raises/lowers the standard for continuation dominance.
• Slope strength gate (|sN| ≥): controls how strong a slope must be to count.
• Show Pullback Impulse (toggle): enable/disable pullback highlights.
• Show Trend Weakness (toggle): enable/disable weakness flags.
LIMITATIONS ⚠️
• As a trend tool, it can lag at regime transitions; expect whipsaws in tight ranges.
• Parameters are instrument- and timeframe-dependent; tune thresholds before live use.
• Pullback/weakness flags are contextual—not trade signals by themselves; use them with gate state and your execution rules.
ADVANCED TIPS 🛠️
• Tighten R and slope thresholds for lower timeframes; loosen for higher timeframes.
• Pair with NNFX-style money management and pair-level filters; let the gate be the confirmation layer, not the entry trigger by itself.
• Batch-test across 100+ symbols, export metrics, and run Monte Carlo to validate LLN reliability and Sharpe/IQR stability.
• For system hedging, disable entries when both sides trigger on the same asset to avoid internal conflict.
NOTES 📝
• Price-only construction reduces data-vendor differences and keeps behavior consistent across markets.
• Manual tanh/clamp ensure stable, bounded scores even during extremes.
DISCLAIMER 🛡️
• For research and education. No financial advice. Test thoroughly, size conservatively, and respect your risk rules.
2 Reds -> 2 Greens Strategy with Custom TP/SLcustom candle configuration with a 61 percent win rate in the strategy tester user can configure take profit and stop loss to suit
ATR Stoploss 15m with EMA Trend 1H - Dotted Fixeduse this as a basic ATR stoploss. It uses 100 and 20 EMA on 1hr to determine trend.
TrueOpens [AY]¹ See how price reacts to key multi-day and monthly open levels—perfect for S/R-focused traders.
Experimental indicator for tracking multi-day openings and ICT True Month Open levels, ideal for S/R traders.
TrueOpens ¹ – Multi-Day & True Month Open Levels
This indicator is experimental and designed to help traders visually track opening price levels across multiple days, along with the ICT True Month Open (TMO).
Key Features:
Supports up to 12 configurable multi-day opening sessions, each with independent color, style, width, and label options.
Automatically detects the True Month Open using the ICT method (2nd Monday of each month) and plots it on the chart.
Lines can extend dynamically and are limited to a user-defined number of historical bars for clarity.
Fully customizable timezones, label sizes, and display options.
This indicator is ideal for observing how price interacts with key levels, especially for traders who favor support and resistance-based strategies.
Disclaimer: This is an analytical tool for observation purposes. It does not provide buy or sell signals. Users should combine it with their own analysis and risk management.
ZLT - Hyperscalp - TestWhat This Strategy Does - Complete Overview
This is a professional scalping strategy designed for fast-moving markets like NAS100 (NASDAQ 100). It's built to catch quick price bounces when the market pulls back too far in a trending move.
The Big Picture
Think of it like a rubber band strategy: When price stretches too far from its average (like pulling a rubber band), it tends to snap back. This strategy identifies those stretched moments and enters trades expecting the "snap back" to happen.
Step-by-Step How It Works
1. First, it identifies the overall trend (Higher Timeframe Analysis)
Looks at a bigger picture (15-30 minute chart)
Uses two moving averages (50 EMA and 200 EMA)
Only trades WITH the trend, never against it
2. Then waits for a pullback (The Setup)
In an uptrend: Waits for price to dip below the lower Keltner Channel
In a downtrend: Waits for price to spike above the upper Keltner Channel
Also checks if RSI shows oversold (longs) or overbought (shorts)
3. Looks for reversal signs (The Trigger)
RSI starting to turn back (crossing 50)
Price crossing back into normal range
Momentum shifting back toward the trend
4. Filters out bad trades (Quality Control)
ADX must be above threshold (trending market, not choppy)
Volatility must be in acceptable range (not too quiet, not too crazy)
Only trades during specified hours (liquid sessions)
Enforces cooldown periods between trades
5. Manages the position (Risk Management)
Sets initial stop loss based on ATR (market volatility)
Moves stop to breakeven when trade goes in profit
Activates trailing stop to protect profits
Takes profit at predetermined target (1.2x risk by default)
Three Built-in Presets for NAS100
🔴 Aggressive (1-minute charts)
More trades, quicker entries
Tighter stops, faster action
For experienced scalpers
🟡 Balanced (3-minute charts)
Moderate frequency
Balanced risk/reward
Good starting point
🟢 Conservative (5-minute charts)
Fewer, higher-quality trades
Wider stops, bigger targets
For cautious traders
Why It Works
The strategy exploits three market tendencies:
Mean reversion: Extreme moves tend to reverse
Trend continuation: Overall trends tend to persist
Momentum patterns: RSI extremes often mark turning points
Best Used For
Markets: Indices like NAS100, S&P 500
Timeframes: 1-5 minute charts
Conditions: Trending markets with good volatility
Style: Day trading/scalping (quick in-and-out trades)
Key Features
No repainting: Signals are final once they appear
Automatic position sizing: Uses percentage of equity
Multiple safety checks: Prevents overtrading
Visual indicators: Shows entry points, trend lines, and channels
Alerts: Can notify you when trades trigger
The Bottom Line
This strategy is like having a systematic trader who:
Only buys dips in uptrends
Only sells rallies in downtrends
Waits for extreme stretches
Enters when price starts snapping back
Manages risk automatically
Prevents emotional overtrading
It's designed to take many small, controlled bites rather than swinging for home runs. Perfect for active traders who want systematic, rule-based entries and exits.
Mutanabby_AI | ATR+ | Trend-Following StrategyThis document presents the Mutanabby_AI | ATR+ Pine Script strategy, a systematic approach designed for trend identification and risk-managed position entry in financial markets. The strategy is engineered for long-only positions and integrates volatility-adjusted components to enhance signal robustness and trade management.
Strategic Design and Methodological Basis
The Mutanabby_AI | ATR+ strategy is constructed upon a foundation of established technical analysis principles, with a focus on objective signal generation and realistic trade execution.
Heikin Ashi for Trend Filtering: The core price data is processed via Heikin Ashi (HA) methodology to mitigate transient market noise and accentuate underlying trend direction. The script offers three distinct HA calculation modes, allowing for comparative analysis and validation:
Manual Calculation: Provides a transparent and deterministic computation of HA values.
ticker.heikinashi(): Utilizes TradingView's built-in function, employing confirmed historical bars to prevent repainting artifacts.
Regular Candles: Allows for direct comparison with standard OHLC price action.
This multi-methodological approach to trend smoothing is critical for robust signal generation.
Adaptive ATR Trailing Stop: A key component is the Average True Range (ATR)-based trailing stop. ATR serves as a dynamic measure of market volatility. The strategy incorporates user-defined parameters (
Key Value and ATR Period) to calibrate the sensitivity of this trailing stop, enabling adaptation to varying market volatility regimes. This mechanism is designed to provide a dynamic exit point, preserving capital and locking in gains as a trend progresses.
EMA Crossover for Signal Generation: Entry and exit signals are derived from the interaction between the Heikin Ashi derived price source and an Exponential Moving Average (EMA). A crossover event between these two components is utilized to objectively identify shifts in momentum, signaling potential long entry or exit points.
Rigorous Stop Loss Implementation: A critical feature for risk mitigation, the strategy includes an optional stop loss. This stop loss can be configured as a percentage or fixed point deviation from the entry price. Importantly, stop loss execution is based on real market prices, not the synthetic Heikin Ashi values. This design choice ensures that risk management is grounded in actual market liquidity and price levels, providing a more accurate representation of potential drawdowns during backtesting and live operation.
Backtesting Protocol: The strategy is configured for realistic backtesting, employing fill_orders_on_standard_ohlc=true to simulate order execution at standard OHLC prices. A configurable Date Filter is included to define specific historical periods for performance evaluation.
Data Visualization and Metrics: The script provides on-chart visual overlays for buy/sell signals, the ATR trailing stop, and the stop loss level. An integrated information table displays real-time strategy parameters, current position status, trend direction, and key price levels, facilitating immediate quantitative assessment.
Applicability
The Mutanabby_AI | ATR+ strategy is particularly suited for:
Cryptocurrency Markets: The inherent volatility of assets such as #Bitcoin and #Ethereum makes the ATR-based trailing stop a relevant tool for dynamic risk management.
Systematic Trend Following: Individuals employing systematic methodologies for trend capture will find the objective signal generation and rule-based execution aligned with their approach.
Pine Script Developers and Quants: The transparent code structure and emphasis on realistic backtesting provide a valuable framework for further analysis, modification, and integration into broader quantitative models.
Automated Trading Systems: The clear, deterministic entry and exit conditions facilitate integration into automated trading environments.
Implementation and Evaluation
To evaluate the Mutanabby_AI | ATR+ strategy, apply the script to your chosen chart on TradingView. Adjust the input parameters (Key Value, ATR Period, Heikin Ashi Method, Stop Loss Settings) to observe performance across various asset classes and timeframes. Comprehensive backtesting is recommended to assess the strategy's historical performance characteristics, including profitability, drawdown, and risk-adjusted returns.
I'd love to hear your thoughts, feedback, and any optimizations you discover! Drop a comment below, give it a like if you find it useful, and share your results.
Capiba Directional Momentum Oscillator (ADX-based)
🇬🇧 English
Summary
The Capiba ADX is a momentum oscillator that transforms the classic ADX (Average Directional Index) into a much more intuitive visual tool. Instead of analyzing three separate lines (ADX, DI+, DI-), this indicator consolidates the strength and direction of the trend into a single histogram that oscillates around the zero line.
The result is a clear and immediate reading of market sentiment, allowing traders to quickly identify who is in control—buyers or sellers—and with what intensity.
How to Interpret and Use the Indicator
The operation of the Capiba ADX is straightforward:
Green Histogram (Above Zero): Indicates that buying pressure (DI+) is in control. The height of the bar represents the magnitude of the bullish momentum. Taller green bars suggest a stronger uptrend.
Red Histogram (Below Zero): Indicates that selling pressure (DI-) is in control. The "depth" of the bar represents the magnitude of the bearish momentum. Lower (more negative) red bars suggest a stronger downtrend.
Zero Line (White): This is the equilibrium point. Crossovers through the zero line signal a potential shift in trend control.
Crossover Above: Buyers are taking control.
Crossover Below: Sellers are taking control.
Reference Levels (Momentum Strength)
The indicator plots three fixed reference levels to help gauge the intensity of the move:
0 Line: Equilibrium.
100 Line: Signals significant directional momentum. When the histogram surpasses this level, the trend (whether bullish or bearish) is gaining considerable strength.
200 Line: Signals very strong directional momentum, or even potential exhaustion conditions. Moves that reach this level are powerful but may also precede a consolidation or reversal.
Usage Strategy
Trend Confirmation: Use the indicator to confirm the direction of your analysis. If you are looking for long positions, the Capiba ADX should ideally be green and, preferably, rising.
Strength Identification: Watch for the histogram to cross the 100 and 200 levels to validate the strength of a breakout or an established trend.
Entry/Exit Signals: A zero-line crossover can be used as a primary entry or exit signal, especially when confirmed by other technical analysis tools.
Acknowledgements
This indicator is the result of adapting knowledge and open-source codes shared by the vibrant TradingView community.
Supercharged Scalping Indicator v1 No repaintSupercharged Scalping Indicator with:
✅ Buy/Sell arrows (no repaint).
✅ EMA50, EMA200, VWAP, ATR bands plotted for context.
✅ Momentum + volume confirmation.
✅ Color-coded background when confluence is strong.
⚡ How It Works
Trend filter: EMA50 vs EMA200 decides bullish/bearish bias.
VWAP + ATR bands: Confirms pullback zones for scalping entries.
Momentum: RSI > 50 & MACD > 0 for longs, RSI < 50 & MACD < 0 for shorts.
Volume: Only fire signals when above average volume → avoids dead zones.
Candle confirmation: Requires strong-bodied candle (no tiny indecision bars).
Non-repaint: All signals confirmed on bar close.
Capiba Ultimate Suite (RSI, MA Cloud & Volatility)
🇬🇧 English
Summary
This indicator, Capiba Ultimate Suite, is a powerful compilation of various open-source technical analysis tools, refined and integrated into a single, cohesive, and functional package. The goal is to provide a complete system with clear entry and exit signals, ideal for traders operating in trending and volatile markets.
The combination of a custom momentum oscillator (Ultimate RSI), a moving average cloud for trend definition, and a volatility oscillator for range analysis transforms this script into a true trading suite.
Disclaimer: This indicator is most effective in markets with a defined trend (bullish or bearish) and may generate less reliable signals during periods of strong consolidation.
Components and How to Use
Ultimate RSI with Crossover Signals (Entries and Exits)
What it is: A variation of the classic RSI, designed to be more reactive to price movements.
Entry Signals (Buy): A green arrow (▲) appears below the candle when the Ultimate RSI line crosses above its momentum line (EMA). This is a signal of a potential start of an upward move.
Exit Signals (Sell): A red arrow (▼) appears above the candle when the Ultimate RSI crosses below its momentum line. This is a signal of potential weakening or trend reversal.
Moving Average Cloud (Trend Filter)
What it is: A cloud formed by the space between a short-term moving average (default 55) and a long-term one (default 233).
How to use for signal validation:
Uptrend: When the cloud is green (Short MA > Long MA), buy signals (▲) are strengthened. Sell signals can be seen as partial profit-taking.
Downtrend: When the cloud is red (Short MA < Long MA), sell signals (▼) are strengthened. Buy signals should be treated with extreme caution as they are against the main trend.
Candle Coloring (Quick Momentum Reading)
Lime Green: Strong bullish momentum (RSI > 50 and above its EMA).
Red: Strong bearish momentum (RSI < 50 and below its EMA).
Blue: Overbought level reached.
Yellow: Oversold level reached.
Volatility Ruler (Breakout Analysis)
What it is: The green (high) and red (low) lines mark the range of the last 'N' candles. The Vol: X.XX label on the right measures the current volatility against its historical average.
How to use:
Vol < 1.00: Contracting volatility ("Squeeze"). The market is "coiling the spring." Watch for an impending breakout of the range lines.
Vol > 1.00: Expanding volatility. Confirms the strength of a breakout that has already occurred. Very high values may indicate exhaustion.
Use the ruler to identify false breakouts: a candle closing outside the line but with a very low Vol value is more likely to be a false signal.
Acknowledgements
This indicator is the result of compiling and adapting open-source concepts and codes available in the TradingView community. Thanks to all the developers who share their knowledge.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
RSI Diode PanelA small and clean RSI panel that simultaneously shows the 15m, 30m, 1h, 2h, 4h, and 1d timeframes, which can help you with basic trend orientation.