PCA Regime-Adjusted MomentumSummary
The PCA Regime-Adjusted Momentum (PCA-RAM) is an advanced market analysis tool designed to provide nuanced insights into market momentum and structural stability. It moves beyond traditional indicators by using Principal Component Analysis (PCA) to deconstruct market data into its most essential patterns.
The indicator provides two key pieces of information:
A smoothed momentum signal based on the market's dominant underlying trend.
A dynamic regime filter that gauges the stability and clarity of the market's structure, advising you when to trust or fade the momentum signals.
This allows traders to not only identify potential shifts in momentum but also to understand the context and confidence behind those signals.
Core Concepts & Methodology
The strength of this indicator lies in its sound, data-driven methodology.
1. Principal Component Analysis (PCA)
At its core, the indicator analyzes a rolling window (default 50 periods) of standardized market data (Open, High, Low, Close, and Volume). PCA is a powerful statistical technique that distills this complex, 5-dimensional data into its fundamental, uncorrelated components of variance. We focus on the First Principal Component (PC1), which represents the single most dominant pattern or "theme" driving the market's behavior in the lookback window.
2. The Momentum Signal
Instead of just looking at price, we project the current market data onto this dominant underlying pattern (PC1). This gives us a raw "projection score" that measures how strongly the current bar aligns with the historically dominant market structure. This raw score is then smoothed using two an exponential moving averages (a fast and a slow line) to create a clear, actionable momentum signal, similar in concept to a MACD.
3. The Dynamic Regime Filter
This is arguably the indicator's most powerful feature. It answers the question: "How clear is the current market picture?"
It calculates the Market Concentration Ratio, which is the percentage of total market variance explained by PC1 alone.
A high ratio indicates that the market is moving in a simple, one-dimensional way (e.g., a clear, strong trend).
A low ratio indicates the market is complex, multi-dimensional, and choppy, with no single dominant theme.
Crucially, this filter is dynamic. It compares the current concentration ratio to its own recent average, allowing it to adapt to any asset or timeframe. It automatically learns what "normal" and "choppy" look like for the specific chart you are viewing.
How to Interpret the Indicator
The indicator is displayed in a separate pane with two key visual elements:
The Momentum Lines (White & Gold)
White Line: The "Fast Line," representing the current momentum.
Gold Line: The "Slow Line," acting as the trend confirmation.
Bullish Signal: A crossover of the White Line above the Gold Line suggests a shift to positive momentum.
Bearish Signal: A crossover of the White Line below the Gold Line suggests a shift to negative momentum.
The Regime Filter (Purple & Dark Red Background)
This is your confidence gauge.
Navy Blue Background (High Concentration): The market structure is stable, simple, and trending. Momentum signals are more reliable and should be given higher priority.
Dark Red Background (Low Concentration): The market structure is complex, choppy, or directionless. Momentum signals are unreliable and prone to failure or "whipsaws." This is a signal to be cautious, tighten stops, or potentially stay out of the market.
Potential Trading Strategies
This tool is versatile and can be used in several ways:
1. Primary Signal Strategy
Condition: Wait for the background to turn Purple, confirming a stable, high-confidence regime.
Entry: Take the next crossover signal from the momentum lines (White over Gold for long, White under Gold for short).
Exit/Filter: Consider exiting positions or ignoring new signals when the background turns Navy.
2. As a Confirmation or Filter for Your Existing Strategy
Do you have a trend-following system? Only enable its long and short signals when the PCA-RAM background is Purple.
Do you have a range-trading or mean-reversion system? It might be most effective when the PCA-RAM background is Navy, indicating a lack of a clear trend.
3. Advanced Divergence Analysis
Look for classic divergences between price and the momentum lines. For example, if the price is making a new high, but the Gold Line is making a lower high, it may indicate underlying weakness in the trend, even on a Purple background. This divergence signal is more powerful because it shows that the new price high is not being confirmed by the market's dominant underlying pattern.
Göstergeler ve stratejiler
Correlation MA – 15 Assets + Average (Optional)This indicator calculates the moving average of the correlation coefficient between your charted asset and up to 15 user-selected symbols. It helps identify uncorrelated or inversely correlated assets for diversification, pair trading, or hedging.
Features:
✅ Compare your current chart against up to 15 assets
✅ Toggle assets on/off individually
✅ Custom correlation and MA lengths
✅ Real-time average correlation line across enabled assets
✅ Horizontal lines at +1, 0, and -1 for easy visual reference
Ideal for:
Portfolio diversification analysis
Finding low-correlation stocks
Mean-reversion & pair trading setups
Crypto, equities, ETFs
To use: set the benchmark chart (e.g. TSLA), choose up to 15 assets, and adjust settings as needed. Look for assets with correlation near 0 or negative values for uncorrelated performance.
3-Day Average Range Excluding TodayThis indicator shows average true range on last 3 bars, price only
My Trading mantra/playbook🧠 My Trading Mantra — Motivational Trading Reminder Overlay
This indicator displays a customizable trading mantra as an overlay on your TradingView charts to keep your mindset sharp and disciplined during trading sessions.
You can customize the mantra text, font size, text color, background color, transparency, and screen position (top, middle, bottom, left, right, center).
It’s designed to serve as a constant motivational reminder emphasizing core trading principles like planning, risk management, patience, and learning from losses to grow profits.
Features:
Customizable multi-line mantra text input
Adjustable font size (small to huge)
Color customization for text and background
Adjustable background transparency
Multiple screen position options for display
Lightweight and simple overlay, no performance impact
Purpose:
To help traders stay mentally focused and disciplined by having their personalized mantra visible at all times while analyzing charts.
Additionally, it can be used as a trading plan or playbook, allowing traders to display their key rules, strategies, or reminders directly on their charts for quick reference during live trading.
code is open with love.
you are a good trader don't let the markets tell you diffrent.
Position Size & Stop-Loss CalculatorPine Script Code for Position Size & Stop-Loss Calculator Indicator
This Pine Script indicator for TradingView will allow you to input your trading parameters and see the calculated Stop-Loss Price plotted on the chart, along with the recommended number of shares and maximum dollar risk displayed as a text label.
LB | SB | OH | OL (Auto Futures OI)This indicator is for trading purposes, particularly in futures markets given the inclusion of open interest (OI) data.
Indicator Name and Overlay: The indicator is named "LB | SB | OH | OL" and is set to overlay on the price chart (overlay=true).
Override Symbol Input: Users can input a symbol to override the default symbol for analysis.
Open Interest Data Retrieval: It retrieves open interest data for the specified symbol and time frame. If no data is found, it generates a runtime error.
Dashboard Configuration: Users can choose to display a dashboard either at the top right, bottom right, or bottom left of the chart.
Calculations:
It calculates the percentage change in open interest (oi_change).
It calculates the percentage change in price compared to the previous day's close (price_change).
Build Up Conditions:
Long Build Up: When there's a significant increase in open interest (OIChange threshold) and price rises (PriceChange threshold).
Short Build Up: When there's a significant increase in open interest (OIChange threshold) and price falls (PriceChange threshold).
Display Table:
It creates a table on the chart showing the build-up conditions, open interest change percentage, and price change percentage.
Labeling:
It allows for the labeling of buy and sell conditions based on price movements.
Overall, this indicator provides a visual representation of open interest and price movements, helping traders identify potential trading opportunities based on build-up conditions and price behavior.
The "LB | SB | OH | OL" indicator is a tool designed to assist traders in analyzing price movements and open interest (OI) changes in FNO markets. This indicator combines various elements to provide insights into long build-up (LB), short build-up (SB), open-high (OH), and open-low (OL) scenarios.
Key features of the indicator include:
Override Symbol Input: Traders can override the default symbol and input their preferred symbol for analysis.
Open Interest Data: The indicator retrieves open interest data for the selected symbol and time frame, facilitating analysis based on changes in open interest.
Dashboard: The indicator features a customizable dashboard that displays key information such as build-up conditions, OI change, and price change.
Build-Up Conditions: The indicator identifies long build-up and short build-up scenarios based on user-defined thresholds for OI change and price change percentages.
Customization Options: Traders have the flexibility to customize various aspects of the indicator, including colors for long build-up, short build-up, positive OI change, negative OI change, positive price change, and negative price change.
Label Plots: Buy and sell labels are plotted on the chart to highlight potential trading opportunities. Traders can customize the colors and text colors of these labels based on their preferences.
Overall, the "LB | SB | OH | OL" indicator offers traders a comprehensive tool for analyzing price movements and open interest changes, helping them make informed trading decisions in the FNO markets.
ATR | LOTSIZE | Risk (Futures)This Pine Script is a futures-specific trading utility designed to help F\&O (Futures and Options) traders quickly assess the volatility and position sizing for any selected stock on the chart — even if it's not a futures chart.
What the Script Does:
* Automatically detects the futures symbol for the underlying equity using a dynamic mapping system.
* Calculates the ATR (Average True Range) of the futures contract using either SMA or EMA.
* Fetches the Lot Size (Point Value) of the futures instrument.
* Computes risk per lot by multiplying ATR with lot size (Risk = ATR × Lot Size).
* Displays all 3 values — ATR, Lot Size, and Risk in INR — in a compact table on the chart.
Why This Is Useful for F\&O Traders:
* ✅ Quick Risk Assessment: Helps traders understand how much is at risk per lot without switching to the actual futures chart.
* ✅ Position Sizing: Provides data to calculate how many lots to trade based on a defined risk per trade.
* ✅ Volatility Awareness:ATR gives insights into how much the stock typically moves, guiding stop-loss and target placements.
* ✅ Efficient Workflow:No need to load separate futures charts or lookup lot sizes manually — saves time and reduces error.
This tool is ideal for discretionary and systematic traders who want risk and volatility context for every trade, especially in the NSE Futures & Options segment.
McGinley Dynamic debugged🔍 McGinley Dynamic Debugged (Adaptive Moving Average)
This indicator plots the McGinley Dynamic, a mathematically adaptive moving average designed to reduce lag and better track price action during both trends and consolidations.
✅ Key Features:
Adaptive smoothing: The McGinley Dynamic adjusts itself based on the speed of price changes.
Lag reduction: Compared to traditional moving averages like EMA or SMA, McGinley provides smoother yet responsive tracking.
Stability fix: This version includes a robust fix for rare recursive calculation issues, particularly on low-priced historical assets (e.g., Wipro pre-2000).
⚙️ What’s Different in This Debugged Version?
Implements manual clamping on the source / previous value ratio to prevent mathematical spikes that could cause flattening or distortion in the plotted line.
Ensures more stable behavior across all instruments and timeframes, especially those with historically low price points or volatile early data.
💡 Use Case:
Ideal for:
Trend confirmation
Entry filtering
Adaptive support/resistance visualization
Improving signal precision in low-volatility or high-noise environments
⚠️ Notes:
Works best when combined with volume filters or other trend indicators for validation.
This version is optimized for visual use—for signal generation, consider pairing it with additional logic or thresholds.
Laplace Momentum Percentile ║ BullVision 🔬 Overview
Laplace Momentum Percentile ║ BullVision is a custom-built trend analysis tool that applies Laplace-inspired smoothing to price action and maps the result to a historical percentile scale. This provides a contextual view of trend intensity, with optional signal refinement using a Kalman filter.
This indicator is designed for traders and analysts seeking a normalized, scale-independent perspective on market behavior. It does not attempt to predict price but instead helps interpret the relative strength or weakness of recent movements.
⚙️ Key Concepts
📉 Laplace-Based Smoothing
The core signal is built using a Laplace-style weighted average, applying an exponential decay to price values over a specified length. This emphasizes recent movements while still accounting for historical context.
🎯 Percentile Mapping
Rather than displaying the raw output, the filtered signal is converted into a percentile rank based on its position within a historical lookback window. This helps normalize interpretation across different assets and timeframes.
🧠 Optional Kalman Filter
For users seeking additional smoothing, a Kalman filter is included. This statistical method updates signal estimates dynamically, helping reduce short-term fluctuations without introducing significant lag.
🔧 User Settings
🔁 Transform Parameters
Transform Parameter (s): Controls the decay rate for Laplace weighting.
Calculation Length: Sets how many candles are used for smoothing.
📊 Percentile Settings
Lookback Period: Defines how far back to calculate the historical percentile ranking.
🧠 Kalman Filter Controls
Enable Kalman Filter: Optional toggle.
Process Noise / Measurement Noise: Adjust the filter’s responsiveness and tolerance to volatility.
🎨 Visual Settings
Show Raw Signal: Optionally display the pre-smoothed percentile value.
Thresholds: Customize upper and lower trend zone boundaries.
📈 Visual Output
Main Line: Smoothed percentile rank, color-coded based on strength.
Raw Line (Optional): The unsmoothed percentile value for comparison.
Trend Zones: Background shading highlights strong upward or downward regimes.
Live Label: Displays current percentile value and trend classification.
🧩 Trend Classification Logic
The indicator segments percentile values into five zones:
Above 80: Strong upward trend
50–80: Mild upward trend
20–50: Neutral zone
0–20: Mild downward trend
Below 0: Strong downward trend
🔍 Use Cases
This tool is intended as a visual and contextual aid for identifying trend regimes, assessing historical momentum strength, or supporting broader confluence-based analysis. It can be used in combination with other tools or frameworks at the discretion of the trader.
⚠️ Important Notes
This script does not provide buy or sell signals.
It is intended for educational and analytical purposes only.
It should be used as part of a broader decision-making process.
Past signal behavior should not be interpreted as indicative of future results.
Open Range Breakout (ORB) with Alerts
📘 Open Range Breakout (ORB) Indicator – by thechartsalgo™
🧠 What It Does:
This indicator helps traders identify breakout opportunities from t he initial price range of the trading day — typically the first 15 or 30 minutes after the market opens.
It tracks the high and low of a user-defined time window (e.g. 9:30–9:45) and plots these levels on the chart. Once the session range is set, it detects breakouts when price moves above the range high (bullish breakout) or below the range low (bearish breakout).
⚙️ Key Features:
✅ Custom Time Window
Define your own start and end time for the range (e.g., 09:30–09:45).
✅ Breakout Signals
Arrows show up when price breaks above or below the range after it has formed.
✅ Color Customization
Choose your own colors for range lines and background zone.
✅ Background Highlight
Optional shaded fill between high/low makes the range visually clear.
✅ Only Show Today's Range
Option to hide previous day levels to keep your chart clean.
✅ Alerts
Built-in alerts notify you when a breakout occurs — long or short.
📈 How to Use It:
Set the start and end time to match your market’s open range (commonly first 15, 30, or 60 minutes).
Wait for the range to lock in (highlighted area on chart).
Trade the breakout direction once price moves above or below the range.
Optionally, use it in combination with volume or price action confirmation.
🔔 Alerts (Optional Setup):
ORB Breakout Up → triggers when price closes above the high
ORB Breakout Down → triggers when price closes below the low
📌 Who Is It For?
Day traders looking to catch early momentum
Scalpers using session-based price action
Strategy developers who use the opening range as a key concept.
⚠️ Disclaimer:
This indicator is for educational and informational purposes only. It is not financial advice, and no guarantees are made regarding its accuracy or effectiveness.
All trading involves risk. You are solely responsible for your own trading decisions. Always do your own research and consult with a licensed financial advisor before making any investment decisions.
By using this script, you agree that thechartsalgo™, its developers, and affiliates are not liable for any losses or damages resulting from the use of this tool.
TZSesThe script visually highlights major forex trading sessions (London, New York, Tokyo) and a "true day" separator on the chart background to help traders identify the most active market hours and daily boundaries.
Triple EMA Momentum Oscillator (TEMO) HistogramThis Pine Script code replicates the Python indicator you provided, calculating the Triple EMA Momentum Oscillator (TEMO) and generating signals based on its value and momentum.
Explanation of the Code:
User Inputs:
Allows you to adjust the periods for the short, mid, and long EMAs.
Calculate EMAs:
Computes the Exponential Moving Averages for the specified periods.
Calculate EMA Spreads (Distances):
Finds the differences between the EMAs to understand the spread between them.
Calculate Spread Velocities:
Determines the change in spreads from the previous period, indicating momentum.
Composite Strength Score:
Weighted calculation of the spreads normalized by the EMA values.
Velocity Accelerator:
Weighted calculation of the velocities normalized by the EMA values.
Final TEMO Oscillator:
Combines the spread strength and velocity accelerator to create the TEMO.
Generate Signals:
Signals are generated when TEMO is positive and increasing (buy), or negative and decreasing (sell).
Plotting:
Zero Line: Helps visualize when TEMO crosses from positive to negative.
TEMO Oscillator: Plotted with green for positive values and red for negative values.
Signals: Displayed as a histogram to indicate buy (1) and sell (-1) signals.
Usage:
Buy Signal: When TEMO is above zero and increasing.
Sell Signal: When TEMO is below zero and decreasing.
Note: This oscillator helps identify momentum changes based on EMAs of different periods. It's useful for detecting trends and potential reversal points in the market.
Timeframe % TrakcerPulls historical closes from nine higher-timeframe look-backs (1 H, 12 H, 1 D, 7 D, 14 D, 1 M, 3 M, 6 M, 1 Y, 3 Y) with request.security().
2. Calculates the percent change between each look-back close and the current price:
(close − close₍look-back₎) / close₍look-back₎ × 100
3. Renders a two-column table in the chart’s top-right corner.
• Left column = timeframe label
• Right column = % move, rounded to two decimals
4. Heat-codes the cells — green if the asset is up, red if it’s down — so you can spot momentum (or pain) instantly.
5. Stays lightweight by updating only on the last bar; no excess runtimes.
X OROverview
Designed to plot hourly opening ranges (ORs) on an intraday chart. It primarily serves as a trading tool for assessing market direction and potential trading opportunities by analyzing price action relative to key OHLC (Open, High, Low, Close) levels within each hourly range.
The code provided is for each hour sessions from 2:00 AM to 3:00 PM for a complete session-based framework. In addition there is the RTH open range
Purpose
The core purpose of this indicator is to:
✅ Define each hourly range (based on the session’s opening bar) by recording the high and low of that range.
✅ Extend this range into the following bars for visual reference — serving as dynamic support and resistance zones.
✅ Monitor price action relative to each hourly OR, helping traders evaluate market direction and structure trades using concepts like:
Breakouts above/below the OR high/low.
Rejections or consolidations within the OR.
Continuation or reversal signals tied to each OR.
Key Features
The script marks the first bar of the session as the OR session start.
During this bar, it initializes:
Opening price
Session high
Session low
These levels form the initial range.
🔹 Dynamic Range Tracking
Throughout the one-minute OR session:
The highest and lowest prices are updated in real time, capturing intra-hour volatility.
A visual background box is drawn to highlight the OR range on the chart.
🔹 Range Extension
The script defines an extended session period after the initial OR (e.g., 2:00 AM-2:45 AM for the 2:00 AM session).
During this extension period:
The box persists on the chart, providing a contextual zone that traders can use as a dynamic support/resistance area.
🔹 Visual Representation
Transparent colored boxes highlight each session’s OR visually on the chart.
These boxes help traders easily identify whether price is trading:
Inside the OR
Breaking above the high (potential bullish continuation)
Breaking below the low (potential bearish continuation)
Application in Trading
🔍 Trading the Opening Range Breakout
Traders often use the OR high and low as breakout triggers. For example:
A price break above the OR high may signal bullish momentum.
A break below the OR low may signal bearish momentum.
⚖️ Support and Resistance
Even if breakouts fail, the OR can act as a pivot zone — offering areas for:
Stop placements
Target levels
Entry confirmations for fade trades or mean reversion strategies.
🕒 Session Awareness
By defining each hour’s OR individually (from 2:00 AM to 3:00 PM), traders can:
Analyze price behavior within each session.
Recognize when liquidity or volatility increases (e.g. around overlapping sessions like London open or New York open).
Summary
This Pine Script indicator provides a powerful framework for visualizing and trading hourly opening ranges. It enhances intraday analysis by:
Structuring price action within hourly boxes.
Highlighting key price levels relative to OHLC concepts.
Helping traders make more informed decisions by assessing price behavior around these critical ranges.
Not-So-Average True Range (nsATR)Not-So-Average True Range (nsATR)
*By Sherlock_MacGyver*
---
Long Story Short
The nsATR is a complete overhaul of traditional ATR analysis. It was designed to solve the fundamental issues with standard ATR, such as lag, lack of contextual awareness, and equal treatment of all volatility events.
Key innovations include:
* A smarter ATR that reacts dynamically when price movement exceeds normal expectations.
* Envelope zones that distinguish between moderate and extreme volatility conditions.
* A long-term ATR baseline that adds historical context to current readings.
* A compression detection system that flags when the market is coiled and ready to break out.
This indicator is designed for traders who want to see volatility the way it actually behaves — contextually, asymmetrically, and with predictive power.
---
What Is This Thing?
Standard ATR (Average True Range) has limitations:
* It smooths too slowly (using Wilder's RMA), which delays detection of meaningful moves.
* It lacks context — no way to know if current volatility is high or low relative to history.
* It treats all volatility equally, regardless of scale or significance.
nsATR** was built from scratch to overcome these weaknesses by applying:
* Amplification of large True Range spikes.
* Visual envelope zones for detecting volatility regimes.
* A long-term context line to anchor current readings.
* Multi-factor compression analysis to anticipate breakouts.
---
Core Features
1. Breach Detection with Amplification
When True Range exceeds a user-defined threshold (e.g., ATR × 1.2), it is amplified using a power function to reflect nonlinear volatility. This amplified value is then smoothed and cascades into future ATR values, affecting the indicator beyond a single bar.
2. Direction Tagging
Volatility spikes are tagged as upward or downward based on basic price momentum (close vs previous close). This provides visual context for how volatility is behaving in real-time.
3. Envelope Zones
Two adaptive envelopes highlight the current volatility regime:
* Stage 1: Moderate volatility (default: ATR × 1.5)
* Stage 2: Extreme volatility (default: ATR × 2.0)
Breaching these zones signals meaningful expansion in volatility.
4. Long-Term Context Baseline
A 200-period simple moving average of the classic ATR establishes whether current readings are above or below long-term volatility expectations.
5. Multi-Signal Compression Detection
Flags potential breakout conditions when:
* ATR is below its long-term baseline
* Price Bollinger Bands are compressed
* RSI Bollinger Bands are also compressed
All three signals must align to plot a "Volatility Confluence Dot" — an early warning of potential expansion.
---
Chart Outputs
In the Indicator Pane:
* Breach Amplified ATR (Orange line)
* Classic ATR baseline (White line)
* Long-Term context baseline (Cyan line)
* Stage 1 and Stage 2 Envelopes (Purple and Yellow lines)
On the Price Chart:
* Triangles for breach direction (green/red)
* Diamonds for compression zones
* Optional background coloring for visual clarity
---
Alerts
Built-in alert conditions:
1. ATR breach detected
2. Stage 1 envelope breached
3. Stage 2 envelope breached
4. Compression zone detected
---
Customization
All components are modular. Traders can adjust:
* Display toggles for each visual layer
* Colors and line widths
* Breach threshold and amplification power
* Envelope sensitivity
* Compression sensitivity and lookback windows
Some options are disabled by default to reduce clutter but can be turned on for more aggressive signal detection.
---
Real-Time Behavior (Non-Repainting Clarification)
The indicator updates in real time on the current bar as new data comes in. This is expected behavior for live trading tools. Once a bar closes, values do not change. In other words, the indicator *does not repaint history* — but the current bar can update dynamically until it closes.
---
Use Cases
* Day traders: Use compression zones to anticipate volatility surges.
* Swing traders: Use envelope breaches for regime awareness.
* System developers: Replace standard ATR in your logic for better responsiveness.
* Risk managers: Use directional volatility signals to better model exposure.
---
About the Developer
Sherlock_MacGyver develops original trading systems that question default assumptions and solve real trader problems.
♒Hurst Cycle Channel Oscillator v4.0 by IRUNTV
Hurst Cycle Channel Oscillator v4.0 by IRUNTV W/ Advanced Divergence
Short Title: HCCO_v4_IRUNTV
📜 Script Description
//Disclaimer//
* What could be considered a clone of Hurst Cycle Channel Oscillator v1.0 by Cryptorhythms with arguably some improvements, since the original was locked i opted to creating my own version with much more flexibility in mind. I also used the original Hurst Cycle Channels by Lazybear as foundation for some of my primary logic and intentionally made it visually identical to the already popular Cryptorhythms version.
// End Disclaimer //
Unlock deeper market insights with the Hurst Cycle Channel Oscillator v4.0 by IRUNTV , a sophisticated oscillator meticulously designed to visualize cyclical price movements and pinpoint potential turning points through an advanced divergence detection engine. This indicator is rooted in the foundational principles of J.M. Hurst's cycle theory, offering a nuanced view of market dynamics by illustrating how current price interacts with dynamic, Hurst-style cycle channels.
At its core, the Hurst Cycle Channel Oscillator v4.0 transforms complex cycle analysis into an intuitive oscillator format. It aims to go beyond simple overbought or oversold conditions, highlighting the inherent rhythm of the market. This can empower you to anticipate shifts in momentum and identify higher-probability trading setups with greater confidence.
This v4.0 features a significantly enhanced divergence engine capable of identifying both Regular and Hidden bullish/bearish divergences with improved accuracy and extensive user customization.
📊 What It Displays & How It Works
Main Oscillator (-F - White Line): This is your primary plot. It represents the normalized position of the selected Source price (default: close) within a dynamically calculated medium-term Hurst-style channel.
Values typically range from 0 (price at channel bottom) to 1 (price at channel top).
Values above 1.0 suggest price has broken robustly above the medium-term channel (potentially overbought or indicating strong bullish momentum).
Values below 0.0 suggest price has broken robustly below the medium-term channel (potentially oversold or indicating strong bearish momentum).
Signal Line (H F - Yellow Line): This line represents the normalized position of the short-term cycle's median within the same medium-term Hurst-style channel. It acts as a dynamic signal line, providing context to the Main Oscillator's movements.
Secondary Oscillator (L F - Aqua Line): Offers a longer-term or smoothed perspective, by default an EMA of the H F Signal Line. Its calculation method and length are configurable.
Dynamic Channels (Internal Calculation): The oscillator values are derived from channels constructed using Running Moving Averages (RMA) of price and Average True Range (ATR) for dynamic width. These calculations incorporate Hurst's concepts of half-span cycle lengths and forward displacement, aiming for a more adaptive and responsive market analysis.
Key Visual Cues:
Divergence Markers (R / H): Clearly marked on the oscillator.
R ( Regular Divergence ): Signals potential trend exhaustion and upcoming reversals.
Bullish (Green R): Price forms Lower Lows (LL) while the Main Oscillator (-F) forms Higher Lows (HL).
Bearish (Red R): Price forms Higher Highs (HH) while the Main Oscillator (-F) forms Lower Highs (LH).
H ( Hidden Divergence ): Signals potential trend continuations, often appearing during corrections.
Bullish (Green H): Price forms Higher Lows (HL) while the Main Oscillator (-F) forms Lower Lows (LL).
Bearish (Red H): Price forms Lower Highs (LH) while the Main Oscillator (-F) forms Higher Highs (HH).
Divergence Lines: Lines are automatically drawn on the oscillator connecting the two pivot points that form a confirmed divergence, providing clear visual confirmation of the pattern. A configurable maximum number of lines are displayed to maintain chart clarity.
Background Shading: The oscillator pane's background is dynamically colored to offer an at-a-glance indication of prevailing market sentiment or conditions:
Green Zones: Typically indicate bullish conditions or oscillator strength (e.g., above the mid-level or signal line).
Red Zones: Typically indicate bearish conditions or oscillator weakness.
(The script includes logic for granular shading based on user-configurable overbought/oversold warning levels and the 0.5 mid-level).
Reference Levels: Horizontal lines are plotted at 0.0, 0.5, and 1.0, along with user-configurable "Warning Levels" (defaulting to 0.2 and 0.8) to help define critical zones of interest and potential price reactions.
💡 How to Use It - Potential Strategies
The Hurst Cycle Channel Oscillator v4.0 is a versatile tool. Here are some ways it can be incorporated into your trading analysis:
Divergence Trading (Primary Use):
Regular Divergences (R): Identify these as leading indicators that an existing trend might be losing momentum and could be approaching a reversal. Always seek confirmation from other technical analysis tools or price action.
Hidden Divergences (H): These often occur during pullbacks or consolidations within an established trend, potentially signaling an opportune moment to enter in the direction of the primary trend.
Oscillator / Signal Line Crosses:
When the Main Oscillator (-F) crosses above the Signal Line (H F): Potential bullish signal or strengthening momentum.
When the Main Oscillator (-F) crosses below the Signal Line (H F): Potential bearish signal or weakening momentum.
Overbought / Oversold (OB/OS) Conditions:
Extreme Levels: osc_F > 1.0 (extreme overbought) or osc_F < 0.0 (extreme oversold) can highlight unsustainable price extensions, often preceding periods of consolidation or potential reversals.
Warning Levels: Utilize the configurable levels (e.g., 0.8 and 0.2 by default) as earlier indications of potential overbought or oversold conditions, allowing for proactive adjustments.
Mid-Level (0.5) Dynamics:
osc_F crossing above 0.5 can suggest a shift towards a more bullish market bias.
osc_F crossing below 0.5 can suggest a shift towards a more bearish market bias. The 0.5 level often acts as a dynamic support/resistance within the oscillator's range.
Trend Confirmation & Strength: The color of the background shading can serve as a quick visual guide to the dominant short-term market sentiment as interpreted by the oscillator's position and behavior.
⚙️ Key Features & Customization (by IRUNTV)
Adjustable Cycle Parameters: Fully customize the Short Term Cycle Length, Medium Term Cycle Length, and their respective Multipliers to tailor the indicator's responsiveness to different assets, volatility, and timeframes.
Customizable Source: Select your preferred input source (close, hl2, hlc3, etc.) for the core calculations.
Comprehensive Plot Customization: Toggle the visibility and personalize the colors and line styles for all major plotted elements (oscillators, signal lines, divergence markers) through an intuitive "Plot Visibility & Style" settings group.
Advanced Divergence Engine Settings:
Div Pivot Left/Right Lookback: Fine-tune the sensitivity of pivot point detection for divergences.
Max Bars Between Div Pivots: Define the maximum historical window for identifying valid divergence formations.
Max Stored Pivots for Divs: Optimize performance by managing the memory used for storing historical pivot data, while still enabling detection of relevant long-term divergences.
Max Div Lines to Show: Maintain chart clarity by controlling the number of concurrently displayed divergence lines.
Built-in Alerts: Stay informed with comprehensive, configurable alerts for:
Main Oscillator / Signal Line crosses.
All four identified types of Divergences (Regular Bullish/Bearish, Hidden Bullish/Bearish).
Oscillator crossing into user-defined Overbought/Oversold warning levels.
Oscillator breaching the extreme 0.0 or 1.0 channel boundaries.
⚠️ Disclaimer
The "Hurst Cycle Channel Oscillator v4.0 by IRUNTV" is provided for educational and informational purposes only and does not constitute financial advice or a recommendation to buy or sell any asset. Trading and investing in financial markets involve substantial risk of loss. Past performance is not indicative of future results. All users should conduct their own thorough research, backtesting, and due diligence before making any trading or investment decisions. Use this tool responsibly and as part of a comprehensive trading strategy. IRUNTV assumes no liability for any trading or investment decisions made based on this indicator.
Fibonacci PivotsCreates Golden Zones based off the Pivots Standard with Daily Timeframe
-updated version with selectable TF
Previous Highs & Lows (Customizable)Previous Highs & Lows (Customizable)
This Pine Script indicator displays horizontal lines and labels for high, low, and midpoint levels across multiple timeframes. The indicator plots levels from the following periods:
Today's session high, low, and midpoint
Yesterday's high, low, and midpoint
Current week's high, low, and midpoint
Last week's high, low, and midpoint
Last month's high, low, and midpoint
Last quarter's high, low, and midpoint
Last year's high, low, and midpoint
Features
Individual Controls: Each timeframe has separate toggles for showing/hiding high/low levels and midpoint levels.
Custom Colors: Independent color selection for lines and labels for each timeframe group.
Display Options:
Adjustable line width (1-5 pixels)
Variable label text size (tiny, small, normal, large, huge)
Configurable label offset positioning
Organization: Settings are grouped by timeframe in a logical sequence from most recent (today) to least recent (last year).
Display Logic: Lines span the current trading day only. Labels are positioned to the right of the price action. The indicator automatically removes previous drawings to prevent chart clutter.
NSE/BSE Derivative - Next Expiry Date With HolidaysNSE & BSE Expiry Tracker with Holiday Adjustments
This Pine Script is a TradingView indicator that helps traders monitor upcoming expiry dates for major Indian derivative contracts. It dynamically adjusts these expiry dates based on weekends and holidays, and highlights any expiry that falls on the current day.
⸻
Key Features
1. Tracks Expiry Dates for Major Contracts
The script calculates and displays the next expiry dates for the following instruments:
• NIFTY (weekly expiry every Thursday)
• BANKNIFTY, FINNIFTY, MIDCPNIFTY, NIFTYNXT50 (monthly expiry on the last Thursday of the month)
• SENSEX (weekly expiry every Tuesday)
• BANKEX and SENSEX 50 (monthly expiry on the last Tuesday of the month)
• Stocks in the F&O segment (monthly expiry on the last Thursday)
2. Holiday Awareness
Users can input a list of holiday dates in the format YYYY-MM-DD,YYYY-MM-DD,.... If any calculated expiry falls on one of these holidays or a weekend, the script automatically adjusts the expiry to the previous working day (Monday to Friday).
3. Customization Options
The user can:
• Choose the position of the expiry table on the chart (e.g. top right, bottom left).
• Select the font size for the expiry table.
• Enable or disable the table entirely (if implemented as an input toggle).
4. Visual Expiry Highlighting
If today is an expiry day for any instrument, the script highlights that instrument in the display. This makes it easy to spot significant expiry days, which are often associated with increased volatility and trading volume.
⸻
How It Works
• The script calculates the next expiry for each index using built-in date/time functions.
• For weekly expiries, it finds the next occurrence of the designated weekday.
• For monthly expiries, it finds the last Thursday or Tuesday of the month.
• Each expiry date is passed through a check to adjust for holidays or weekends.
• If today matches the adjusted expiry date, that row is visually emphasized.
⸻
Use Case
This script is ideal for traders who want a quick glance at which instruments are expiring soon — especially those managing options, futures, or expiry-based strategies.