Chart patterns
HH/HL/LH/LLThe script works by detecting swing highs and swing lows with a simple pivot function (ta.pivothigh / ta.pivotlow) using a fixed 2-bar lookback and confirmation window. Each new pivot is compared against the previous confirmed pivot of the same type:
If a swing high is greater than the last swing high → it is labelled HH.
If a swing high is lower than the last swing high → it is labelled LH.
If a swing low is greater than the last swing low → it is labelled HL.
If a swing low is lower than the last swing low → it is labelled LL.
To keep the chart clean and readable, the indicator:
Plots only the two-letter labels (HH, HL, LH, LL) with no background box.
Uses red text for highs and green text for lows.
Places labels directly at the pivot bar (with the necessary confirmation offset).
Keeps labels small (size.tiny) to avoid clutter.
felci The first row shows HIGH values of NIFTY.
The second row shows LOW values of NIFTY.
Some values are negative (like -2058, -300, -486)—these could indicate changes or differences rather than absolute index values.
The table seems color-coded in the image: green, orange, and light colors—probably to highlight ranges or thresholds.
Positional Toolbox v6 (distinct colors)what the lines mean (colors)
EMA20 (green) = fast trend
EMA50 (orange) = intermediate trend
EMA200 (purple, thicker) = primary trend
when the chart is “bullish” vs “bearish”
Bullish bias (look for buys):
EMA20 > EMA50 > EMA200 and EMA200 sloping up.
Bearish bias (avoid longs / consider exits):
EMA20 < EMA50 < EMA200 or price closing under EMA50/EMA200.
the two buy signals the script gives you
Pullback Long (triangle up)
Prints when price dips to EMA20 (green) and closes back above it while trend is bullish and ADX is decent.
Entry: buy on the same close or on a break of that candle’s high next day.
Stop: below the pullback swing-low (or below EMA50 for simplicity).
Best for: adding on an existing uptrend after a shallow dip.
Breakout 55D (“BO55” label)
Prints when price closes above prior 55-day high with volume surge in a bullish trend.
Entry: on the close that triggers, or next day above the breakout candle’s high.
Stop: below the breakout candle’s low (conservative: below base low).
Best for: fresh trend legs from bases.
simple “sell / exit” rules
Trend exit (clean & mechanical): exit if daily close < EMA50 (orange).
More conservative: only exit if close < EMA200 (purple).
Momentum fade / weak breakout: if BO55 triggers but price re-closes back inside the base within 1–3 sessions on above-avg volume → exit or cut size.
Profit taking: book some at +1.5R to +2R, trail the rest (e.g., below prior swing lows or EMA20).
quick visual checklist (what to look for)
Are the EMAs stacked up (green over orange over purple)? → ok to buy setups.
Did a triangle print near EMA20? → pullback long candidate.
Did a BO55 label print with strong volume? → breakout candidate.
Any close under EMA50 after you’re in? → reduce/exit.
timeframe
Use Daily for positional signals.
If you want a tighter entry, drop to 30m/1h only to time the trigger—but keep decisions anchored to the daily trend.
alerts to set (so you don’t miss signals)
Add alert on Breakout 55D and Pullback Long (from the indicator’s alertconditions).
Optional price alerts at the breakout level or EMA20 touch.
risk guardrails (MTF friendly)
Risk ≤1% of capital per trade.
Avoid fresh entries within ~5 trading days of earnings unless you accept gap risk.
Prefer high-liquidity NSE F&O names (your CSV watchlist covers this).
TL;DR (super short):
Green > Orange > Purple = uptrend.
Triangle near green = buy the pullback; stop under swing low/EMA50.
BO55 label = buy the breakout; stop under breakout candle/base.
Exit on close below EMA50 (or below EMA200 if you’re giving more room).
Opening Range IndicatorComplete Trading Guide: Opening Range Breakout Strategy
What Are Opening Ranges?
Opening ranges capture the high and low prices during the first few minutes of market open. These levels often act as key support and resistance throughout the trading day because:
Heavy volume occurs at market open as overnight orders execute
Institutional activity is concentrated during opening minutes
Price discovery happens as market participants react to overnight news
Psychological levels are established that traders watch all day
Understanding the Three Timeframes
OR5 (5-Minute Range: 9:30-9:35 AM)
Most sensitive - captures immediate market reaction
Quick signals but higher false breakout rate
Best for scalping and momentum trading
Use for early entry when conviction is high
OR15 (15-Minute Range: 9:30-9:45 AM)
Balanced approach - most popular among day traders
Moderate sensitivity with better reliability
Good for swing trades lasting several hours
Primary timeframe for most strategies
OR30 (30-Minute Range: 9:30-10:00 AM)
Most reliable but slower signals
Lower false breakout rate
Best for position trades and trend following
Use when looking for major moves
Core Trading Strategies
Strategy 1: Basic Breakout
Setup:
Wait for price to break above OR15 high or below OR15 low
Enter on the breakout candle close
Stop loss: Opposite side of the range
Target: 2-3x the range size
Example:
OR15 range: $100.00 - $102.00 (Range = $2.00)
Long entry: Break above $102.00
Stop loss: $99.50 (below OR15 low)
Target: $104.00+ (2x range size)
Strategy 2: Multiple Confirmation
Setup:
Wait for OR5 break first (early signal)
Confirm with OR15 break in same direction
Enter on OR15 confirmation
Stop: Below OR30 if available, or OR15 opposite level
Why it works:
Multiple timeframe confirmation reduces false signals and increases probability of sustained moves.
Strategy 3: Failed Breakout Reversal
Setup:
Price breaks OR15 level but fails to hold
Wait for re-entry into the range
Enter reversal trade toward opposite OR level
Stop: Recent breakout high/low
Target: Opposite side of range + extension
Key insight: Failed breakouts often lead to strong moves in the opposite direction.
Advanced Techniques
Range Quality Assessment
High-Quality Ranges (Trade these):
Range size: 0.5% - 2% of stock price
Clean boundaries (not choppy)
Volume spike during range formation
Clear rejection at range levels
Low-Quality Ranges (Avoid these):
Very narrow ranges (<0.3% of stock price)
Extremely wide ranges (>3% of stock price)
Choppy, overlapping candles
Low volume during formation
Volume Confirmation
For Breakouts:
Look for volume spike (2x+ average) on breakout
Declining volume often signals false breakout
Rising volume during range formation shows interest
Market Context Filters
Best Conditions:
Trending market days (SPY/QQQ with clear direction)
Earnings reactions or news-driven moves
High-volume stocks with good liquidity
Volatility above average (VIX considerations)
Avoid Trading When:
Extremely low volume days
Major economic announcements pending
Holidays or half-days
Choppy, sideways market conditions
Risk Management Rules
Position Sizing
Conservative: Risk 0.5% of account per trade
Moderate: Risk 1% of account per trade
Aggressive: Risk 2% maximum per trade
Stop Loss Placement
Inside the range: Quick exit but higher stop-out rate
Outside opposite level: More room but larger risk
ATR-based: 1.5-2x Average True Range below entry
Profit Taking
Target 1: 1x range size (take 50% off)
Target 2: 2x range size (take 25% off)
Runner: Trail remaining 25% with moving stops
Specific Entry Techniques
Breakout Entry Methods
Method 1: Immediate Entry
Enter as soon as price closes above/below range
Fastest entry but highest false signal rate
Best for strong momentum situations
Method 2: Pullback Entry
Wait for breakout, then pullback to range level
Enter when price bounces off former resistance/support
Better risk/reward but may miss some moves
Method 3: Volume Confirmation
Wait for breakout + volume spike
Enter after volume confirmation candle
Reduces false signals significantly
Multiple Timeframe Entries
Aggressive: OR5 break → immediate entry
Conservative: OR5 + OR15 + OR30 all align → enter
Balanced: OR15 break with OR30 support → enter
Common Mistakes to Avoid
1. Trading Poor-Quality Ranges
❌ Don't trade ranges that are too narrow or too wide
✅ Focus on clean, well-defined ranges with good volume
2. Ignoring Volume
❌ Don't chase breakouts without volume confirmation
✅ Always check for volume spike on breakouts
3. Over-Trading
❌ Don't force trades when ranges are unclear
✅ Wait for high-probability setups only
4. Poor Risk Management
❌ Don't risk more than planned or use tight stops in volatile conditions
✅ Stick to predetermined risk levels
5. Fighting the Trend
❌ Don't fade breakouts in strongly trending markets
✅ Align trades with overall market direction
Daily Trading Routine
Pre-Market (8:00-9:30 AM)
Check overnight news and earnings
Review major indices (SPY, QQQ, IWM)
Identify potential opening range candidates
Set alerts for range breakouts
Market Open (9:30-10:00 AM)
Watch opening range formation
Note volume and price action quality
Mark key levels on charts
Prepare for breakout signals
Trading Session (10:00 AM - 4:00 PM)
Execute breakout strategies
Manage existing positions
Trail stops as profits develop
Look for additional setups
Post-Market Review
Analyze winning and losing trades
Review range quality vs. outcomes
Identify improvement areas
Prepare for next session
Best Stocks/ETFs for Opening Range Trading
Large Cap Stocks (Best for beginners):
AAPL, MSFT, GOOGL, AMZN, TSLA
High liquidity, predictable behavior
Good range formation most days
ETFs (Consistent patterns):
SPY, QQQ, IWM, XLF, XLE
Excellent liquidity
Clear range boundaries
Mid-Cap Growth (Advanced traders):
Stocks with good volume (1M+ shares daily)
Recent news catalysts
Clean technical patterns
Performance Optimization
Track These Metrics:
Win rate by range type (OR5 vs OR15 vs OR30)
Average R/R (risk vs reward ratio)
Best performing market conditions
Time of day performance
Continuous Improvement:
Keep detailed trade journal
Review failed breakouts for patterns
Adjust position sizing based on win rate
Refine entry timing based on backtesting
Final Tips for Success
Start small - Paper trade or use tiny positions initially
Focus on quality - Better to miss trades than take bad ones
Stay disciplined - Stick to your rules even during losing streaks
Adapt to conditions - What works in trending markets may fail in choppy conditions
Keep learning - Markets evolve, so should your approach
The opening range strategy is powerful because it captures natural market behavior, but like all strategies, it requires practice, discipline, and proper risk management to be profitable long-term.
CNagda Anchor2EntryCNagda Anchor2Entry Pine Script v6 overlay indicator pulls higher-timeframe (HTF) signal events to define anchor high/low levels and then projects visual entry labels on the lower-timeframe (LTF). It also draws auto-oriented Fibonacci retracement/extension levels for context, but it does not execute orders, stops, or targets—only visual guidance.
Inputs
Key inputs include Lookback Length for HTF scanning and a Signal Timeframe used with request.security to import HTF events onto the active chart.
Entry behavior can be set to “Confirm only” or “Wait candle,” trade side can be restricted to Buy/Sell/Both, and individual strategies (Buy WAIT/S1; Sell REV/S1/S2/S3) can be toggled.
HTF logic
The script defines WAIT/BUY setup and confirmation, SELL reversal on breaking the WAIT BUY low, and several volume/candle-based patterns (Sell S1/S2/S3, Buy S1).
It captures the associated highs/lows at those events with ta.valuewhen and imports them via request.security to form anchors (anc_hi/anc_lo) and “new trigger” booleans that gate label creation on the LTF.
Flip entries
When enabled, “Flip entries” generate contrarian labels based on breaking or confirming HTF anchors: crossing above anc_hi can trigger a flip-to-sell label, and crossing below anc_lo can trigger a flip-to-buy label.
The flip mode supports Immediate (on cross) or Confirm (on sustained break) to control how strict the trigger is.
Fibonacci drawing
User-specified Fib levels are parsed from a string, safely converted to floats, and drawn as dotted horizontal lines only when they fall inside an approximate visible viewport. Orientation (up or down) is decided automatically from pending signal direction and a simple context score (candle bias, trend, and price vs. mid), with efficient redraw/clear guards to avoid clutter.
Dynamic anchors
If HTF anchors are missing or too far from current price (checked with an ATR-based threshold), the script falls back to local swing highs/lows to keep the reference range relevant. This dynamic switch helps Fib levels and labels remain close to current market structure without manual intervention.
Signal labels
Labels are created only on confirmed bars to avoid repainting noise, with one “latest” label kept by deleting the previous one. The script places BUY/SELL labels for WAIT/CONFIRM, direct HTF patterns (Buy S1, Sell S1/S2/S3), and contrarian flip events, offset slightly from highs/lows with clear coloring and configurable sizes.
Visual context
Bars are softly colored (lime tint for bullish, orange tint for bearish) for quick context, and everything renders as an overlay on the price chart. Fib labels include a Δ readout (distance from current close), and line extension length, label sizes, and viewport padding are adjustable.
How to use
Set the Signal Timeframe and Lookback Length to establish which HTF structures and ranges will drive the anchors and entry conditions. Choose entry flow (Wait vs Confirm), enable Flip if contrarian triggers are desired, select the trade side, toggle strategies, and customize Fibonacci levels plus dynamic-anchor fallback for practical on-chart guidance.
Notes
This is a visual decision-support tool; it does not place trades, stops, or targets and should be validated on charts before live use. It is written for Pine Script v6 and relies heavily on request.security for HTF-to-LTF transfer of signals and anchors.
Initial Balance Breakout Signals [LuxAlgo]The Initial Balance Breakout Signals help traders identify breakouts of the Initial Balance (IB) range.
The indicator includes automatic detection of IB or can use custom sessions, highlights top and bottom IB extensions, custom Fibonacci levels, and goes further with an IB forecast with two different modes.
🔶 USAGE
The initial balance is the price range made within the first hour of the trading session. It is an intraday concept based on the idea that high volume and volatility enter the market through institutional trading at the start of the session, setting the tone for the rest of the day.
The initial balance is useful for gauging market sentiment, or, in other words, the relationship between buyers and sellers.
Bullish sentiment: Price trades above the IB range.
Mixed sentiment: Price trades within the IB range.
Bearish sentiment: Price trades below the IB range.
The initial balance high and low are important levels that many traders use to gauge sentiment. There are two main ideas behind trading around the IB range.
IB Extreme Breakout: When the price breaks and holds the IB high or low, there is a high probability that the price will continue in that direction.
IB Extreme Rejection: When the price tries to break those levels but fails, there is a high probability that it will reach the opposite IB extreme.
This indicator is a complete Initial Balance toolset with custom sessions, breakout signals, IB extensions, Fibonacci retracements, and an IB forecast. All of these features will be explained in the following sections.
🔹 Custom Sessions and Signals
By default, sessions for Initial Balance and breakout signals are in Auto mode. This means that Initial Balance takes the first hour of the trading session and shows breakout signals for the rest of the session.
With this option, traders can use the tool for open range trading, making it highly versatile. The concept behind open range (OR) is the same as that of initial balance (IB), but in OR, the range is determined by the first minute, three or five minutes, or up to the first 30 minutes of the trading session.
As shown in the image above, the top chart uses the Auto feature for the IB and Breakouts sessions. The bottom chart has the Auto feature disabled to use custom sessions for both parameters. In this case, the first three minutes of the trading session are used, turning the tool into an Open Range trading indicator.
This chart shows another example of using custom sessions to display overnight NASDAQ futures sessions.
The left chart shows a custom session from the Tokyo open to the London open, and the right chart shows a custom session from the London open to the New York open.
The chart shows both the Asian and European sessions, their top and bottom extremes, and the breakout signals from those extremes.
🔹 Initial Balance Extensions
Traders can easily extend both extremes of the Initial Balance to display their preferred targets for breakouts. Enable or disable any of them and set the IB percentage to use for the extension.
As the chart shows, the percentage selected on the settings panel directly affects the displayed levels.
Setting 25 means the tool will use a quarter of the detected initial balance range for extensions beyond the IB extremes. Setting 100 means the full IB range will be used.
Traders can use these extensions as targets for breakout signals.
🔹 Fibonacci Levels
Traders can display default or custom Fibonacci levels on the IB range to trade retracements and assess the strength of market movements. Each level can be enabled or disabled and customized by level, color, and line style.
As we can see on the chart, after the IB was completed, prices were unable to fall below the 0.236 Fibonacci level. This indicates significant bullish pressure, so it is expected that prices will rise.
Traders can use these levels as guidelines to assess the strength of the side trying to penetrate the IB. In this case, the sellers were unable to move the market beyond the first level.
🔹 Initial Balance Forecast
The tool features two different forecasting methods for the current IB. By default, it takes the average of the last ten values and applies a multiplier of one.
IB Against Previous Open: averages the difference between IB extremes and the open of the previous session.
Filter by current day of the week: averages the difference between IB extremes and the open of the current session for the same day of the week.
This feature allows traders to see the difference between the current IB and the average of the last IBs. It makes it very easy to interpret: if the current IB is higher than the average, buyers are in control; if it is lower than the average, sellers are in control.
For example, on the left side of the chart, we can see that the last day was very bullish because the IB was completely above the forecasted value. This is the IB mean of the last ten trading days.
On the right, we can see that on Monday, September 15, the IB traded slightly higher but within the forecasted value of the IB mean of the last ten Mondays. In this case, it is within expectations.
🔶 SETTINGS
Display Last X IBs: Select how many IBs to display.
Initial Balance: Choose a custom session or enable the Auto feature.
Breakouts: Enable or disable breakouts. Choose custom session or enable the Auto feature.
🔹 Extensions
Top Extension: Enable or disable the top extension and choose the percentage of IB to use.
Bottom extension: Enable or disable the bottom extension and choose the percentage of IB to use.
🔹 Fibonacci Levels
Display Fibonacci: Enable or disable Fibonacci levels.
Reverse: Reverse Fibonacci levels.
Levels, Colors & Style
Display Labels: Enable or disable labels and choose text size.
🔹 Forecast
Display Forecast: Select the forecast method.
- IB Against Previous Open: Calculates the average difference between the IB high and low and the previous day's IB open price.
- Filter by Current Day of Week: Calculates the average difference between the IB high and low and the IB open price for the same day of the week.
Forecast Memory: The number of data points used to calculate the average.
Forecast Multiplier: This multiplier will be applied to the average. Bigger numbers will result in wider predicted ranges.
Forecast Colors: Choose from a variety of colors.
Forecast Style: Choose a line style.
🔹 Style
Initial Balance Colors
Extension Transparency: Choose the extension's transparency. 0 is solid, and 100 is fully transparent.
Predictive Financial Indicator# TradingView Script Description - APFI v7 Enhanced
## 📊 **Advanced Predictive Financial Indicator v7 Enhanced**
### **Overview**
This indicator combines multiple advanced technical analysis concepts to predict potential price movements and identify high-probability turning points. It uses a proprietary multi-factor scoring system that analyzes market behavior patterns, trend dynamics, and volatility characteristics to generate predictive signals.
### **Core Methodology**
#### **1. Entanglement Factor Analysis**
- **Concept**: Measures market predictability through autocorrelation analysis of price momentum
- **Purpose**: Identifies periods when price movements follow predictable patterns
- **Implementation**: Calculates correlation between current and historical price changes across multiple timeframes
- **Value**: Higher entanglement indicates more predictable market behavior, increasing signal reliability
#### **2. Trend Strength Assessment**
- **Concept**: Evaluates the relationship between current price and moving average with momentum components
- **Purpose**: Determines trend quality and persistence
- **Implementation**: Combines price-to-MA ratio with short-term momentum analysis
- **Value**: Strong trends provide better context for signal validation
#### **3. Volatility Analysis**
- **Concept**: Multi-dimensional volatility assessment using both statistical and ATR-based measures
- **Purpose**: Identifies market conditions that favor certain signal types
- **Implementation**: Combines standard deviation of returns with ATR-based volatility ratios
- **Value**: Helps distinguish between high-confidence and low-confidence market environments
#### **4. Exhaustion Detection**
- **Concept**: Identifies when trends are losing momentum across multiple timeframes
- **Purpose**: Predicts potential trend reversals before they occur
- **Implementation**: Analyzes momentum slope changes and compares short vs. long-term momentum
- **Value**: Critical for turning point identification and risk management
#### **5. Dynamic Support/Resistance Analysis**
- **Concept**: Real-time identification of key price levels with rejection confirmation
- **Purpose**: Validates signals against significant price levels
- **Implementation**: Tracks multiple touch points and calculates rejection probabilities
- **Value**: Increases signal accuracy by confirming against structural market levels
#### **6. Volume Confirmation**
- **Concept**: Validates signals using volume analysis
- **Purpose**: Ensures signals are supported by institutional activity
- **Implementation**: Compares current volume to historical averages during significant price movements
- **Value**: Filters out weak signals that lack volume support
#### **7. Pattern Correlation**
- **Concept**: Identifies recurring price patterns and their correlation with current market behavior
- **Purpose**: Leverages historical pattern recognition for signal validation
- **Implementation**: Analyzes price change patterns and correlates with historical occurrences
- **Value**: Adds statistical confidence to signal generation
### **Signal Types**
#### **Turning Point Signals (Highest Priority)**
- **Purpose**: Identify high-probability trend reversal points
- **Criteria**: Combines exhaustion detection, support/resistance validation, volume confirmation, and pattern correlation
- **Visual**: Large circles on MA line with 🎯 symbols
- **Use Case**: Major trend changes, swing trading entries
#### **Regular Directional Signals**
- **Purpose**: Identify continuation or new trend directions
- **Criteria**: Based on predictive price analysis with confidence thresholds
- **Visual**: Medium circles on MA line with ▲▼ symbols
- **Use Case**: Trend following, momentum trading
#### **Sideways Signals**
- **Purpose**: Identify range-bound market conditions
- **Criteria**: Low directional confidence with high volatility compression
- **Visual**: Small circles on MA line with ◆ symbols
- **Use Case**: Range trading, consolidation periods
### **Key Features**
#### **Multi-Factor Scoring System**
- **Exhaustion Score**: 25% weight for trend exhaustion detection
- **Levels Score**: 20% weight for support/resistance validation
- **Volatility Score**: 15% weight for market condition assessment
- **Pattern Score**: 15% weight for historical pattern correlation
- **Volume Bonus**: 10% weight for volume confirmation
- **Pattern Bonus**: 5% weight for high correlation patterns
#### **Adaptive Thresholds**
- **Dynamic Sensitivity**: Adjusts to different market conditions
- **Asset-Specific**: Optimized for different instrument types
- **Timeframe Adaptive**: Adjusts parameters based on chart timeframe
#### **Visual Display Options**
- **Bold MA Line**: MA line becomes thicker and colored at signal points
- **Circles on MA**: Precise positioning of signals on moving average
- **Combined Display**: Both methods for maximum visibility
- **Customizable Colors**: Distinct colors for each signal type
### **How to Use**
#### **Setup**
1. Apply to any timeframe (1m to 1D recommended)
2. Adjust MA period based on your trading style (default: 20)
3. Set sensitivity level (0.1-3.0, default: 1.0)
4. Choose signal strength filter (Weak/Medium/Strong)
#### **Signal Interpretation**
- **High Confidence**: Signals with score > 0.7 and strong volume confirmation
- **Medium Confidence**: Signals with score 0.5-0.7 and moderate confirmation
- **Low Confidence**: Signals with score 0.3-0.5 and weak confirmation
#### **Trading Applications**
- **Swing Trading**: Use turning point signals for major reversals
- **Day Trading**: Use regular signals for intraday momentum
- **Position Trading**: Combine with higher timeframes for trend confirmation
### **Technical Specifications**
#### **Input Parameters**
- **MA Period**: 5-200 (default: 20)
- **Sensitivity**: 0.1-3.0 (default: 1.0)
- **Confidence Threshold**: 0.1-0.9 (default: 0.3)
- **Signal Strength**: Weak/Medium/Strong (default: Medium)
#### **Display Options**
- **Signal Display Method**: Bold MA Line / Circles on MA / Both
- **Circle Size**: Small/Medium/Large
- **MA Line Thickness**: 1-5 pixels
- **Information Table**: Real-time signal data
#### **Alerts**
- **Turning Point Alerts**: High-priority reversal signals
- **Regular Signal Alerts**: Directional momentum signals
- **Exhaustion Alerts**: Trend exhaustion warnings
### **Performance Characteristics**
#### **Strengths**
- **Multi-timeframe Analysis**: Works across different chart timeframes
- **Adaptive Parameters**: Automatically adjusts to market conditions
- **High Accuracy**: Combines multiple confirmation methods
- **Clear Visual Signals**: Easy to identify and interpret
#### **Best Practices**
- **Combine with Price Action**: Use signals as confirmation, not standalone
- **Risk Management**: Always use stop losses and position sizing
- **Backtesting**: Test on historical data before live trading
- **Market Conditions**: Works best in trending and volatile markets
### **Disclaimer**
This indicator is for educational and informational purposes only. It should not be considered as financial advice. Always conduct your own research and consider your risk tolerance before making trading decisions. Past performance does not guarantee future results.
---
**Version**: 7.0 Enhanced
**Compatibility**: Pine Script v6
**Last Updated**: September 2024
**Status**: Production Ready
All Levels This script draws key price levels on your chart, including:
• Previous Day (PD): High, Low, Close
• Day Before Yesterday (DBY): High, Low, Close
• Pre-Market (PM): High and Low
• Today’s levels: High, Low, Open, Close
• Current bar levels: High, Low, Open, Close
Each level is displayed as a horizontal line with a label showing the level value.
It works on any timeframe, including 1-minute charts, and automatically updates as new bars form.
⸻
2. Features
1. Custom Colors
Each type of level has its own color, declared as a const color. For example:
• Previous Day High = red
• Today’s Close = gold
• Pre-Market High = fuchsia
2. Right-Extending Lines
All horizontal levels extend to the right, so you always see them on the chart.
3. Persistent Labels
Every line has a label at the right side showing its name and price. For example:
• PDH 422
• TODL 415.5
4. Dynamic Updates
The script updates automatically whenever a new bar forms, so levels stay accurate.
5. Session-Based Pre-Market
You can define the pre-market session (default “04:00–09:30 EST”). The script calculates the high and low of this session only.
6. Checkbox Inputs
You can enable/disable entire groups of levels:
• Previous Day
• Day Before Yesterday
• Pre-Market
• Today
• Current bar
Trend Pro V2 [CRYPTIK1]Introduction: What is Trend Pro V2?
Welcome to Trend Pro V2! This analysis tool give you at-a-glance understanding of the market's direction. In a noisy market, the single most important factor is the dominant trend. Trend Pro V2 filters out this noise by focusing on one core principle: trading with the primary momentum.
Instead of cluttering your chart with confusing signals, this indicator provides a clean, visual representation of the trend, helping you make more confident and informed trading decisions.
The dashboard provides a simple, color-coded view of the trend across multiple timeframes.
The Core Concept: The Power of Confluence
The strength of any trading decision comes from confluence—when multiple factors align. Trend Pro V2 is built on this idea. It uses a long-term moving average (200-period EMA by default) to define the primary trend on your current chart and then pulls in data from three higher timeframes to confirm whether the broader market agrees.
When your current timeframe and the higher timeframes are all aligned, you have a state of "confluence," which represents a higher-probability environment for trend-following trades.
Key Features
1. The Dynamic Trend MA:
The main moving average on your chart acts as your primary guide. Its color dynamically changes to give you an instant read on the market.
Teal MA: The price is in a confirmed uptrend (trading above the MA).
Pink MA: The price is in a confirmed downtrend (trading below the MA).
The moving average changes color to instantly show you if the trend is bullish (teal) or bearish (pink).
2. The Multi-Timeframe (MTF) Trend Dashboard:
Located discreetly in the bottom-right corner, this dashboard is your window into the broader market sentiment. It shows you the trend status on three customizable higher timeframes.
Teal Box: The trend is UP on that timeframe.
Pink Box: The trend is DOWN on that timeframe.
Gray Box: The price is neutral or at the MA on that timeframe.
How to Use Trend Pro V2: A Simple Framework
Step 1: Identify the Primary Trend
Look at the color of the MA on your chart. This is your starting point. If it's teal, you should generally be looking for long opportunities. If it's pink, you should be looking for short opportunities.
Step 2: Check for Confluence
Glance at the MTF Trend Dashboard.
Strong Confluence (High-Probability): If your main chart shows an uptrend (Teal MA) and the dashboard shows all teal boxes, the market is in a strong, unified uptrend. This is a high-probability environment to be a buyer on dips.
Weak or No Confluence (Caution Zone): If your main chart shows an uptrend, but the dashboard shows pink or gray boxes, it signals disagreement among the timeframes. This is a sign of market indecision and a lower-probability environment. It's often best to wait for alignment.
Here, the daily trend is down, but the MTF dashboard shows the weekly trend is still up—a classic sign of weak confluence and a reason for caution.
Best Practices & Settings
Timeframe Synergy: For best results, use Trend Pro on a lower timeframe and set your dashboard to higher timeframes. For example, if you trade on the 1-hour chart, set your MTF dashboard to the 4-hour, 1-day, and 1-week.
Use as a Confirmation Tool: Trend Pro V2 is designed as a foundational layer for your analysis. First, confirm the trend, then use your preferred entry method (e.g., support/resistance, chart patterns) to time your trade.
This is a tool for the community, so feel free to explore the open-source code, adapt it, and build upon it. Happy trading!
For your consideration @TradingView
Simple Turnover (Enhanced v2)📊 Simple Turnover (Enhanced)
🔹 Overview
The Simple Turnover Indicator calculates a stock’s turnover by combining both price and volume, and then compares it against quarterly highs. This helps traders quickly gauge whether market participation in a move is strong enough to confirm a breakout, or weak and likely to be false.
Unlike volume alone, turnover considers both traded volume and price level, giving a truer reflection of capital flow in/out of a stock.
________________________________________
🔹 Formulae Used
1. Average Price (SMA)
AvgPrice=SMA(Close,n)
2. Average Volume (SMA)
AvgVol=SMA(Volume,n)
3. Turnover (Raw)
Turnover raw=AvgPrice × AvgVol
4. Unit Adjustment
• If Millions → Turnover = Turnover raw × 10^−6
• If Crores → Turnover = Turnover raw × 10^−7
• If Raw → Turnover = Turnover raw
5. Quarterly High Turnover (qHigh)
Within each calendar quarter (Jan–Mar, Apr–Jun, Jul–Sep, Oct–Dec), we track the maximum turnover seen:
qHigh=max (Turnover within current quarter)
________________________________________
🔹 Visualization
• Bars → Color follows price candle:
o Green if Close ≥ Open
o Red if Close < Open
• Blue Line → Rolling Quarterly High Turnover (qHigh)
________________________________________
🔹 Strategy Use Case
The Simple Turnover Indicator is most effective for confirming true vs false breakouts.
• A true breakout should be supported by increasing turnover, showing real capital backing the move.
• A false breakout often occurs with weak or declining turnover, suggesting lack of conviction.
📌 Example Strategy (3H timeframe):
1. Identify a demand zone using your preferred supply-demand indicator.
2. From this demand zone, monitor turnover bars.
3. A potential long entry is validated when:
o The current turnover bar is at least 20% higher than the previous one or two bars.
o Example setting: SMA length = 5 (i.e., turnover = 5-bar average close × 5-bar average volume).
4. This confirms strong participation in the move, increasing probability of a sustained breakout.
________________________________________
🔹 Disclaimer
⚠️ This indicator/strategy does not guarantee 100% accurate results.
It is intended to improve the probability of identifying true breakouts.
The actual success of the strategy will depend on price action, market momentum, and prevailing market conditions.
Always use this as a supporting tool along with broader trading analysis and risk management.
Volume Candle Rings [CHE]Volume Candle Rings – Spot Volume Extremes Fast 🔍
Marks exceptionally high volume right on the candle as concentric rings. Instantly see how extreme the spike is (levels 1–10), where it happens (anchor on HL2/Close/BodyMid), and how big it is relative to volatility (ATR-scaled). No magic, no blind signals—just clean context for better decisions.
Why it helps 🎯
Catch true extremes: Positive-side Z-Score maps spikes into 10 levels. By default, only 8/9/10 show—the ones that matter.
Context over clutter: Rings sit on the candle, scale with ATR (market regime), and widen in bars (time). Read absorption, breakout thrusts, or capitulation in context.
Signal the new, not the noise: Optional OFF→ON only drawing cuts chart noise and highlights fresh events.
How it works ⚙️
Z-Score: `z = (Vol – SMA(Vol, lookback)) / StDev(Vol, lookback)` → clipped at `zScoreCap`, normalized, and binned to 1..10 (0 = none). Only z > 0 counts.
Geometry: Vertical diameter = `Level × ATR(atrLength) × atrPerLevel`; horizontal radius = `Level × xBarsPerLevel` bars; curvatureFactor controls roundness.
Anchor: Choose HL2, Close, or BodyMid for the vertical center.
Performance: Keeps up to maxStoredCircles; FIFO cleanup to stay smooth.
Typical use cases 📈
Breakout confirmation: Clusters of 8–10 at range edges → rising initiative.
Absorption / fade: Extreme ring (9–10) without follow-through → potential stall or reversal.
Blow-off / climax: Single huge ring after a long run → higher odds of mean reversion.
News filtering: Show the real outliers, not every minor bump.
Inputs (mapped 1:1) 🧩
Z-Score & Levels
Lookback (SMA/StDev) – default 200
Z-Score Clipping – default 5.0
Behavior
Draw every bar – default ON; OFF = only on OFF→ON switches
Max circles to retain – default 120
Anchoring & Geometry
Anchor on candle – HL2 / Close / BodyMid
ATR Length – default 50
ATR per Level (Y) – default 0.25
Bars per Level (X) – default 0.15
Circle curvature – default 0.70
Level Selection (1–10)
Default: 8/9/10 ON, 1–7 OFF. Colors grade from teal/green → orange → red; fill opacity separate.
Quick presets ⏱️
Intraday (1–5m): Lookback 150–250, Cap 4.0–5.0, ATR/Level 0.20–0.30, Bars/Level 0.10–0.20, Draw every bar OFF.
Swing (1H–1D): Lookback 200–300, Cap 5.0, ATR/Level 0.25–0.35, Bars/Level 0.15–0.25, keep 8–10.
Aggressive scouting: Also enable Level 7 for early accumulation.
Pro tips 💡
Control object load: Reduce maxStoredCircles or switch Draw every bar OFF on busy charts.
Seek confluence: Combine rings with S/R, range edges, VWAP, session H/L. A ring is information, not an entry by itself.
Color discipline: Reserve red (9/10) for true extremes; keep lower levels subtle.
Limits & notes 🧭
This is visualization, not alerts or auto signals.
Many polylines can slow charts—tune Behavior settings.
Works across markets/timeframes; adapt parameters to the asset’s character.
Who it’s for 🙌
Traders who read volume in price context—breakouts, fades, reversals. See when the market is truly stepping on the gas.
Volume Candle Rings \ turns raw volume into precise, scale-aware markers. Spot extremes faster, avoid confusing “loud” with “important,” and make cleaner, context-driven decisions. 🚀
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Best regards and happy trading
Chervolino
Market Structure Smart Money Concept - BOS + CHOCH + IDMThis tool is designed for traders working with Smart Money Concepts (SMC) and analyzing market structure.
Key Elements
It automatically identifies and marks:
- **BOS (Break of Structure)** – confirmed breaks signaling trend continuation
- **CHoCH (Change of Character)** – reversal points marking trend changes
- **IDM (Internal Market Structure)** – a critically important element that helps distinguish true reversals from temporary corrections
- **Inside Bars** – automatic detection of inside bars to filter out "noise"
Why IDM is Important
Traders often mistake ordinary liquidity collection for the beginning of a new trend. IDM acts as an additional filter - only after its break can we speak of a true change in market structure.
Flexible Settings
- Label sizes and colors
- Line styles
- Separate settings for shadow and body breaks
- Search period configuration for initial points (1-100% of available history)
- Option to display current structure level lines
- Information table
Main Advantages
- Clear real-time market structure visualization
- Separation of body and shadow breaks for more precise analysis
- Flexibility of use: suitable for both intraday scalping and medium-term trading
- Minimization of subjectivity through strict algorithm
- Works on any timeframe and liquid instruments
**This indicator allows you to clearly see the current market structure, quickly assess market conditions, track key turning points, identify the active trend and potential reversals.**
==================================================================================
Этот инструмент создан для трейдеров, работающих по Smart Money Concepts (SMC) и анализирующих рыночную структуру.
### Ключевые элементы
Он автоматически определяет и отмечает:
- **BOS (Break of Structure)** – подтверждённые пробои, сигнализирующие о продолжении тренда
- **CHoCH (Change of Character)** – разворотные точки, фиксирующие смену тренда
- **IDM (Internal Market Structure)** – критически важный элемент, который помогает отличить истинные развороты от временных коррекций
- **Inside Bars** – автоматическое определение внутренних баров для фильтрации "шума"
Почему IDM важен
Часто трейдеры принимают обычный сбор ликвидности за начало нового тренда. IDM действует как дополнительный фильтр - только после его пробоя можно говорить об истинном изменении структуры рынка.
Гибкие настройки
- Размеры и цвета меток
- Стили линий
- Отдельные настройки для теневых и полнотелых пробоев
- Настройка периода поиска начальных точек (1-100% от доступной истории)
- Опция отображения линий текущих структурных точек
- Информационная таблица
Основные преимущества
- Чёткая визуализация структуры рынка в реальном времени
- Разделение полнотелых и теневых пробоев для более точного анализа
- Гибкость использования: подходит как для интрадей-скальпинга, так и для среднесрочной торговли
- Минимизация субъективности через строгий алгоритм
- Подходит для любых таймфреймов и ликвидных инструментов
**Этот индикатор позволяет ясно видеть текущую рыночную структуру, быстро оценить ситуацию на рынке, отслеживать ключевые переломные моменты, определить активный тренд и возможный разворот.**
NQ Trading Strategy by Kaok TradesThe Kaok Trades NQ Scalping Strategy is designed for traders who want to capture high-probability intraday moves on Nasdaq Futures with minimal screen time. This strategy combines momentum confirmation with volatility-based stop placement, helping traders manage risk and maximize reward.
GUSIGUSI Free — Adaptive Bitcoin Cycle Risk (0–100)
What it does
GUSI Free converts multiple cycle-relevant metrics into a single 0–100 risk score for Bitcoin. Instead of static thresholds (which tend to degrade across cycles), GUSI uses cycle-aware, time-varying trigger levels and long-horizon normalization to keep signals meaningful as the market matures. The panel shows the composite line plus actionable trigger levels that highlight overheated vs. deep-value conditions.
What’s new vs. typical versions
Decreasing/Sloped trigger functions: Each metric is evaluated against non-horizontal, time-adjusted thresholds so that tops don’t rely on fixed numbers that become obsolete as adoption and liquidity evolve.
Long-term normalization: Outlier-resistant smoothing and z-score style lookbacks reduce distortion from short, violent swings.
Composite risk mapping: Modernized component signals are transformed to a unit scale and merged into one interpretable 0–100 metric—clearer to read, harder to misread.
How the model is built (proprietary, modernized components)
Each element below is a modified version of a familiar idea, adapted for cycle drift and volatility profile changes:
Logarithmic MACD (LMACD): Computed in log-return space with Ehlers-style smoothing, evaluated against down-sloping top and up-tilting bottom bands.
MVRV-Z (regression-guided): Market-to-realized premium mapped to cycle-aware upper/lower bands that decline/rise over time rather than sit flat.
NUPL / NUPL-Z blend: Tops assessed with a declining NUPL threshold, bottoms with dynamic z-score normalization, then fused to a single risk contribution.
Puell Multiple (log-decay): Issuance revenue multiple measured against log-decaying top and gently rising bottom references.
Weekly RSI (bottom context): A weekly momentum filter contributes only to downside risk context to avoid double-counting tops.
Risk-metric construction (0–100)
Each component is scaled between its cycle-aware bottom and top reference, producing a bounded unit risk.
Internally weighted components are combined into one composite, then scaled to 0–100.
The panel overlays trigger levels commonly used by GUSI users:
Around 97 → historically consistent with top-risk environments.
Around 2.5 → historically consistent with deep accumulation conditions.
Background highlights and labels make these zones explicit, so the chart conveys state (distribution/accumulation) at a glance.
Intended chart context
Use on INDEX:BTCUSD, 1D timeframe for the designed behavior.
Scope & realism
This is an analytical risk model, not a promise of returns. Historical alignment with cycle extremes does not guarantee future outcomes. Always combine with independent risk management and confirm on-chain/data availability.
Long-only Swing/Scalp (anchored exits + TP harness) Traders PostThis is the Traders Post friendly drag and drop version of the swing/ scalp strategy for the algo traders out there. Let me know your thoughts, constructive criticism is always welcome.
Long‑only Swing/ScalpThis is a basic scalper stategy for algos or crypto bots, tested on BNB, not the best backtest but you can tweak and get better results. Take profit at 1% and Sl at 2% , adjust those settings first to see different back test resutls.
GUSI BasicGUSI Basic — Adaptive Bitcoin Cycle Risk
What it does
GUSI Basic calculates a 0–100 risk score for Bitcoin cycles using a blend of adapted on-chain and market signals. Unlike traditional versions of NUPL, MVRV, or Puell Multiple that rely on static thresholds, GUSI introduces sloped trigger lines and long-term normalization techniques. This makes the logic responsive to Bitcoin’s structural changes over time, keeping signals relevant across multiple cycles.
Key features
Dynamic thresholds: Instead of fixed horizontal levels, each signal uses sloped functions that decrease or increase gradually, reflecting the evolving maturity of the Bitcoin market.
Noise reduction: Long-term smoothing and z-score normalization help filter out extreme volatility and short-term distortions.
Composite score: Multiple proprietary adaptations are merged into a single, intuitive risk scale that simplifies interpretation without oversimplifying the data.
Component transparency: Users can enable or disable individual elements to see how each contributes to the composite model.
Signals included
Logarithmic MACD with cycle-aware thresholds
MVRV-Z Regression with declining bands
Net Unrealized Profit/Loss with z-score normalization
Puell Multiple with logarithmic decay
Weekly RSI Momentum filter for cycle lows
How to use
Apply on INDEX:BTCUSD, 1D chart for the intended view.
Readings near 97 have historically aligned with overheated market conditions.
Readings near 2.5 have marked deep accumulation zones.
Labels and background colors provide direct visual cues for both accumulation and distribution phases.
Summary
GUSI Basic adapts classic on-chain metrics to today’s Bitcoin market. By replacing static thresholds with sloped functions and normalization, it provides a composite view that evolves with each cycle—offering traders a clearer, cycle-aware perspective.
GUSI ProGUSI — Adaptive Bitcoin Cycle Risk Model
Most on-chain metrics published on TradingView — such as NUPL, MVRV, or Puell Multiple — were once reliable in past cycles but have lost accuracy. The reason is simple: their trigger levels are static, while Bitcoin’s market structure changes over time. Tops have formed lower each cycle, yet the traditional horizontal thresholds remain unchanged.
What GUSI does differently:
It introduces sloped trigger functions that decrease over time, adapting each metric to Bitcoin’s maturing market.
It applies long-term normalization methods (smoothing and z-score lookups) to reduce distortion from short-term volatility and extreme outliers.
It only includes signals that remain valid across all Bitcoin cycles since 2011, discarding dozens of popular on-chain ideas that fail even after adjustment.
How GUSI is built:
GUSI is not just a mashup of indicators. Each component is a proprietary, modified version of a known on-chain signal:
Logarithmic MACD with declining trigger bands
MVRV-Z Score Regression with cycle-aware slopes
Net Unrealized Profit/Loss Ratio normalized with dynamic z-scores
Puell Multiple with logarithmic decay
Weekly RSI momentum filter for bottoms
Optional Pi Cycle Top logic with sloped moving averages
These are combined into a composite risk scoring system (0–100). Every signal contributes to the score according to user-defined weights, and each can be toggled on/off. The end result is a flexible model that adapts to long-term changes in Bitcoin’s cycles while staying transparent in its logic.
How to use it:
Scores near 97 indicate historically high-risk conditions (cycle tops).
Scores near 2.5 highlight deep accumulation zones (cycle bottoms).
Background colors and labels make the conditions clear, and built-in alerts let you automate your strategy.
GUSI is designed for the INDEX:BTCUSD 1D chart and works best when viewed in that context.
In short: GUSI makes classic on-chain indicators relevant again by adapting them to Bitcoin’s evolving market cycles. Instead of relying on static thresholds that stop working over time, it introduces dynamic slopes, normalization, and a weighted composite framework that traders can adjust themselves.
For explanations, customization guides, and support, visit gusi-signal.com.
Ultimate Gold Long Indicator - Execução Final v26.1 By M.LolasUltimate Gold Long Indicator - Execução Final v26.1 By M.Lolas
Central indicator for by long in 15m time frame 20x.
“Backtested indicator for an aggressive 15-minute, 20×-leverage strategy, packed with capital-protection features.”
By M.Lolas
Ultimate Gold Confluence Score – Validator v6.1 By M.Lolas“Ultimate Gold Confluence Score Validator — multi-indicator add-on for a 15-minute, 20× long strategy with a very high win rate. Supports the strategy’s main indicator.”
EMP Probabilistic [CHE]Part 1 — For Traders (Practical Overview, no formulas)
What this tool does
EMP Probabilistic \ turns raw price action into a clean, probability-aware map. It builds two adaptive bands around the session open of a higher timeframe you choose (called the S-timeframe) and highlights a robust median threshold. At a glance you know:
Where price has recently tended to stay,
Whether current momentum sits above or below the median, and
A live Long vs. Short probability based on recent outcomes.
Why it improves decisions
Objective context in any regime: The nonparametric band comes straight from recent market behavior, without assuming a particular distribution.
Volatility-aware risk lens: The parametric band adapts to current volatility, helping you judge stretch and room for continuation or snap-back.
No lookahead: All stats update only after an S-bar is finished. That means the panel reflects information you truly had at that time.
How to read the chart
Orange band = empirical, distribution-free range derived from recent session returns (nonparametric).
Teal band = volatility-scaled range around the session open (parametric).
Median dots: green when close is above the median threshold, red when below.
Info panel: shows the active S-timeframe, window sizes, live coverage for both bands, the internal width parameter and volatility estimate, plus a one-line summary.
Probability label: “Long XX% • Short YY%” — a simple read on the recent balance of up vs. down S-bars.
How to use it (quick start)
1. Choose S-timeframe with Auto, Multiplier, or Manual. “Auto” scales your chart TF up to a sensible higher step.
2. Set alpha to control how tight the inner band should be. A typical value gives you a comfortable center zone without cutting off healthy trends.
3. Trade the context:
Trend-following: Prefer longs when price holds above the median; prefer shorts when it stays below.
Mean-reversion: Fade moves near the outer edges during ranges; look for reversion back toward the median.
Breakout filter: Require closes that push and hold beyond the volatility band for momentum plays; avoid noise when price chops inside the middle of the orange band.
Risk management made practical
Size positions relative to the teal band width to keep risk consistent across instruments and regimes.
For stops, many traders set them just beyond the opposite orange bound or use a fraction of the teal band.
Watch the panel’s coverage readouts and Brier score; when they deteriorate, the market may be shifting — reduce size or demand stronger confirmation.
Suggested presets
Scalping (Crypto/FX): Auto S-TF, alpha around a fifth, calibration window near two hundred, RS volatility, metrics window near two hundred.
Intraday Futures: Multiplier 3–5× your chart TF; similar alpha and window sizes; RS volatility is a solid default.
Swing/Equities: S-TF at least daily; test both RS and GK volatility modes; keep windows on the larger side for stability.
What makes it different
Two complementary lenses: a distribution-free read of recent behavior and a volatility-scaled read for risk and stretch.
Self-calibrating width: the parametric band quietly nudges its internal multiplier so actual coverage tracks your target.
Clean UX: grouped inputs, tooltips, an info panel that tells you what’s going on, and a simple median bias you can act on.
Repainting & timing
The logic updates only when the S-bar closes. On lower-timeframe charts you’ll see intrabar flips of the dot color — that’s just live price moving around. For strict signals, confirm on S-bar close.
Friendly note (not financial advice)
Use this as a context engine. It won’t predict the future, but it will keep you on the right side of probability and volatility more often, which is exactly where consistency starts.
Part 2 — Under the Hood (Conceptual, no formulas)
Data and timeframe design
The script works on a higher S-timeframe you select. It fetches the open, high, low, close, and time of that S-bar. Internally, it only updates its rolling windows after an S-bar has finished. It then pushes the previous S-bar’s statistics into its arrays. That design removes lookahead and keeps the metrics out-of-sample relative to the current S-bar.
Nonparametric band (distribution-free)
The orange band comes from the empirical distribution of recent session-level close-minus-open moves. The script keeps a rolling window, sorts a safe copy, and reads three key points: a lower bound, a median, and an upper bound. Because it’s based purely on observed outcomes, it adapts naturally to skew, fat tails, and regime shifts without assuming any particular shape. The orange range shows “where price has tended to live” lately on the chosen S-timeframe.
Parametric band (volatility-scaled)
The teal band models log-space variability around the session open using one of two well-known OHLC volatility estimators: Rogers–Satchell or Garman–Klass. Each estimator contributes a per-bar variance figure; the script averages these across the rolling window to form a current volatility scale. It then builds a symmetric band around the session open in price space. This gives you a volatility-aware notion of stretch that complements the distribution-free orange band.
Self-calibration of band width
The teal band has an internal width multiplier. After each completed S-bar the script checks whether the realized move stayed inside that band. If the band was too tight, the multiplier is nudged upward; if it was too loose, it’s eased downward. A simple learning rate governs how quickly it adapts. Over time this keeps the realized inside-coverage close to the target implied by your alpha setting, without you having to hand-tune anything.
Long/Short probability and calibration quality
The Long vs. Short probability is a transparent statistic: it’s just the recent fraction of up sessions in the rolling window. It is not a complex model — and that’s the point. You get an honest, intuitive read on directional tendency.
To monitor how well this simple probability lines up with reality, the script tracks a Brier-style score over a separate metrics window. Lower is better: it means your recent probability read has matched outcomes more closely.
Coverage tracking for both bands
The panel reports coverage for the orange band (nonparametric) and the teal band (parametric). These are rolling averages of how often recent S-bar moves landed inside each band. Watching these two numbers tells you whether market behavior still aligns with the recent distribution and with the current volatility model.
Why it doesn’t repaint
Because the arrays update only when an S-bar closes and only push the previous bar’s stats, the panel and metrics reflect information you had at the time. Intrabar visuals can change while a bar is forming — that’s expected — but the decision framework itself is anchored to completed S-bars.
Performance and practicality
The heaviest step is sorting a copy of the window for the nonparametric band. With typical window sizes this stays responsive on TradingView. The volatility estimators and rolling averages are lightweight. Inputs are grouped with clear tooltips so you can tune without hunting.
Limitations and good practice
In thin or gappy markets the bands can jump; consider a larger window or a higher S-timeframe.
During violent regime shifts, shorten the window and increase the learning rate slightly so the teal band catches up faster — but don’t overdo it, or you’ll chase noise.
The Long/Short probability is intentionally simple; it’s a context indicator, not a standalone signal factory. Combine it with structure, volume, or your execution rules.
Takeaway
Under the hood, the script blends empirical behavior and volatility scaling, then self-calibrates so the teal band’s real-world coverage stays near your target. You get clarity, consistency, and a dashboard that tells you when its own assumptions are holding up — exactly what you need to trade with confidence.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Best regards and happy trading
Chervolino