Machine Learning Moving Average [BackQuant]Machine Learning Moving Average
A powerful tool combining clustering, pseudo-machine learning, and adaptive prediction, enabling traders to understand and react to price behavior across multiple market regimes (Bullish, Neutral, Bearish). This script uses a dynamic clustering approach based on percentile thresholds and calculates an adaptive moving average, ideal for forecasting price movements with enhanced confidence levels.
What is Percentile Clustering?
Percentile clustering is a method that sorts and categorizes data into distinct groups based on its statistical distribution. In this script, the clustering process relies on the percentile values of a composite feature (based on technical indicators like RSI, CCI, ATR, etc.). By identifying key thresholds (lower and upper percentiles), the script assigns each data point (price movement) to a cluster (Bullish, Neutral, or Bearish), based on its proximity to these thresholds.
This approach mimics aspects of machine learning, where we “train” the model on past price behavior to predict future movements. The key difference is that this is not true machine learning; rather, it uses data-driven statistical techniques to "cluster" the market into patterns.
Why Percentile Clustering is Useful
Clustering price data into meaningful patterns (Bullish, Neutral, Bearish) helps traders visualize how price behavior can be grouped over time.
By leveraging past price behavior and technical indicators, percentile clustering adapts dynamically to evolving market conditions.
It helps you understand whether price behavior today aligns with past bullish or bearish trends, improving market context.
Clusters can be used to predict upcoming market conditions by identifying regimes with high confidence, improving entry/exit timing.
What This Script Does
Clustering Based on Percentiles : The script uses historical price data and various technical features to compute a "composite feature" for each bar. This feature is then sorted and clustered based on predefined percentile thresholds (e.g., 10th percentile for lower, 90th percentile for upper).
Cluster-Based Prediction : Once clustered, the script uses a weighted average, cluster momentum, or regime transition model to predict future price behavior over a specified number of bars.
Dynamic Moving Average : The script calculates a machine-learning-inspired moving average (MLMA) based on the current cluster, adjusting its behavior according to the cluster regime (Bullish, Neutral, Bearish).
Adaptive Confidence Levels : Confidence in the predicted return is calculated based on the distance between the current value and the other clusters. The further it is from the next closest cluster, the higher the confidence.
Visual Cluster Mapping : The script visually highlights different clusters on the chart with distinct colors for Bullish, Neutral, and Bearish regimes, and plots the MLMA line.
Prediction Output : It projects the predicted price based on the selected method and shows both predicted price and confidence percentage for each prediction horizon.
Trend Identification : Using the clustering output, the script colors the bars based on the current cluster to reflect whether the market is trending Bullish (green), Bearish (red), or is Neutral (gray).
How Traders Use It
Predicting Price Movements : The script provides traders with an idea of where prices might go based on past market behavior. Traders can use this forecast for short-term and long-term predictions, guiding their trades.
Clustering for Regime Analysis : Traders can identify whether the market is in a Bullish, Neutral, or Bearish regime, using that information to adjust trading strategies.
Adaptive Moving Average for Trend Following : The adaptive moving average can be used as a trend-following indicator, helping traders stay in the market when it’s aligned with the current trend (Bullish or Bearish).
Entry/Exit Strategy : By understanding the current cluster and its associated trend, traders can time entries and exits with higher precision, taking advantage of favorable conditions when the confidence in the predicted price is high.
Confidence for Risk Management : The confidence level associated with the predicted returns allows traders to manage risk better. Higher confidence levels indicate stronger market conditions, which can lead to higher position sizes.
Pseudo Machine Learning Aspect
While the script does not use conventional machine learning models (e.g., neural networks or decision trees), it mimics certain aspects of machine learning in its approach. By using clustering and the dynamic adjustment of a moving average, the model learns from historical data to adjust predictions for future price behavior. The "learning" comes from how the script uses past price data (and technical indicators) to create patterns (clusters) and predict future market movements based on those patterns.
Why This Is Important for Traders
Understanding market regimes helps to adjust trading strategies in a way that adapts to current market conditions.
Forecasting price behavior provides an additional edge, enabling traders to time entries and exits based on predicted price movements.
By leveraging the clustering technique, traders can separate noise from signal, improving the reliability of trading signals.
The combination of clustering and predictive modeling in one tool reduces the complexity for traders, allowing them to focus on actionable insights rather than manual analysis.
How to Interpret the Output
Bullish (Green) Zone : When the price behavior clusters into the Bullish zone, expect upward price movement. The MLMA line will help confirm if the trend remains upward.
Bearish (Red) Zone : When the price behavior clusters into the Bearish zone, expect downward price movement. The MLMA line will assist in tracking any downward trends.
Neutral (Gray) Zone : A neutral market condition signals indecision or range-bound behavior. The MLMA line can help track any potential breakouts or trend reversals.
Predicted Price : The projected price is shown on the chart, based on the cluster's predicted behavior. This provides a useful reference for where the price might move in the near future.
Prediction Confidence : The confidence percentage helps you gauge the reliability of the predicted price. A higher percentage indicates stronger market confidence in the forecasted move.
Tips for Use
Combining with Other Indicators : Use the output of this indicator in combination with your existing strategy (e.g., RSI, MACD, or moving averages) to enhance signal accuracy.
Position Sizing with Confidence : Increase position size when the prediction confidence is high, and decrease size when it’s low, based on the confidence interval.
Regime-Based Strategy : Consider developing a multi-strategy approach where you use this tool for Bullish or Bearish regimes and a separate strategy for Neutral markets.
Optimization : Adjust the lookback period and percentile settings to optimize the clustering algorithm based on your asset’s characteristics.
Conclusion
The Machine Learning Moving Average offers a novel approach to price prediction by leveraging percentile clustering and a dynamically adapting moving average. While not a traditional machine learning model, this tool mimics the adaptive behavior of machine learning by adjusting to evolving market conditions, helping traders predict price movements and identify trends with improved confidence and accuracy.
Statistics
Vandan V2Vandan V2 is an automated trading strategy for NQ1! (E-mini Nasdaq-100) based on short-term mean reversion with dynamic risk control. It combines volatility filters and overbought/oversold signals to capture local market imbalances.
Backtested from 2015 to 2025, it achieved a +730% total return, Profit Factor of 1.40, max drawdown of only 1.61%, and over 106,000 trades. Designed for systematic scalping or intraday arbitrage with a limit of 3 simultaneous contracts.
Intraday Perpetual Premium & Z-ScoreThis indicator measures the real-time premium of a perpetual futures contract relative to its spot market and interprets it through a statistical lens.
It helps traders detect when funding pressure is building, when leverage is being unwound, and when crowding in the futures market may precede volatility.
How it works
• Premium (%) = (Perp – Spot) ÷ Spot × 100
The script fetches both spot and perpetual prices and calculates their percentage difference each minute.
• Rolling Mean & Z-Score
Over a 4-hour look-back, it computes the average premium and standard deviation to derive a Z-Score, showing how stretched current sentiment is.
• Dynamic ±2σ Bands highlight statistically extreme premiums or discounts.
• Rate of Change (ROC) over one hour gauges the short-term directional acceleration of funding flows.
Colour & Label Interpretation
Visual cue Meaning Trading Implication
🟢 Green bars + “BULL Pressure” Premium rising faster than mean Leverage inflows → momentum strengthening
🔴 Red bars + “BEAR Pressure” Premium shrinking Leverage unwind → pull-back or consolidation
⚠️ Orange “EXTREME Premium/Discount” Crowded trade → heightened reversal risk
⚪ Grey bars Neutral Balanced conditions
Alerts
• Bull Pressure Alert → funding & premium rising (momentum building)
• Bear Pressure Alert → premium falling (deleveraging)
• Extreme Premium Alert → crowded longs; potential top
• Extreme Discount Alert → capitulation; possible bottom
Use case
Combine this indicator with your Heikin-Ashi, RSI, and MACD confluence rules:
• Enter only when your oscillators are low → curling up and Bull Pressure triggers.
• Trim or exit when Bear Pressure or Extreme Premium appears.
• Watch for Extreme Discount during flushes as an early bottoming clue.
Yang-Zhang Volatility (YZVol) by CoryP1990 – Quant ToolkitThe Yang-Zhang Volatility (YZVol) estimator measures realized volatility using both overnight gaps and intraday moves. It combines three components: overnight returns, open-to-close returns, and the Rogers–Satchell term, weighted by Zhang’s k to reduce bias.
How to read it
Line color: Green when YZVol is rising (volatility expansion), Red when falling (volatility compression).
Background: Green tint = above High-vol threshold (active regime). Red tint = below Low-vol threshold (quiet regime).
Units: Displays Daily % by default on any timeframe (values are normalized to daily). An optional toggle shows Annualized % (√252 × Daily %).
Typical uses
Spot transitions between quiet and active regimes.
Compare realized vol vs implied vol or a risk-target.
Adapt position sizing to volatility clustering.
Defaults
Length = 20
High-vol threshold = 5% (Daily)
Low-vol threshold = 1% (Daily)
Optional: Annualized % display
Example — SPY (1D)
During the 2020 crash, YZVol surged to 5.8 % per day, capturing the height of pandemic-era volatility before compressing into a calm regime through 2021. Volatility re-expanded in 2022 due to reinflamed COVID fears and gradually stabilized through 2023. A sharp, liquidity-driven volatility event in August 2024 caused another brief YZVol surge, reflecting the historic one-day VIX spike triggered by market-wide risk-off flows and thin pre-market liquidity. A second, policy-driven expansion followed in April–May 2025, coinciding with the renewed U.S.–China tariff conflict and a sharp equity pullback. Since mid-2025, YZVol has settled near 1 % per day, with the red background confirming that realized volatility has once again compressed into a quiet, low-risk regime.
Part of the Quant Toolkit — transparent, open-source indicators for modern quantitative analysis. Built by CoryP1990.
Fractal Dimension Index (FDI) by CoryP1990 – Quant ToolkitThe Fractal Dimension Index (FDI) quantifies how directional or choppy price movement is; in other words, it measures the “roughness” of a trend. FDI values near 1.0–1.3 indicate strong directional trends, while values near 1.5–2.0 reflect chaotic or range-bound behavior. This makes FDI a powerful tool for detecting trend vs. mean-reversion regimes.
How it works
Calculates the ratio of average price changes over full and half-length windows to estimate the fractal dimension of price movement.
Teal line = FDI decreasing → trending behavior (market smoother, more directional).
Orange line = FDI increasing → choppiness or consolidation.
Background:
Green tint = trend-friendly regime (FDI below low threshold).
Orange tint = choppy regime (FDI above high threshold).
Use cases
Detect when markets shift from trend-following to mean-reverting conditions.
Filter trades: favor trend strategies when FDI < 1.3 and reversion setups when FDI > 1.7.
Combine with momentum or volatility metrics to classify regimes.
Defaults
Length = 20
High-FDI threshold = 1.8
Low-FDI threshold = 1.2
Example — TSLA (1D, 2021)
Early 2021 trades choppy to sideways with FDI swinging up toward 1.5, then the index drops below 1.2 as Tesla transitions into a persistent trend-friendly regime through the second half of the year (green background). During the Q4 breakout, FDI holds ~1.0–1.2, confirming strong directionality; brief pullbacks lift FDI back toward the mid-range before trending pressure resumes. At the right edge, FDI sits well below the low threshold, signaling that price remains in a trend-supportive state.
Part of the Quant Toolkit — transparent, open-source indicators for modern quantitative analysis. Built by CoryP1990.
Intraday Intensity Percent (IIP) by CoryP1990 – Quant ToolkitThe Intraday Intensity Percent (IIP) quantifies buying vs. selling pressure within each bar by combining price position inside the range and trading volume. It’s essentially a volume-weighted order-flow indicator, showing whether volume concentrates near highs (buying pressure) or lows (selling pressure).
How it works
Computes the Intraday Intensity (II) = ((Close − Low) − (High − Close)) / (High − Low) × Volume.
Then compares total “intensity” to total volume over a look-back window to produce a normalized percentage.
Lime line: IIP rising → accumulation / increasing buy pressure.
Red line: IIP falling → distribution / increasing sell pressure.
Background: Green tint = heavy buying, Red tint = heavy selling.
Use cases
Identify accumulation or distribution phases early.
Confirm momentum with volume-backed pressure.
Detect divergences between price and volume flow.
Defaults
Length = 14
High-pressure threshold = +5 %
Low-pressure threshold = −5 %
Example — AAPL (2H)
Late July into early August shows sustained distribution as IIP sinks below −5% (deep red), marking heavy sell pressure during the drop. From early to mid-August, IIP flips positive and holds > +5% (green background), aligning with the rebound. After a brief mid-September shakeout, late Sep–mid Oct features renewed accumulation with repeated green surges. Most recently, IIP prints around −33%, indicating dominant selling pressure into the latest two-hour bars.
Part of the Quant Toolkit — transparent, open-source indicators for modern quantitative analysis. Built by CoryP1990.
Ulcer Index (UI) by CoryP1990 – Quant ToolkitThe Ulcer Index measures downside volatility, i.e. how deep and persistent drawdowns are from recent highs. Unlike standard deviation, which treats upside and downside equally, the Ulcer Index focuses purely on pain . It’s a favorite of risk-adjusted performance metrics like the Martin Ratio.
How it works
Computes the RMS (root-mean-square) of drawdowns over a look-back window.
Rising UI → drawdowns worsening (stress increasing).
Falling UI → drawdowns shrinking (recovery phase).
Red line = Ulcer Index rising.
Lime line = Ulcer Index falling.
Red background = High-risk regime (above threshold).
Green background = Low-risk regime (below threshold).
Use cases
Gauge portfolio stress levels and timing of recovery phases.
Identify “calm vs storm” periods for position sizing.
Combine with volatility or sentiment measures for regime classification.
Defaults
Length = 14
High-risk threshold = 10
Low-risk threshold = 5
Example — NVIDIA (NVDA, 1D)
During the sharp decline through 2022, the Ulcer Index repeatedly spiked above 10 while the background turned red, highlighting an extended high-stress drawdown phase. As NVDA began recovering in early 2023, the UI line switched to lime and drifted below 5, marking a transition into a low-risk regime. Throughout 2024–2025, the index stayed mostly sub-5 with brief red pulses on minor corrections, which is clear evidence that downside volatility has remained contained during the broader uptrend.
Part of the Quant Toolkit - a series of transparent, open-source indicators designed for professional-grade analytics and education. Built by CoryP1990.
korea time with 200 korea time
start time
08
09
17
18
23
00
This script makes it easier to look at the charts
The time automatically displays even if you don't bother to bring the mouse by hand
Now you can see the time intuitively
Run a very happy trading session
Position Size & Drawdown ManagerThis tool is designed to help traders dynamically adjust their position size and drawdown expectations as their trading capital changes over time. It provides a simple and intuitive way to translate backtest results into real-world position sizing decisions.
Purpose and Functionality
The indicator uses your original backtest parameters — including base capital, base drawdown percentage, and base position size — and your current account balance to calculate how your risk profile changes. It presents two main scenarios:
Lock Drawdown %: Keeps your original drawdown percentage fixed and calculates the new position size required.
Lock Position Size: Keeps your position size unchanged and shows how your drawdown percentage will shift.
Why it’s useful
Many traders face the challenge of scaling their strategies as their account grows or shrinks. This tool makes it easy to visualize the relationship between position sizing, capital, and drawdown. It’s particularly valuable for risk management, portfolio rebalancing, and maintaining consistent exposure when transitioning from backtest conditions to live trading.
How it works
The calculations are displayed in a clean, color-coded table that updates dynamically. This allows you to instantly see how capital fluctuations impact your expected drawdown or position size. You can toggle between light and dark themes and highlight important cells for clarity.
Practical use case
Combine this tool with your TradingView strategy results to better interpret your backtests and adjust your real-world trade sizes accordingly. It bridges the gap between simulated performance and actual account management.
Chart example
The chart included focuses only on this indicator, showing the output table and visual layout clearly without additional scripts or overlays.
Simple Sector/MarketCapSimple Sector & Market Cap
A lightweight overlay that instantly shows Sector, Industry, and Market Cap classification for any ticker — right on your chart.
Features
Auto-detects sector and industry from TradingView data.
Calculates real-time market capitalization.
Categorizes stocks into Mega / Large / Mid / Small / Micro Cap groups.
Customizable colors for table background, text, and cap tiers.
Choose between vertical or horizontal layout and adjustable text size.
Purpose
Quick context without clutter — see what kind of company you’re trading and how it fits into the market hierarchy. Ideal for traders who like fast reference to fundamentals while scanning charts.
Notes
No external data sources are required. Values are derived from TradingView’s internal financial dataset.
Check-listThis Entry Checklist helps you stay objective in your trades. If you enter a position, it’s because you’ve checked off the boxes of your different confluences.
If you haven’t checked them, the checklist will immediately show you that.
Momentum Master v1Momentum Master v1 - Multi-Strategy Trading System
This script implements a trading system that integrates standard indicators (EMA, RSI, MACD, Bollinger Bands):
1. ADAPTIVE CONFIDENCE-BASED POSITION SIZING: Each signal receives a real-time confidence score (0-100%) calculated using a proprietary weighted algorithm. This confidence score dynamically adjusts stop loss distance (80%+ confidence = 1.2x stops, <60% = 0.9x stops), creating intelligent position sizing based on signal quality. This is NOT found in any standard indicator combination.
2. MULTI-LEVEL TP ANALYTICS WITH INDEPENDENT WIN RATE TRACKING: Each take profit level (TP1-TP6) maintains separate win rate statistics, enabling data-driven optimization. Traders can disable underperforming TP levels and focus on high-performers based on actual market data. This is NOT just multiple exit levels - it's a performance optimization system.
3. UNIVERSAL FILTER INTEGRATION: All filters (RSI, ADX, Volume, Divergence, Order Blocks) work identically across all 6 strategies using unified logic, creating a modular testing environment. This allows traders to test filter combinations on any strategy - a capability not found in standard scripts.
WHY THIS IS WORTH PAYING FOR (Despite Using Standard Indicators)
While this script uses standard indicators (EMA, RSI, MACD, BB), the value lies in the ORIGINAL INTEGRATION and PROPRIETARY SYSTEMS listed above. Standard indicators are used as INPUTS to these original systems, not as the core value. The proprietary confidence scoring algorithm, adaptive position sizing, and multi-level TP analytics are original innovations that cannot be found in free scripts or standard indicator combinations.
---
CORE INNOVATION: UNIFIED ARCHITECTURE
This script implements a TRUE UNIFIED SYSTEM where 6 independent trading strategies share:
- The SAME risk management system (not separate systems per strategy)
- The SAME universal filters (not strategy-specific filters)
- The SAME performance analytics (not separate tracking per strategy)
This unified architecture allows traders to:
- Switch between strategies without reconfiguring risk management
- Test filter combinations universally across all strategies
- Compare strategy performance using identical metrics
This is fundamentally different from scripts that simply display multiple indicators together. This is a unified system where components integrate to create intelligent trading decisions.
---
DETAILED METHODOLOGY (Specific Algorithms Used)
SIGNAL CONFIDENCE CALCULATION ALGORITHM
The proprietary confidence scoring system uses the following weighted algorithm:
Confidence Score = Base Strategy Signal (50 points)
+ Volume Confirmation Bonus (20 points if volume > threshold)
+ Volume Trend Bonus (10 points if volume increasing over 3 bars)
+ RSI Confirmation Bonus (10 points if RSI in neutral zone 30-70)
This creates a score from 0-100%. The score is then used to adjust stop loss distance:
IF confidence >= 80%: Stop Distance = ATR × Multiplier × 1.2
IF confidence >= 70%: Stop Distance = ATR × Multiplier × 1.1
IF confidence >= 60%: Stop Distance = ATR × Multiplier × 1.0
IF confidence < 60%: Stop Distance = ATR × Multiplier × 0.9
This adaptive system recognizes that high-confidence setups can withstand wider stops, while low-confidence setups need tighter risk control.
MULTI-LEVEL TAKE PROFIT SYSTEM WITH INDEPENDENT TRACKING
The script implements 6 progressive take profit levels (TP1-TP6) with the following risk/reward ratios:
- TP1: Entry ± (Stop Distance × 2.0) = 1:2 R/R
- TP2: Entry ± (Stop Distance × 4.0) = 1:4 R/R
- TP3: Entry ± (Stop Distance × 6.0) = 1:6 R/R
- TP4: Entry ± (Stop Distance × 8.0) = 1:8 R/R
- TP5: Entry ± (Stop Distance × 10.0) = 1:10 R/R
- TP6: Entry ± (Stop Distance × 12.0) = 1:12 R/R
ORIGINAL FEATURE: Each TP level maintains an independent array tracking wins and losses. The Performance Stats Table calculates separate win rates for:
- TP1 hits: Wins that reached TP1 / Total trades
- TP2 hits: Wins that reached TP2 (from trades that didn't stop at TP1) / Trades that reached TP2
- TP3 hits: Wins that reached TP3 (from trades that reached TP2) / Trades that reached TP3
- And so on for TP4-TP6
This allows traders to optimize which TP levels to enable based on actual market behavior. Example: If TP1 shows 65% win rate but TP2 shows 45%, disable TP2+ and focus on TP1 exits.
UNIVERSAL FILTER SYSTEM (Proprietary Integration)
All filters use identical logic across all 6 strategies:
RSI Filter Algorithm:
- Long entries: Only allowed when RSI < (Overbought Threshold - 5)
- Short entries: Only allowed when RSI > (Oversold Threshold + 5)
- This prevents entries at momentum extremes for ALL strategies
ADX Filter Algorithm:
- Checks if ADX > threshold (default 20) using Pine Script's built-in ADX calculation
- If enabled, ALL strategies (trend-following AND mean reversion) require ADX > threshold
- This ensures trades occur in trending markets, not choppy conditions
Volume Confirmation Algorithm:
- Requires volume > (Simple Moving Average of volume over 20 bars × multiplier)
- Applied identically to all strategies
- Ensures institutional participation
Divergence Filter Algorithm:
- Uses pivot detection (ta.pivotlow/pivothigh with 2-bar lookback)
- Compares price pivots to RSI/MFI pivots
- Requires minimum thresholds: RSI divergence >= 1.5, Price divergence >= 0.05
- Waits for divergence confirmation within lookback period (default 100 bars)
Order Block Filter Algorithm:
- Identifies last strong candle (body > 50% of range) before directional move
- Tracks direction: Bullish OB = strong bullish candle before upward move
- Filter: Only allows trades in direction of most recent Order Block
- This ensures alignment with institutional positioning
---
STRATEGY DETAILS (Specific Methods Used)
1. EMA CROSSOVER STRATEGY
Method: Exponential Moving Average Crossover with RSI Boundary Filtering
Algorithm:
- Fast EMA: Exponential Moving Average (close, period = 9 or custom)
- Slow EMA: Exponential Moving Average (close, period = 21 or custom)
- Entry Condition: Fast EMA crosses above Slow EMA (for longs)
- RSI Boundary Check: Entry only allowed if RSI < 70 (prevents overbought entries)
- Exit Condition: Fast EMA crosses below Slow EMA OR stop loss hit
Why This Method: Standard EMA crossovers generate false signals during choppy markets. The RSI boundary check (RSI < 70 for longs) prevents entries when momentum is already overextended, improving win rate by filtering out weak setups.
2. RSI MEAN REVERSION STRATEGY
Method: RSI Extreme Reversion with Candlestick Pattern Confirmation
Algorithm:
- RSI Calculation: Relative Strength Index (close, period = 14)
- Oversold Condition: RSI < 30 (default, configurable)
- Overbought Condition: RSI > 70 (default, configurable)
- Candlestick Filter: Requires bullish candle (close > open) for longs
- Volume Confirmation: Requires volume > (average × multiplier)
- Optional Price Level Filter: Requires price in bottom/top quartile of 10-bar range
Why This Method: Mean reversion works best when price is at true extremes AND showing reversal candles with volume. The optional filters add confluence, significantly improving win rate.
3. BREAKOUT STRATEGY
Method: Price Breakout with Volume Confirmation
Algorithm:
- Lookback Period: 20 bars (configurable)
- Breakout Condition: Close > highest high of last N bars (for longs)
- Volume Confirmation: Volume > Simple Moving Average of volume over 20 bars
- Entry: Triggers when price breaks recent high/low with volume
Why This Method: Breakouts signal momentum continuation. Volume confirmation ensures institutional participation, filtering false breakouts.
4. MACD CROSSOVER STRATEGY
Method: MACD Signal Crossover with Oversold/Overbought Entry Filter
Algorithm:
- MACD Calculation: Using Pine Script's ta.macd() with default periods (12, 26, 9)
- Entry Condition: MACD line crosses above signal line (for longs)
- Oversold Filter: Entry only when MACD < 0 (catches reversals, not late entries)
- Exit Condition: MACD crosses below signal line OR stop loss hit
Why This Method: Standard MACD crossovers can enter late in trends. Entering only when MACD is oversold (< 0) catches reversals rather than late trend entries, improving risk/reward.
5. BOLLINGER BANDS STRATEGY
Method: Bollinger Band Mean Reversion with RSI Confirmation
Algorithm:
- BB Calculation: Using Pine Script's ta.bb() with period 20, standard deviation 2.0
- Entry Condition: Price hits lower band (for longs)
- RSI Confirmation: Requires RSI < 40 (not extreme 30)
- Candlestick Filter: Requires bullish candle (close > open)
Why This Method: BB mean reversion works best with RSI confirmation. Using RSI 40/60 (not extreme 30/70) allows earlier entries while still confirming mean reversion.
6. VOLUME BREAKOUT STRATEGY
Method: Volume Surge with Price Strength Confirmation
Algorithm:
- Volume Surge: Volume > (average × 2.0 multiplier)
- Price Strength: |Close - Open| > (ATR × 0.5 multiplier)
- Direction: Bullish candle (close > open) for longs
- RSI Boundary: RSI < 70 (prevents overbought entries)
Why This Method: Institutional moves require both volume AND price movement. The ATR-based price strength filter ensures the move has momentum, not just volume noise.
---
ADVANCED MARKET ANALYSIS TOOLS (Integration Details)
FAIR VALUE GAPS (FVG)
Detection Algorithm: Identifies gaps between 3-candle sequences
- Bullish FVG: Low > High (gap between current low and high 2 bars ago)
- Bearish FVG: High < Low (gap between current high and low 2 bars ago)
- Size Filter: FVGs smaller than (ATR × 0.8 multiplier) are filtered out
- Integration: FVG boxes display on chart, but are NOT used in entry logic (display only)
ORDER BLOCKS
Detection Algorithm: Identifies last strong candle before directional move
- Strong Candle: Body > 50% of total range
- Bullish OB: Red candle followed by green candle with higher close
- Bearish OB: Green candle followed by red candle with lower close
- Integration: Order Block Filter aligns trade direction with most recent OB direction
LIQUIDITY ZONES
Detection Algorithm: Identifies swing highs/lows using pivot detection
- Buy-Side Liquidity: Swing highs (ta.pivothigh with configurable lookback)
- Sell-Side Liquidity: Swing lows (ta.pivotlow with configurable lookback)
- Integration: Display only - not used in entry logic
POINT OF CONTROL (POC) LEVELS
Calculation Methods:
1. Volume POC: Price level with highest volume in lookback period (recalculated every 5 bars)
2. Session POC: (High + Low + Close) / 3 of previous session
3. Daily POC: (High + Low + Close) / 3 of previous day
4. Weekly POC: (High + Low + Close) / 3 of previous week
- Integration: Display only - not used in entry logic
FIBONACCI EXTENSIONS
Calculation Method: 3-point swing-based extension
- Detects swing points using pivot detection (ta.pivothigh/pivotlow)
- Calculates extensions: 123.6%, 138.2%, 161.8%, 261.8%, etc.
- Golden Zone: Highlights 61.8%-78.6% retracement zone
- Integration: Display only - not used in entry logic
DIVERGENCE DETECTION
Algorithm: Pivot-based divergence detection
- RSI Divergence: Compares price pivots to RSI pivots using ta.pivotlow/pivothigh
- MFI Divergence: Same logic using Money Flow Index
- Thresholds: RSI divergence >= 1.5, Price divergence >= 0.05
- Integration: Divergence Filter waits for confirmation within lookback period
GANN FAN ANALYSIS
Algorithm: 9-angle fan with auto-adjustment
- Angles: 1x1, 1x2, 1x3, 2x1, 3x1, 4x1, 8x1, 1x4, 1x8
- Auto Timeframe Detection: Adjusts lookback (2D=120, 3D=150, 4D=160, 5D=180 bars)
- Auto Market Type Detection: Adjusts angle steepness (Crypto=15.0, Stock=10.0, etc.)
- Integration: Display only - not used in entry logic
---
PERFORMANCE ANALYTICS (Original System)
Three integrated display tables provide real-time analytics:
1. PERFORMANCE STATS TABLE
- Displays win rates for each TP level (TP1-TP6)
- Shows win count, loss count, and win rate percentage for each level
- Enables data-driven optimization of TP levels
2. SIGNAL OVERVIEW TABLE
- Real-time technical snapshot: RSI value, ATR, ADX, volume status
- Displays signal confidence score (0-100%)
- Shows volume trend direction
3. RISK MANAGEMENT TABLE
- Current trade direction (Long/Short/None)
- Consecutive losses counter
- Overall win rate
- Last 20 trade outcomes (visual W/L history)
All tables work identically regardless of which strategy is active, providing consistent analytics.
---
USAGE INSTRUCTIONS
Quick Start:
1. Select strategy from "Strategy Mode" dropdown
2. Configure risk (ATR length, SL multiplier)
3. Enable desired TP levels (TP1-TP3 recommended for beginners)
4. Add optional filters to reduce false signals
5. Configure display elements
Recommended Settings:
- Scalping (1m-5m): EMA Fast mode, RSI+ADX filters, TP1-3, SL 0.8-1.0x
- Swing (15m-4H): EMA Standard/Breakout, all filters, TP1-6, SL 1.0-1.5x
- Trend (Daily+): EMA Slow/MACD, ADX filter, TP4-6, SL 1.5-2.0x
---
TECHNICAL IMPLEMENTATION
Pine Script v6
Max Bars Back: 5000
Max Labels: 500
Data Structures:
- Arrays for trade tracking (entry, SL, TP1-6, direction, active status)
- Arrays for visual elements (lines, labels, boxes)
- State variables for signal processing
Performance Optimizations:
- Volume POC recalculated every 5 bars (not every bar)
- FVG/Order Block arrays limited to recent items
- Line extension system prevents excessive line creation
---
CONCLUSION
This script implements a unified trading system with three original innovations:
1. Adaptive confidence-based position sizing
2. Multi-level TP analytics with independent win rate tracking
3. Universal filter integration across all strategies
While standard indicators are used as inputs, the value lies in the proprietary integration and original systems that create intelligent position sizing and data-driven optimization capabilities not found in standard scripts.
---
For questions or access requests, visit the script page on TradingView.
Pristine Adaptive Alpha ScreenerThe Pristine Adaptive Alpha Screener allows users to screen for all of the trading signals embedded in our premium suite of TradingView tools🏆
▪ Pristine Value Areas & MGI
▪ Pristine Fundamental Analysis
▪ Pristine Volume Analysis
💠 Signals Overview
▪ HVY(highest volume in a year) -> Featured in Pristine Volume Analysis
▪ Trend Template -> Inspired by Mark Minervini's famous trend filters
▪ Rule of 100 -> Metrics from Pristine Fundamental Analysis
▪ Bullish 80% Rule -> Featured in Pristine Value Areas & MGI
▪ Bearish 80% Rule -> Featured in Pristine Value Areas & MGI
▪ Break Above VAH -> Featured in Pristine Value Areas & MGI
▪ Break Below VAL -> Featured in Pristine Value Areas & MGI
💠 Signals Decoded
▪ HVY(highest volume in a year)
Volume is an important metric to track when trading, because abnormally high volume tends to occur when a new trend is kicking off, or when an established trend is hitting a climax. Screen for HVY to quickly curate every stock that meets this condition
▪ Trend Template
Mark Minervini's gift to the trading world. Via his book "Think and Trade Like a Stock Market Wizard". Filter for trend template stocks using our tool.
▪ Rule of 100
Pristine Capital's gift to the trading world. The rule of 100 filters for stocks that meet the following condition: YoY EPS Growth + YoY Sales Growth >= 100%
▪ Bullish 80% Rule
If a security opens a period below the value area low , and subsequently closes above it, the bullish 80% rule triggers, turning the value area green. One can trade for a move to the top of the value area, using a close below the value area low as a potential stop!
In the below example, HOOD triggered the bullish 80% rule after it reclaimed the monthly value area!
HOOD proceeded to rally through the monthly value area and beyond in subsequent trading sessions. Finding the first stocks to trigger the bullish 80% rule after a market correction is key for spotting the next market leaders!
▪ Bearish 80% Rule
If a security opens a period above the value area high , and subsequently closes below it, the bearish 80% rule triggers, turning the value area red. One can trade for a move to the bottom of the value area, using a close above the value area high as a potential stop!
ES proceeded to follow through and test the value area low before trending below the weekly value area
▪ Break Above VAH
When a security is inside value, the auction is in balance. When it breaks above a value area, it could be entering a period of upward price discovery. One can trade these breakouts with tight risk control by setting a stop inside the value area! These breakouts can be traded on all chart timeframes depending on the style of the individual trader. Combining multiple timeframes can result in even more effective trading setups.
RBLX broke out from the monthly value area on 4/22/25👇
RBLX proceeded to rally +62.78% in 39 trading sessions following the monthly VAH breakout!
▪ Break Below VAL
When a security is inside value, the auction is in balance. When it breaks below a value area, it could be entering a period of downward price discovery. One can trade these breakdowns with tight risk control by setting a stop inside the value area! These breakouts can be traded on all chart timeframes depending on the style of the individual trader. Combining multiple timeframes can result in even more effective trading setups.
CHWY broke below the monthly value area on 7/20/23👇
CHWY proceeded to decline -53.11% in the following 64 trading sessions following the monthly VAL breakdown!
💠 Metric Columns
▪ %𝚫 - 1-day percent change in price
▪ YTD %𝚫 - Year-to-date percent change in price
▪ MTD %𝚫 - Month-to-date percent change in price
▪ MAx Moving average extension - ATR % multiple from the 50D SMA -Inspired by Jeff Sun
▪ 52WR - Measures where a security is trading in relation to it’s 52wk high and 52wk low. Readings near 100% indicate close proximity to a 52wk high and readings near 0% indicate close proximity to a 52wk low
▪ Avg $Vol - Average volume (50 candles) * Price
▪ Vol RR - Candle volume/ Avg candle volume
Kalman Adaptive Score Overlay [BackQuant]Kalman Adaptive Score Overlay
A powerful indicator that uses adaptive scoring to assess market conditions and trends, utilizing advanced filtering techniques to smooth price data, enhance trend-following precision, and predict future price movements based on past data. It is ideal for traders who need a dynamic and responsive trend analysis tool that adjusts to market fluctuations.
What is Adaptive Scoring?
Adaptive scoring is a technique that adjusts the weight or importance of certain price movements over time based on an ongoing assessment of market behavior. This indicator uses dynamic scoring to assess the strength and direction of price movements, providing insight into whether a trend is likely to continue or reverse. The score is recalculated continuously to reflect the most up-to-date market conditions, offering a responsive approach to trend-following.
How It Works
The core of this indicator is built on advanced filtering methods that smooth price data, adjusting the response to recent price changes. The filtering mechanism incorporates a Kalman filter to reduce noise and improve the accuracy of price signals. Combined with adaptive scoring, this creates a robust framework that automatically adjusts to both short-term fluctuations and long-term trends.
The indicator also uses a dynamic trend-following component that updates its analysis based on the direction of the market, with the option to visualize it through colored candles. When a strong trend is identified, the candles are painted to reflect the prevailing trend, helping traders quickly identify whether the market is in a bullish or bearish state.
Why Adaptive Scoring Is Important
Dynamic Response: Adaptive scoring allows the indicator to respond to changing market conditions. By adjusting its sensitivity to price fluctuations, it ensures that trends are captured accurately, without being overly influenced by short-term noise.
Trend Precision: By combining Kalman filtering with adaptive scoring, the indicator offers a precise and smooth trend-following mechanism. It helps traders stay aligned with the market direction and avoid false signals.
Versatility: The indicator works across multiple timeframes, making it adaptable to different trading strategies, from scalping to long-term trend-following.
Confidence in Market Moves: The adaptive scoring component provides traders with confidence in the strength of the trend, helping them determine when to enter or exit positions with greater certainty.
How Traders Use It
Trend-Following Strategy: Traders can use this indicator to confirm trends and refine their entries and exits. The colored candles and adaptive scoring offer a visual cue of trend strength and direction, making it easier to follow the prevailing market movement.
Multi-Timeframe Analysis: The script supports multi-timeframe analysis, allowing traders to analyze trends and scores across different timeframes (e.g., 1m, 5m, 15m, 30m, 1h, 4h, 12h). This is useful for traders who want to confirm trends on both short and long-term charts before making a trade.
Refining Entry Points: By utilizing the adaptive scoring, traders can identify potential entry points where the score indicates a high probability of trend continuation. Higher scores signal stronger trends, guiding decision-making.
Managing Risk: Traders can use the adaptive scoring system to assess trend stability and adjust their risk management strategies accordingly. For example, higher confidence in the trend allows for larger positions, while lower confidence may require smaller, more cautious trades.
Key Features and Benefits
Kalman Filter for Noise Reduction: The Kalman filter helps to smooth out market noise and allows for a clearer understanding of the underlying price movements. This is particularly useful in volatile markets where short-term fluctuations can cloud trend analysis.
Adaptive Scoring for Flexibility: Adaptive scoring ensures that the indicator remains responsive to changing market conditions. It automatically adjusts to the strength of price movements, enabling better detection of trends and reversals.
Visual Trend Signals: The indicator provides visual signals through candle coloring, making it easier to identify whether the market is in a bullish, neutral, or bearish phase.
Multi-Timeframe Display: The indicator’s multi-timeframe feature allows traders to see the trend and adaptive score on different timeframes simultaneously, providing a comprehensive view of the market.
Customizable Settings: Traders can customize the indicator’s settings, such as the filter parameters, scoring thresholds, and visualization options, tailoring it to their specific trading style and strategy.
Why This is Important for Traders
Improved Decision Making: The adaptive nature of the scoring system allows traders to make more informed decisions based on real-time market data, without being influenced by past volatility.
Market Clarity: By smoothing out price movements and scoring trends adaptively, the indicator provides a clearer picture of market behavior, which is essential for effective trend-following and timing entries and exits.
Increased Confidence in Signals: Adaptive scoring ensures that signals are based on the current market structure, reducing the likelihood of false positives. This boosts traders' confidence when acting on signals.
Conclusion
The Kalman Adaptive Score Overlay offers a dynamic and responsive trend-following tool that integrates Kalman filtering with adaptive scoring. By adjusting to market fluctuations in real time, it allows traders to identify and follow trends with greater precision. Whether you are trading on short or long timeframes, this tool helps you stay aligned with market momentum, ensuring that your entries and exits are based on the most up-to-date and reliable data available.
7D Historical Volatility (Regimes + Stats) - ChrrizzyHere’s what that indicator does—at a glance:
### Core idea
It computes **7-day Historical Volatility (HV)** from **daily** log returns (annualized), then shows:
* the **HV line** and its **30-day average**,
* colored **volatility regimes** (Low / Normal / High / Extreme) with thresholds you set,
* a compact **status panel** (top-right, nudged left) with current stats and time-in-zone.
### Calculations
* **HV (7D)**: `stdev(log(close/close ), 7) * sqrt(365) * 100`, always from **daily data** via `request.security`, so it’s consistent on any chart timeframe.
* **Regimes** (defaults):
Low < 25% • Normal 25–50% • High 50–70% • Extreme > 70% (all editable).
* **30-day avg**: SMA of HV.
* **Time in zone (% over window)**: SMA of boolean flags (e.g., in Low=1 else 0) over `statsWin` days (default 300).
* **Rolling median HV**: 50th percentile over `statsWin`.
### What you see on the chart
* **HV line** (bold) + **30-day HV** (lighter).
* **Horizontal dashed lines** at your regime thresholds.
* **Background shading** that changes with the current regime (green/blue/orange/red).
### Panel (top-right)
Shows:
* BTC Price (daily close)
* Current HV
* 30-day Avg HV
* Median HV (over window)
* Current **Regime**
* A two-line summary: **% of time spent** in Low / Normal / High / Extreme over the chosen window.
The panel is shifted slightly left using a hidden spacer column; tweak the **“Panel right padding (chars)”** input to move it.
### Alerts (ready to use)
* **HV crossed up Low**
* **HV crossed down Low**
* **HV crossed up High**
* **HV crossed up Extreme**
### Inputs you can tune
* `HV Lookback (days)` (default 7)
* `Average HV (days)` (default 30)
* Thresholds: Low/High/Extreme
* `Stats Window (days)` (default 300)
* Panel padding, toggle table/zones on/off.
### How to use it
* **Context**: quickly see if BTC is in **compressed** (Low) or **stressed** (High/Extreme) volatility.
* **Regime cross alerts**: get notified when volatility **expands** from Low (potential breakout conditions) or pushes into High/Extreme (risk increases).
* **Stats/median**: compare today’s HV to its typical level over your lookback window.
If you want, I can add an **HV percentile rank** (e.g., “Current HV is at the 38th percentile over 300d”) or mirror the **low-vol breakout signal** from Script A into this panel.
Trend Strength IndexTSI with alert levels
You can set the levels of trend strength to trigger an alert
There are 2 levels to set alerts, feel free to test this indicator
Session Engine — Market Opens, Killzones & Levels — SMC/ICTSession Engine — Market Opens, Killzones & Institutional Levels (Tokyo • London • New York) — SMC/ICT — TradingATH (PueblaATH)
Precision. Sessions. Structure.
Session Engine maps the institutional heartbeat of the day across Tokyo , London , and New York . It draws timezone-accurate Market Open Lines , clean Killzones (incl. London–NY overlap), and a rock-solid, timeframe-safe suite of Previous High/Low Levels (PDH/PDL/PWH/PWL/PMH/PML). On top, a compact Session Comparison Table with an integrated ADR panel shows extension, momentum context, and distance to key levels — at a glance.
Designed for SMC/ICT Traders who demand clarity and reliability, this tool stays stable when you change timeframe, reload, or zoom.
Map the day like a Pro : timezone-true Opens, configurable Killzones, TF-safe PDH/PDL/PWH/PWL/PMH/PML , and a sleek ADR panel beneath a Session Comparison Table . Built for precision SMC/ICT Execution . Zero flicker, full control.
Why Traders Love It
Timezone-Accurate Session Engine — Tokyo, London, New York opens and the London–NY overlap, all resolved to bar-time for precise plotting on any symbol.
Killzones you can trust — choose full-column height or price-bounded height with custom top/bottom tick offsets and label placement.
Bulletproof Previous Levels — PDH, PDL, PWH, PWL, PMH, PML are cached and only refresh on true D/W/M boundaries, eliminating the classic “levels disappear on TF change” problem.
Actionable Context — a compact Session Comparison Table (vs previous session & vs previous day) plus an ADR panel with extension thresholds, distance to PDH/PDL, and current H-L range.
Serious Customization — dotted/solid lines, widths, label size & alignment, auto label backgrounds, block transparency, weekend & timeframe filters, and more.
Performance-Minded — persistent objects are updated in place (not spam-created) to keep your chart crisp and responsive.
What You’ll See
Market Opens — Vertical opens for TOK/LDN/NY with dotted/solid styling, width control, infinite or bounded height, and optional labels.
Killzones + Overlap — Transparent time boxes for session windows (and London–NY overlap). Optional labels, adjustable transparency, and height mode.
Institutional Levels — PDH / PDL / PWH / PWL / PMH / PML with length modes: Infinite, N bars, or End of day. Optional labels with typographic control.
Session Comparison Table — For each session: bias vs previous session and previous day, with optional Δ% column.
ADR Panel — 24h rolling ADR% consumption with two attention thresholds, distance to PDH/PDL (price units), and current H-L range.
How It Works
Session Timing uses explicit IANA timezones (Asia/Tokyo, Europe/London, America/New_York) then anchors to bar_time for pixel-perfect placement.
Killzones are persistent boxes that reset only on daily change, preventing redundant object creation.
Previous Levels are requested once per true period roll (D/W/M) and stored locally; this cache keeps lines stable when switching TFs or reloading charts.
Level Line Length is enforced per-object (Infinite, N bars, End of day) with dynamic x2 handling — no redraw flicker.
ADR uses a timeframe-agnostic 24h rolling window for H/L/range; ADR length is defined in “days” and mapped to bars for any timeframe.
How to Use
Set Session Times (defaults are standard). Adjust the London–NY overlap if your venue differs.
Style your Opens & Killzones — line width, dotted/solid, infinite or bounded height, label font size/align/background.
Choose Level Behavior — Infinite, N bars, or End of day for PD/ PW / PM lines; toggle labels as needed.
Read the Table and ADR — quick bias vs previous session/day, Δ% if you enable it; ADR panel highlights extension with blink thresholds and shows live distance to PDH/PDL.
Inputs
Schedules — Open times + killzone windows for TOK/LDN/NY, and London–NY overlap.
Style — Line width, dotted/solid, label sizes & alignment, auto backgrounds.
Heights — Infinite or tick-bounded line height; full-column or tick-bounded killzones.
Levels — Show/hide PDH/PDL/PWH/PWL/PMH/PML; length mode; label options.
Table & ADR — Font size, arrows, Δ% column, ADR length (days), blink thresholds, show/hide rows.
Filters — Hide visuals on specified timeframe ranges; optional weekend suppression.
Best Practices
Use “End of day” for tidy level lines that still convey right-hand context.
Set ADR thresholds to your instrument’s personality (e.g., 80/120 for FX, 100/150 for crypto).
On exotic trading sessions, verify the IANA timezone alignment and tweak inputs accordingly.
If you stack many tools, consider disabling unused sessions/rows to stay within object limits.
What Makes It Original
A cohesive Session Engine architecture that unifies timezone-true Opens, configurable Killzones/Overlap, and TF-safe previous levels — tailored for SMC/ICT execution.
Robust caching that eliminates TF-switch flicker and preserves dependent calculations (distance to PDH/PDL, ADR%) without gaps.
A unified ADR panel directly under the session table with real-time extension signaling and distance-to-PDH/PDL — pragmatic, trade-ready context you won’t find in generic session scripts.
Deep length & typography controls so visuals are informative and elegant.
Notes & Disclaimer (Originality & Rights)
Original Work Notice — Please read — This script/indicator is an original work created exclusively by TradingATH ( PueblaATH ). It is not derived from, copied from, or authored by any other person or entity. Any resemblance to other scripts is coincidental and limited to the use of public and widely known trading concepts.
Usage & Publication — Redistribution, cloning, or republishing this script (in whole or in part) without the explicit written permission of TradingATH ( PueblaATH ) is prohibited. By using this tool, you acknowledge the author’s exclusive authorship and associated rights.
No Financial Advice — This tool is for educational/informational purposes only and does not constitute financial advice. Markets carry risk; manage your risk and make your own decisions.
MomentumQ Ratio MatrixMomentumQ Ratio Matrix — Intermarket Risk & Sector Relationship Dashboard
The MomentumQ Ratio Matrix is a compact, on-chart dashboard designed to help traders quickly interpret intermarket relationships and sector leadership through key ETF ratios.
It visualizes the balance between risk-on vs. risk-off sentiment , growth vs. value rotation , and defensive vs. cyclical behavior — giving you an instant read of where capital is flowing in the U.S. market.
What It Does
The indicator compares weekly and daily percentage returns for five critical sector ETF pairs. Each pair represents a specific aspect of market structure or investor preference.
When a ratio is rising , it means the first sector is outperforming the second — signaling increased risk appetite or leadership from growth sectors.
When a ratio is falling , it indicates defensiveness, capital rotation, or weakening momentum in risk-oriented areas.
Examples:
XLY/XLP ↑ → Consumers are spending more on discretionary items (risk-on).
XLY/XLP ↓ → Money shifts into staples (risk-off, defensive tone).
XLK/XLF ↑ → Technology leads Financials (growth leadership).
XLK/XLF ↓ → Financials lead, signaling preference for value or cyclicals.
XLI/XLU ↑ → Industrials outperform Utilities (economic optimism).
XLI/XLU ↓ → Utilities outperform (defensive capital rotation).
XLE/XLB ↑ → Energy leading Materials (inflation or commodity strength).
XLE/XLB ↓ → Materials outperform (cooling inflationary trends).
XLV/XLU ↑ → Healthcare stronger than Utilities (mild defensiveness, but stable risk appetite).
XLV/XLU ↓ → Utilities lead (risk aversion, defensive positioning).
Color-coded cells highlight each ratio’s short-term and medium-term performance:
Green → Ratio rising (risk-on, cyclical, or growth leadership).
Red → Ratio falling (risk-off, defensive, or value rotation).
Gray → Neutral performance.
Key Features
Essential Ratio Coverage — Tracks the five most meaningful ETF ratios for intermarket and sentiment analysis.
Multi-Timeframe Analysis — Displays both Weekly and Daily (or Previous Day) changes for each ratio.
Adaptive Table Layout — Adjustable size, position, and decimal precision to fit any chart.
Light / Dark Mode Support — Automatically adapts to match your TradingView theme.
Performance-Based Coloring — Green for strength, red for weakness, and gray for neutral.
How to Use
Add the indicator to any chart (symbol-independent).
Choose your table position and size from the settings.
Toggle between Today and PrevD mode for different time comparisons.
Use the color-coded returns to gauge where capital is flowing.
Watch for shifts across multiple ratios to confirm changing market regimes.
When most ratios are green, the market generally favors growth and higher risk assets (risk-on).
When most are red, defensive sectors and value stocks tend to lead (risk-off).
Why It’s Valuable
Condenses intermarket and macro relationships into one visual dashboard.
Helps identify leadership shifts between risk, growth, and defensive sectors.
Provides a real-time snapshot of market sentiment without switching charts.
Supports both short-term tactical and long-term trend confirmation.
Disclaimer
The MomentumQ Ratio Matrix is designed for educational and analytical purposes only.
It does not constitute financial advice or guarantee profitability.
Always conduct independent analysis and apply proper risk management when trading.
HTF Ranges - AWR/AMR/AYR [bilal]📊 Overview
Professional higher timeframe range indicator for swing and position traders. Calculate Average Weekly Range (AWR), Average Monthly Range (AMR), and Average Yearly Range (AYR) with precision projection levels.
✨ Key Features
📅 Three Timeframe Modes
AWR (Average Weekly Range): Weekly swing targets - Default 4 weeks
AMR (Average Monthly Range): Monthly position targets - Default 6 months
AYR (Average Yearly Range): Yearly extremes - Default 9 years
🎯 Dual Anchor Options
Period Open: Week/Month/Year opening price
RTH Open: First RTH session (09:30 NY) of the period
📐 Projection Levels
100% Range Levels: Upper and lower targets from anchor
Fractional Levels: 33% and 66% zones for partial targets
Custom Mirrored Levels: Set any percentage (0-200%) with automatic mirroring
Example: 25% shows both 25% and 75%
Example: 150% shows both 150% and -50%
📊 Information Table
Active range type (AWR/AMR/AYR)
Average range value for selected period
Current period range and percentage used
Distance remaining to targets (up/down)
Color-coded progress (green/orange/red)
🎨 Fully Customizable
Orange theme by default (differentiates from daily indicators)
Line colors, styles (solid/dashed/dotted), and widths
Toggle labels on/off
Adjustable lookback periods for each timeframe
Independent settings for each range type
⚡ Smart Features
Lines start at actual period open (not fixed lookback)
Automatically tracks current period high/low
Works on any chart timeframe
Real-time range tracking
Alert conditions when targets reached or exceeded
🎯 Use Cases
AWR (Weekly Ranges):
Swing trade targets (3-7 day holds)
Weekly support/resistance zones
Identify weekly trend vs rotation
Compare daily moves to weekly context
AMR (Monthly Ranges):
Position trade targets (2-4 week holds)
Monthly breakout levels
Institutional-level zones
Earnings play targets
AYR (Yearly Ranges):
Major reversal zones
Long-term support/resistance
Identify macro trend strength
Annual high/low projections
💡 Trading Strategies
AWR Strategy (Swing Trading):
Week opens near AWR lower level = potential long setup
Target AWR 66% and 100% levels
Week hits AWR upper in first 2 days = watch for reversal
Use fractional levels as scale-in/scale-out points
AMR Strategy (Position Trading):
Month opens near AMR extremes = fade setup
Month breaks AMR in week 1 = expansion (trend) month
Target opposite AMR extreme for swing positions
Use 33%/66% for partial profit taking
AYR Strategy (Long-term Context):
Price near AYR extremes = major reversal zones
Breaking AYR levels = historic moves (rare)
Use for macro trend confirmation
Great for yearly forecasting and planning
📊 Range Interpretation
<33% Range Used: Early in period, room for expansion
33-66% Range Used: Normal progression
66-100% Range Used: Extended, approaching extremes
>100% Range Used: Expansion period - trending or high volatility
⚙️ Settings Guide
Lookback Periods:
AWR: 4 weeks (standard) - adjust to 8-12 for smoother average
AMR: 6 months (standard) - seasonal patterns
AYR: 9 years (standard) - captures full cycles
Anchor Type:
Period Open: Use for clean week/month/year open reference
RTH Open: Use if you only trade day session, ignores overnight gaps
Custom Levels:
25% = quartile targets
75% = three-quarter targets
80% = "danger zone" for reversals
111% = extended breakout target
🔄 Combine with ADR Indicator
Run both indicators together for complete multi-timeframe analysis:
ADR for intraday precision
AWR/AMR/AYR for swing/position context
See if today's ADR move is significant in weekly/monthly context
Multi-timeframe confluence = highest probability setups
💼 Ideal For
Swing Traders: Use AWR for 3-10 day holds
Position Traders: Use AMR for 2-8 week holds
Long-term Investors: Use AYR for macro context
Index Futures Traders: ES, NQ, YM, RTY
Multi-timeframe Analysis: Combine with daily ADR
CEO Synapse v1.0CEO Synapse — Uyarlanabilir Rejim Stratejisi
This script is invite-only.
What Does This Strategy Do?
Markets are complex systems requiring various expertise. The "CEO Synapse" strategy adopts a "digital dashboard" approach based on the reality that a single viewpoint is insufficient. The strategy combines multiple analytical engines, each developed by me, analyzing different aspects of the market (structure, momentum, rhythm). It detects trend and momentum deviations in markets. A trading decision is made only when there is consensus among these expert engines. The "Synapse Engine" uses adaptive filtering and consensus logic for position management based on market regime (trend/range).
It eliminates the problem of traditional indicators generating misleading signals alone and failing to adapt to volatility and regime changes. Its dynamic threshold mechanism, adaptive periods, and special noise filters reduce unnecessary trades.
Original Methodology and Proprietary Logic: This algorithm does not rely on or copy any open source strategy code. The system uses commonly accepted indicators' mathematical principles such as ADX, EMA, SMA, ATR, True Range, etc., as data sources. The author's methodology combines dynamic period EMA, multi-filter consensus, adaptive threshold, and regime-based execution.
Though our strategy creates an original decision-making mechanism, it leverages foundational building blocks of technical analysis. The traditional indicators we use and their purposes are:
ADX (Average Directional Index): This indicator measures a trend’s strength, not its direction. Our strategy uses ADX as a filter to open positions only under sufficiently strong and distinct trend market conditions. This largely prevents misleading signals in weak or sideways markets.
Moving Averages (EMA and SMA): They form the backbone to determine the main trend direction. By smoothing price data, they reduce noise and reveal the market's general trend. But our strategy processes their outputs not as traditional crossover signals, but as input to an advanced consensus logic with dynamically adjusted periods based on market rhythm combined with other filters.
ATR (Average True Range): This indicator does not produce direct buy-sell signals but measures current market volatility. Especially in "Sideways Market" regime, take profit and stop loss levels are dynamically set based on ATR instead of fixed values, enabling risk management to adapt to market conditions.
Bollinger Band Logic (using Standard Deviation): Though the strategy does not plot Bollinger Bands directly, it uses Standard Deviation, the underlying mathematical concept, to detect excessive price deviations and volatility spikes, producing critical signals for the AMF PG core engine.
"Synapse Engine" consists of two layers: Decision Center (Dynamic Threshold) which automatically adjusts risk appetite based on performance and regime; and Filter Committee (Consensus Score) which weights separate filters to produce a single score. This combination is not reproducible and commercially valuable. Closed source is mandatory.
No classic open source code used. Only publicly available indicators are used. Parameters, order, and usage are fully customized.
Generated Signals: Trend/range entry/exit (long/short), adaptive trailing stop position management, additional risk control signals with Shock Absorber and Quantum Filter.
Purpose: Detect trend breaks and momentum deviations. Components: Volatility filters, adaptive signal weighting, EMA/SMA. Methodology: Combines price and volume change rates via dynamic weighting functions.
What Problem Does CEO Synapse Solve?
CEO Synapse addresses three main issues caused by traditional technical analysis and single indicator usage:
Problem: Misleading Signals and Market Noise
Traditional indicators (MACD, RSI, etc.) generate many "false" buy-sell signals, especially in sideways and choppy markets, causing traders to constantly enter and exit positions (whipsaw) and incur losses.
CEO Synapse Solution: The strategy never relies on a single signal. The Consensus-Based Decision Mechanism ensures no position is opened unless different analytical engines (structural, momentum, rhythm) agree. This "board of directors" approach filters market noise, processing only high-probability signals.
Problem: Static Analysis and Changing Market Conditions
Markets constantly change character; sometimes strong trend, sometimes narrow range. Most strategies try to function with fixed parameters across all conditions, leading to failure.
CEO Synapse Solution: The strategy has Adaptive Regime Switching. It actively analyzes whether the market is in "Trend Mode" or "Sideways Market Mode" and automatically adjusts entry/exit rules and risk management (take profit/stop loss) to the current regime, allowing chameleon-like adaptation to conditions.
Problem: Fixed Parameters and Declining Performance
Many traders believe they find the "best" settings and never change them for months or years. But as market volatility and cycles change, fixed settings lose effectiveness.
CEO Synapse Solution: The strategy operates on Full Adaptation principle.
Market Rhythm Adaptation: Dynamically adjusts analysis speed (e.g., EMA periods) according to market’s natural cycles.
Performance Adaptation: Continuously optimizes risk appetite (signal threshold) based on recent strategy performance, becoming bolder with gains and more cautious with losses.
In summary, CEO Synapse simplifies decision-making, eliminates market noise, and smartly adapts to changing market conditions, protecting the user from common mistakes.
Why "Invite-Only"?
Offering CEO Synapse as "Invite-Only" is a strategic decision to protect the strategy's commercial value and intellectual property and to provide users with the highest quality experience. Key reasons:
Protection of Proprietary IP:
CEO Synapse is the result of hundreds of hours of research, development, and testing. Its consensus logic, adaptive threshold mechanism, and engine integration are unique and patented. Open sourcing it would instantly destroy this trade secret and competitive edge.
Maintaining Performance Integrity and Effectiveness:
Uncontrolled distribution could lead to misuse or signal theft and sale by malicious actors. The invite-only model preserves the strategy’s integrity and ensures access only for serious investors.
Quality User Experience and Support:
Controlled distribution allows better user experience. High-quality documentation explaining features and best practices can be provided, and future updates and support services can be managed better for a limited user base.
Business Model:
CEO Synapse is positioned as a premium analysis tool. Invite-only access reflects its value and compensates the developer for ongoing maintenance, support, and future improvements.
Usage: Available on all timeframes.
Based entirely on my own adaptive filtering methodology.
Proprietary logic: The algorithm’s unique, non-reproducible logic and methodology. Example: Multi-filter consensus + adaptive threshold + regime-based execution.
Why Is This a Premium Tool?
"CEO Synapse"’s value stems from being a proprietary, integrated system beyond free standard indicators:
Advanced Noise Filtering: Not just reduces noise but adjusts filter sensitivity to current market character. Inspired by public mathematical concepts (cycle analysis, statistical filtering) but uniquely combined with proprietary weighting mechanisms and adaptive consensus logic forming the strategy's commercial value. Core indicators (EMA, ATR, ADX, DMI, etc.) are uniquely processed inside this proprietary system.
Full Adaptation: Instead of fixed parameters, the strategy continuously adapts to the market's natural rhythm, volatility, and past performance.
Consensus-Based Decision Making: Relies on collective intelligence of multiple analytical engines, not a single failure point.
These features substantially increase the ability to extract meaningful, actionable insights from raw market data, making it premium. It improves signal accuracy, reduces risk, and adapts to regime shifts. The dynamic threshold mechanism continuously adjusts risk appetite based on recent performance (profitability) and market regime.
By using this script, you agree not to redistribute, sell, or reverse engineer the source code.
This strategy is for educational purposes only. Past performance does not guarantee future results. Always apply proper risk management and protect your capital.
Risk Management: Maximum Drawdown Protection
The strategy includes a built-in capital protection mechanism. Users can specify the percentage drop from peak capital they tolerate. If the capital hits this drawdown limit, protection activates, closing all open positions and blocking new trades, acting as an emergency brake to guard capital against unexpected market conditions.
Automation Ready: Customizable Webhook Alerts
Fully Compatible Automation (JSON): The strategy outputs fully configurable JSON-formatted alert messages for buy, sell, and close actions. This allows connecting CEO Synapse signals to automation platforms like 3Commas and PineConnector for fully automated trading. Dynamic values like position size ({{strategy.order.contracts}}) are automatically included in alerts.
Strategy Backtest Information
Please remember past performance is not indicative of future results. The published chart and report are based on the BTCUSD pair in a 3-hour timeframe with the following settings:
Test Period: January 1, 2018 – November 3, 2025
Default Position Size: 15% of capital
Pyramiding: Off
Commission: 0.0008
Slippage: 2 ticks
Test Approach: The published test contains 201 trades and is statistically significant. Performing your own tests on different assets and timeframes is strongly recommended. Default settings are a template and should be adjusted per your analysis.
Advanced ICT ADR Projections [bilal]📊 Overview
Professional ADR indicator designed specifically for index futures traders. Calculate and visualize Average Daily Range with multiple session options, fractional levels, and higher timeframe context.
✨ Key Features
🎯 Multiple Session Types
Full Day: Standard calendar day calculation
Midnight: Anchored to 00:00 NY time open
RTH (Regular Trading Hours): 09:30-16:00 NY session
Custom: Define your own session hours and anchor point
📐 Projection Levels
100% ADR Levels: Upper and lower range targets from anchor
Fractional Levels: 33% and 66% zones for partial targets
Custom Mirrored Levels: Set any percentage (0-200%) with automatic mirroring
Example: 25% shows both 25% and 75%
Example: 111% shows both 111% and -11%
📅 Higher Timeframe Context (Optional)
AWR: Average Weekly Range overlay
AMR: Average Monthly Range overlay
AYR: Average Yearly Range overlay
All HTF ranges use same anchor as daily session
📊 Information Table
Current session type and anchor time
ADR value for selected period
Current range and percentage used
Distance remaining to ADR targets (up/down)
Color-coded range percentage (green/orange/red)
🎨 Fully Customizable
Line colors, styles (solid/dashed/dotted), and widths
Toggle labels on/off
Adjustable ADR lookback period (1-100 days)
All HTF periods customizable
⚡ Smart Features
Lines start at actual session open (not fixed lookback)
Works on any timeframe
Real-time range tracking
Alert conditions when ADR reached or exceeded
🎯 Use Cases
For Day Traders:
Set profit targets at ADR extremes
Identify range expansion vs rotation days
Know when you've used 75%+ of daily range (possible reversal)
Compare RTH vs full day ranges
For Swing Traders:
Use AWR/AMR for weekly/monthly targets
Understand if today's move is significant in weekly context
Multi-timeframe confluence
Risk Management:
Size positions based on % of ADR remaining
Avoid trading when ADR exhausted (>100%)
Better stop placement using fractional levels
💡 Trading Tips
<50% ADR used = Room to run (continuation trades)
50-75% ADR used = Getting extended (scale out)
75-100% ADR used = Near extremes (reversal setups)
>100% ADR = Expansion day (trend day or volatility spike)
Use fractional levels (33%, 66%) as:
Partial profit targets
Re-entry zones on pullbacks
Confluence with other support/resistance
Compare RTH vs Full Day ADR to see if overnight or day session drives volatility.
⚙️ Settings Guide
ADR Period: 5 days is standard, adjust for different market regimes
Session Types:
Use Midnight for crypto or 24hr markets
Use RTH for pure day session analysis
Use Custom for specific session times (London, Asia, etc.)
Custom Levels:
Set 25% for quartile levels
Set 111% for extended targets beyond ADR
Experiment with 50%, 75%, 80% for your strategy
Perfect for ES, NQ, YM, RTY futures traders who need precise intraday range analysis with higher timeframe context!
ChainAggLib - library for aggregation of main chain tickersLibrary "ChainAggLib"
ChainAggLib — token -> main protocol coin (chain) and top-5 exchange tickers for volume aggregation.
Library only (no plots). All helpers are pure functions and do not modify globals.
norm_sym(s)
Parameters:
s (string)
get_base_from_symbol(full_symbol)
Parameters:
full_symbol (string)
get_chain_for_token(token_symbol)
Parameters:
token_symbol (string)
get_top5_exchange_tickers_for_chain(chain_code)
Parameters:
chain_code (string)
get_top5_exchange_tickers_for_token(token_symbol)
Parameters:
token_symbol (string)
join_tickers(arr)
Parameters:
arr (array)
contains_symbol(arr, symbol)
Parameters:
arr (array)
symbol (string)
contains_current(arr)
Parameters:
arr (array)
get_arr_for_current_token()
get_chain_for_current()
Slick Strategy Weekly PCS TesterInspired by the book “The Slick Strategy: A Unique Profitable Options Trading Method.” This indicator tests weekly SPX put-credit spreads set below Monday’s open and judged at Friday’s close.
WHAT IT DOES
• Sets weekly PCS level = Monday (or first trading day) OPEN − your offset; win/loss checked at Friday close.
• Optional core filter at entry: Price ≥ 200-SMA AND 10-SMA ≥ 20-SMA; pause if Price < both 10 & 20 while > 200.
• Reference modes: Strict = Mon OPEN vs Fri SMAs (no repaint); Mid = Mon OPEN vs Mon SMAs
KEY INPUTS
• Date range (Start/End) to limit backtest window.
• Offset mode/value (Points or Percent).
• Entry day (Monday only or first trading day).
• Core filters (On/Off) and Strict/Mid reference.
• SMA settings (source; 10/20/200 lengths).
• Table settings (position, size, padding, border).
VISUALS
• Active week line: Orange = trade taken; Gray = skipped.
• History: Green = win; Red = loss; Purple = skipped.
• Optional week bands highlight active/win/loss/skipped weeks (adjustable opacity).
TABLE
• Shows Date range, Trades, Wins, Losses, Win rate, and Active level (this week’s PCS price).
NOTES
• PCS level freezes at week open and persists through the week.






















