Institutional PA EngineInstitutional Price Action Pine Script for TradingView
This script framework is for advanced traders seeking to automate and visually structure institutional trading concepts—Order Blocks (OB), Liquidity Sweeps, Volume Spikes, and Fair Value Gaps (FVG)—for pinpointing entries, stop-loss, and take-profit targets.
Core Strategy Concepts
• Order Blocks: Institutional order footprints to act as entry/retest zones.
• Liquidity Sweeps: Identifies stop-loss hunting by price spiking through swing highs/lows, then reversing.
• Volume Spikes: Confirms entries where institutional activity is likely.
• Fair Value Gaps: Untraded imbalanced zones, used as magnets for price targets or further entries.
Advance/Decline Line
Advanced Premium Magic Levels With Table and StrategyAdvanced Premium Magic Levels A Technical Reversal Indicator
Description:
The Premium Magic Levels 2025 script is a powerful technical analysis tool designed to identify potential price reversal zones in financial markets. This script utilizes key price levels derived from the previous close and calculated opponent strike lines to plot actionable levels where reversals are likely to occur.
The concept is built upon the principle that historical price levels often serve as critical decision zones for traders. By analyzing price action relative to these levels, the script offers valuable insights for both day traders and swing traders aiming to capitalize on market reversals.
Core Concept:
Previous Close Level:
The script takes the previous day's (or session’s) close price as a baseline. This level often acts as a magnet for price movements or a point of reaction due to its psychological importance.
Opponent Strike Lines:
These are calculated dynamic levels based on price behavior. They represent zones where the market is likely to encounter resistance or support, depending on whether the price is rising or falling.
Reversal Zones:
The plotted lines signify areas where price reversals are statistically probable. These levels act as critical reference points for traders to anticipate trend changes or confirm their trading strategies.
Key Features:
Dynamic Level Plotting:
The script automatically adjusts and updates the levels based on the latest price action, ensuring relevance across different timeframes.
Visual Guidance:
The script plots clear and distinguishable levels on the chart, providing an intuitive visual aid for identifying potential reversals.
Multi-Asset Compatibility:
Works seamlessly across various asset classes, including stocks, indices, forex, and cryptocurrencies.
Customizable Settings:
Users can adjust parameters to align the calculations with their trading style and strategy preferences.
How to Use:
Add the Script to Your Chart:
Apply the Premium Magic Levels 2025 script to your chart from the Pine Script editor or the trading platform's public library.
Identify Key Levels:
Observe the plotted levels for the session:
Previous Close Level: A baseline price level often retested or respected by the market.
Opponent Strike Lines: Zones indicating potential resistance or support where reversals might occur.
Incorporate with Trading Strategy:
Use the levels as reference points to set entry, exit, or stop-loss orders.
Combine the indicator with other technical tools (e.g., RSI, MACD, Moving Averages) for confirmation.
Monitor Price Action:
Watch how the price reacts around the plotted levels. A rejection or breakout at these levels often signals significant market moves.
Benefits of the Script:
Enhances decision-making by providing clear reversal zones.
Reduces the complexity of manual level plotting and analysis.
Adapts to different market conditions with dynamic updates.
Suitable for traders of all experience levels, from beginners to professionals.
Note:
While the Premium Magic Levels 2026 script is a robust analytical tool, it should be used in conjunction with proper risk management and other trading strategies. Past performance of these levels does not guarantee future results.
Turtle Trading System + ATR Trailing StopIndicator Description: Turtle ATR Trailing Stop
The **Turtle ATR Trailing Stop** is a technical indicator designed to enhance the classic Turtle Trading System by incorporating a dynamic trailing stop based on the Average True Range (ATR). This indicator is ideal for traders seeking to manage risk and lock in profits on both long and short positions in trending markets.
Key Features:
- Turtle Trading Levels: Calculates the 20-day highest high and lowest low to identify potential breakout points, a core principle of the Turtle Trading System.
- ATR-Based Trailing Stop: Utilizes a trailing stop that adjusts dynamically based on a multiple of the ATR (default multiplier: 2.0), providing a volatility-adjusted exit mechanism.
- Position Flexibility: Supports both long and short positions, with the trailing stop positioned below the highest price for long trades and above the lowest price for short trades.
- Smooth Updates: The trailing stop updates on each bar, ensuring a more responsive adjustment to price movements, rather than only on new highs or lows.
- Reset Mechanism: Automatically resets the trailing stop when the price deviates significantly (configurable threshold, default 0.1%), adapting to major trend reversals.
- Alerts: Includes customizable alerts that trigger when the price reaches the trailing stop level, notifying traders of potential exit points.
- Debugging Tools: Features an on-chart debug table displaying ATR, Close, Highest Price, Lowest Price, Potential Stop, and Trailing Stop values for real-time analysis.
How It Works:
- For **Long Positions**: The trailing stop starts below the initial close price (minus 2*ATR) and moves up as the highest price increases, locking in profits while trailing at a fixed ATR distance.
- For **Short Positions**: The trailing stop starts above the initial close price (plus 2*ATR) and moves down as the lowest price decreases, protecting against upward price movements.
- The stop resets if the price falls (for long) or rises (for short) beyond the set threshold, ensuring adaptability to new market conditions.
Customization:
- Period Settings: Adjust the length for highs/lows (default 20) and ATR period (default 14).
- ATR Multiplier: Modify the distance of the trailing stop (default 2.0).
- Reset Threshold: Fine-tune the percentage at which the stop resets (default 0.1%).
- Position Type: Switch between "Long" and "Short" modes via input settings.
Usage:
Apply this indicator to any chart in TradingView, set your preferred parameters, and monitor the trailing stop line (yellow) alongside the Turtle highs (red) and lows (blue). Use the debug table to validate calculations and set alerts to stay informed of stop triggers.
This indicator combines the trend-following strength of the Turtle System with a flexible, ATR-based stop-loss strategy, making it a powerful tool for both manual and automated trading strategies.
TrEx H/L Trendlines [ETPINVEST]TrEx H/L Trendlines - User Guide
🎯 WHAT IS THIS INDICATOR?
TrEx H/L Trendlines is a professional indicator for automatic search and display of price extremes with trendline construction.
🔍 WHAT IS IT USED FOR?
Main tasks:
Extreme identification - automatic search for significant price highs and lows
Trend analysis - building trendlines between found extremes
Reversal point detection - identifying potential zones of direction change
Structural analysis - understanding the internal structure of price movement
Who is it suitable for:
📈 Swing traders - for identifying key turning points
⚡ Day traders - for analyzing intraday structure
🎯 Scalpers - for precise local extreme identification
📊 Analysts - for structural market analysis
⚙️ HOW DOES THE ALGORITHM WORK?
1. Extreme search
The indicator uses a complex algorithm to find significant highs and lows through strictly defined candle combinations.
Validation - verification of compliance with strict mathematical conditions
2. Filtering and alternation
Found extremes undergo additional processing:
Selection of strongest - choosing the most significant extremes in each zone
Ensuring alternation - correct sequence of highs and lows
Time sorting - chronological ordering
3. Trendline construction
Based on filtered extremes, connecting lines are built:
Sequential connection - linking all extremes in order
Trend visualization - displaying overall movement direction
Structure analysis - understanding internal movement waves
🛠️ DETAILED SETTINGS DESCRIPTION
📊 Extremes
Show Extremes
Purpose: Enable/disable extreme display
Default: Enabled
Upper Extreme Color
Purpose: Color of upper extreme markers (highs)
Default: Red
Lower Extreme Color
Purpose: Color of lower extreme markers (lows)
Default: Green
Analysis Depth
Range: 50-300 bars
Default: 200
Purpose: Depth of historical analysis for extreme search
Timeframe recommendations:
- M1-M5: 100-150 bars
- M15-H1: 150-250 bars
- H4-D1: 200-300 bars
📈 Trendline
Show Trendline
Purpose: Enable/disable trendline display
Default: Enabled
Trendline Color
Purpose: Color of trendlines connecting extremes
Default: Yellow
Trendline Width
Range: 1-5 pixels
Default: 1
Purpose: Thickness of trendlines
📈 PRACTICAL USAGE TIPS
🎯 Trading strategies
1. Trading from extremes
✅ Buy signal:
Price approaches lower extreme (green marker)
Reversal pattern forms on lower timeframe
Confirmation by volume or other indicators
✅ Sell signal:
Price approaches upper extreme (red marker)
Reversal pattern forms on lower timeframe
Confirmation by additional signals
2. Trend structure analysis
✅ Uptrend:
Sequential higher highs and lows
Trendlines directed upward
Each new extreme higher than previous
✅ Downtrend:
Sequential lower highs and lows
Trendlines directed downward
Each new extreme lower than previous
3. Trend reversal identification
⚠️ Reversal signals:
Violation of extreme sequence
Change in trendline slope
Formation of divergences with oscillators
💡 Settings optimization
For scalping (M1-M5):
Analysis Depth: 100-150
Focus on fresh extremes
For day trading (M15-H1):
Analysis Depth: 150-200
Balance between history and relevance
For swing trading (H4-D1):
Analysis Depth: 200-300
Maximum analysis depth
🔍 Additional techniques
Combining with other tools:
Oscillators - finding divergences at extremes
TrEx S/R Levels - applying support and resistance levels
⚠️ IMPORTANT FEATURES
✅ Advantages:
Automation - no manual extreme search required
Mathematical precision - strict selection algorithms
Universality - works on any assets and timeframes
Ease of use - intuitive interface
Trend analysis - automatic structure construction
Real-time updates - on each candle close
⚠️ Limitations:
Requires history - needs minimum 50 bars for operation
Lag - extremes determined after their formation
🎯 CONCLUSION
TrEx H/L Trendlines is a powerful tool for automatic analysis of extremes and trend structure of the market. The indicator is perfect for studying price behavior and can serve as a foundation for developing trading strategies.
AD Line of S&P SectorsAdvance-Decline Line of S&P 500 Sectors
This indicator tracks the breadth strength of the S&P 500 by combining an unweighted Advance-Decline (A/D) Line and a market-cap weighted A/D Histogram across all 11 major S&P sectors.
Key Features
Sector A/D Histogram: Measures sector breadth based on whether each sector advanced or declined, then weights it by its current estimated market cap share.
Unweighted A/D Line: Smooth average of sectors equally weighted, giving an alternative breadth view that’s less biased by large sectors.
Top Weighted Stocks Tracker: Tracks the daily percentage change of the top 10 highest-weighted S&P 500 stocks, scaled by their index weights, and overlays them as a background area plot.
Zero Crossovers: Histogram and line crossing zero can help highlight broadening strength or weakness.
Customizable Sector Weights: Sector weights can be adjusted in the settings. It is recommended to review and update these periodically to reflect changes in S&P sector allocations.
Repaint Option: Uses a user-selectable repaint mode for flexible bar update logic.
How to Use
Trend Confirmation: When the weighted histogram and unweighted line are above zero together, it indicates broad sector strength; below zero suggests broad weakness.
Neutral Zone: Values between +0.5 and -0.5 (or your custom thresholds) may imply a ranging market or slower movement.
Top Names Context: The top-weighted stocks area shows how much the index’s largest components are pulling the market up or down, relative to the broader sector breadth.
⚠️ Disclaimer
This script is for educational and informational purposes only and does not constitute financial advice. Always do your own research and consult with a qualified financial professional before making trading decisions. Use at your own risk.
Niveaux Dealers + Previous M W D📊 TradingView Script – Dealers Levels & Previous D/W/M
🔹 General Purpose:
This advanced script provides a clear view of key market levels used by professional traders for scalping, day trading, and technical analysis. It combines manual levels (Dealer) set by the user with automated levels based on the previous day, week, and month’s highs and lows.
⸻
🧩 1. Dealers Levels Module (Manual)
✅ Features:
• Displays 28 customizable levels, grouped into 4 categories:
• Maxima: Buyer Control, Max Day, Max Event, Max Extreme
• Minima: Seller Control, Min Day, Min Event, Min Extreme
• Call Resistance: 10 user-defined levels
• Pull Support: 10 user-defined levels
🎨 Customization:
• Each level’s value is manually entered
• Line color, style, and thickness can be customized
• Display includes transparent labels with a clean design
🔧 Options:
• Line extension configurable:
• To the left: from 1 to 499 bars
• To the right: from 1 to 100 bars
• Label display can be toggled on/off
⸻
🧩 2. Previous Daily / Weekly / Monthly Levels Module (Automatic)
✅ Features:
• Automatically detects and plots:
• Previous Daily High / Low
• Previous Weekly High / Low
• Previous Monthly High / Low
🎯 Technical Details:
• Accurate calculation based on closed periods
• Dynamically extended lines (past and future projection)
• Labels aligned with the right-hand extension of each line
🎨 Customization:
• Each level has configurable color, line style, and thickness
• Labels use rectangle style with transparent background
⸻
⚙ Global Script Settings:
• Toggle display of labels (✔/❌)
• Configurable left extension (1–499) and right extension (1–100)
• Settings panel organized into groups for clarity and ease of use
⸻
💡 Usefulness:
This script provides traders with a precise map of price reaction zones, combining fixed institutional zones (Dealer levels) with dynamic historical levels (D/W/M). It’s ideal for intraday strategies on indices (e.g., Nasdaq), crypto, or forex markets.
Special Candle SetupThe Special Candle Setup Indicator is designed to detect significant bearish and bullish candlestick patterns , helping traders identify potential trend shifts and key price action setups . This indicator recognizes 8 bearish patterns and 6 bullish patterns , derived from multi-candlestick formations observed across different markets, including crypto, indices, forex, and stocks.
How It Works
This indicator scans the market for specific candlestick structures that indicate potential reversals or trend continuations . It includes:
• Bearish Patterns (8 types) : Identifies candlestick structures that suggest potential downside movement.
• Bullish Patterns (6 types) : Detects formations indicating upward momentum.
• Reversal Signals : Additional patterns that highlight key turning points in price action.
• Key Level Marking : Automatically draws support and resistance levels based on detected setups.
• Expiry Signals (Optional) : Highlights patterns commonly seen on expiry days in the Indian market, but these patterns are universally applicable to other asset classes as well.
Key Features
✔ Comprehensive Candlestick Pattern Recognition – Detects 14 key bullish and bearish formations.
✔ Reversal & Trend Continuation Setups – Helps identify both potential reversals and momentum-based entries.
✔ Automated Key Level Marking – Plots dynamic blue lines for key support and resistance zones.
✔ Customizable Pattern Selection – Allows users to enable/disable specific pattern types.
✔ Non-Repainting Signals – Ensures stability by maintaining signal integrity over time.
Customization Options
• Enable/Disable Specific Patterns – Users can disable main patterns or reversal patterns based on their preference, allowing them to focus on a single type of setup if needed.
• Key Level Customization – The blue lines represent critical price levels, drawn automatically based on identified patterns. These act as reference points for potential breakouts or reversals.
• Optional Expiry Signals – Includes patterns commonly observed on expiry days, primarily for the Indian market, but they also appear in global markets like crypto, forex, and indices.
How to Use
• Trend Trading – Use bullish and bearish patterns to identify entry points within an existing trend.
• Reversal Trading – Focus on reversal signals near key levels for potential market turnarounds.
• Key Level Validation – Utilize the blue lines to confirm important price zones.
• Customization – Tailor the indicator to your strategy by selecting only the patterns that align with your trading style.
Why This Combination?
This indicator blends multiple candlestick formations, ensuring a well-rounded approach to market analysis. The integration of expiry signals, reversal structures, and key level plotting makes it adaptable for various asset classes, not just expiry-based trading.
Why It’s Worth Using?
Manually spotting multiple candlestick setups can be time-consuming and subjective. This indicator automates the process, providing structured insights into market movements with clearly defined signals and key level plotting, making it valuable for traders across different markets.
RSI Multi Alert KrafturRSI Multi Alert Kraftur
Description
The "RSI Multi-Level Signals" indicator is designed to help traders identify potential buy and sell opportunities based on RSI (Relative Strength Index) crossings of multiple customizable levels. Unlike traditional RSI indicators that focus on single overbought/oversold thresholds (e.g., 70/30), this script stands out by offering four distinct buy and sell levels for enhanced flexibility and precision. It plots signals directly on the price chart and provides real-time alerts when RSI crosses these levels, making it a powerful tool for spotting entry and exit points.
Key Features
Multi-Level RSI: Configurable buy levels (e.g., 30, 25, 20, 15) and sell levels (e.g., 70, 75, 80, 85) to capture varying degrees of overbought and oversold conditions.
Visual Signals: Buy signals are marked with circles below the bars, and sell signals above the bars, each color-coded for easy identification.
Real-Time Alerts: Generates alerts once per bar when RSI crosses a level, with a filter to prevent duplicate signals during oscillations.
Customizable: Adjustable RSI length, timeframe, and level colors to suit different trading strategies.
Recommended Usage
This indicator is best used as a scanning tool for finding entry points across multiple assets. Set up alerts for your entire watchlist of coins or stocks to detect when RSI crosses the configured levels in real time. It’s particularly effective in volatile markets or for traders employing multi-timeframe analysis. Combine it with other indicators (e.g., support/resistance or trend filters) to confirm signals and improve accuracy.
How to Use
Apply the indicator to your chart.
Customize the RSI length, timeframe, and signal levels to match your trading style.
Set up alerts for the indicator and apply them to your watchlist of assets.
Monitor the chart for buy (green) and sell (red) signals, or rely on alert notifications.
Perfect for scalpers, swing traders, or anyone looking to automate signal detection across a portfolio!
Auto Fibonacci LinesThis TradingView script is a modded version of the library called "VisibleChart" created by Pinecoder.
This version has the option for users to change the Fibonacci lines and price labels. This makes the script user-friendly.
Fibonacci extensions are a tool that traders can use to establish profit targets or estimate how far a price may travel after a retracement/pullback is finished. Extension levels are also possible areas where the price may reverse. This study automatically draws horizontal lines that are used to determine possible support and resistance levels.
It's designed to automatically plot Fibonacci retracement levels on chart, aiding in technical analysis for traders.
First, the highest and lowest bars on the chart are calculated. These values are used for Fibonacci extensions.
These values update as traders scroll or zoom their charts, this shows that it is a useful indicator that can dynamically calculate and draw visuals on visible bars only.
ADVDEC.US OSCILLATORThis Pine Script implements an ADVDEC.US Oscillator, which is an indicator designed to analyze the Advance-Decline index (ADVDEC.US) with multiple smoothing techniques and timeframes. Here's what the script does:
Symbol and Inputs:
- The script is based on the ADVDEC.US index, which measures the difference between advancing and declining stocks.
Users can adjust several settings:
- Lookback Period: Defines the number of periods over which the highest and lowest values of the ADVDEC.US index are calculated.
- Smoothing Period: Smooths the oscillator with a simple moving average (SMA) to reduce market noise.
- EMA Period: Applies an Exponential Moving Average (EMA) to the smoothed oscillator for further trend analysis.
- MTF Period: Allows for fetching data from a specified timeframe (default is 5 minutes).
Calculation:
- It calculates the highest and lowest values of the ADVDEC index over the defined lookback period.
- It normalizes the ADVDEC value into a percentage between 0 and 100, representing the position of the current value relative to the range over the lookback period.
- This raw oscillator is then smoothed with an SMA to reduce choppiness.
- Finally, an EMA is calculated on the smoothed oscillator to emphasize the trend direction.
Thresholds:
- Horizontal lines are plotted at key levels (70, 30, and 50) for visual reference, offering an "RSI-style" interpretation of the oscillator.
- The upper and lower thresholds can indicate overbought/oversold conditions, while the midline helps identify neutral levels.
Visualization:
- The smoothed oscillator is plotted in blue.
- The EMA of the smoothed oscillator is plotted in orange.
In summary, this indicator aims to visualize the relationship between advancing and declining stocks with added smoothing and trend-following elements, providing an easy-to-interpret oscillator that can be used for market analysis or decision-making.
GapAura: Dynamic Gap [AstroHub]GapAura is a powerful indicator designed to analyze and visualize price gaps on your charts. It focuses on the key levels created by gaps between the open of the current day and the close of the previous day. The indicator connects these gap levels with trend-like lines, allowing traders to easily identify significant price movements and potential turning points in the market.
GapCloud automatically differentiates between upward and downward gaps, helping traders visualize important support and resistance levels that emerge following these gaps. The lines representing these gaps behave like trend lines, providing clear and actionable insights for market analysis. Unlike traditional gap indicators, GapCloud offers a dynamic approach to gap visualization, making it easier for traders to assess the impact of price gaps on future market movement.
How to Use:
Gap Up: When the open of the current day is higher than the close of the previous day, GapCloud draws a line connecting these two levels. This visualizes the gap upward and helps identify the trend direction, as well as potential support zones.
Gap Down: When the open of the current day is lower than the close of the previous day, the indicator draws a line that connects these levels, showing a downward gap. This can highlight potential resistance levels.
The lines for each gap are connected to form continuous trend-like levels, giving traders a clear picture of market structure. These lines can also be used to identify areas of strong support or resistance, and potential turning points where the price may reverse or continue in the same direction.
What Makes This Indicator Unique:
GapCloud stands out by transforming gaps into trend-like lines, offering more than just a simple visualization of the gap itself. By connecting the open and close levels of the current and previous day, it allows traders to see how these price differences can act as significant support or resistance levels. These lines help traders spot market trends and potential reversals more clearly, giving them an edge in making more informed trading decisions.
The ability to visualize gaps as trend lines gives traders a unique advantage in understanding market behavior. Gaps are not just seen as isolated events; they are integrated into the overall market structure and can provide critical insights into the potential price direction.
In addition to this, GapCloud offers a high degree of customization. Users can adjust the thickness, style, and color of the gap lines to fit their trading preferences and style. This makes the indicator adaptable to various types of trading strategies, from short-term to long-term analysis.
Key Features:
Identifies and visualizes gaps between the open of the current day and the close of the previous day.
Converts gap levels into trend-like lines, providing clarity and actionable insights for traders.
Helps identify potential support and resistance levels based on gap locations.
Fully customizable settings, including line thickness, style, and color, to suit individual trading preferences.
Provides a dynamic approach to gap analysis, helping traders forecast market direction and potential reversals with greater accuracy.
GapCloud is an essential tool for any trader looking to enhance their market analysis. By visualizing price gaps as connected trend lines, it simplifies the process of identifying key levels and market structure, giving traders an edge in understanding price movements and making more informed decisions.
McClellan A-D Volume Integration ModelThe strategy integrates the McClellan A-D Oscillator with an adjustment based on the Advance/Decline (A-D) volume data. The McClellan Oscillator is calculated by taking the difference between the short-term and long-term exponential moving averages (EMAs) of the A-D line. This strategy introduces an enhancement where the A-D volume (the difference between the advancing and declining volume) is factored in to adjust the oscillator value.
Inputs:
• ema_short_length: The length for the short-term EMA of the A-D line.
• ema_long_length: The length for the long-term EMA of the A-D line.
• osc_threshold_long: The threshold below which the oscillator must drop for an entry signal to trigger.
• exit_periods: The number of periods after which the position is closed.
• Data Sources:
• ad_advance and ad_decline are the data sources for advancing and declining issues, respectively.
• vol_advance and vol_decline are the volume data for the advancing and declining issues. If volume data is unavailable, it defaults to na (Not Available), and the fallback logic ensures that the strategy continues to function.
McClellan Oscillator with Volume Adjustment:
• The A-D line is calculated by subtracting the declining issues from the advancing issues. Then, the volume difference is applied to this line, creating a “weighted” A-D line.
• The short and long EMAs are calculated for the weighted A-D line to generate the McClellan Oscillator.
Entry Condition:
• The strategy looks for a reversal signal, where the oscillator falls below the threshold and then rises above it again. The condition is designed to trigger a long position when this reversal happens.
Exit Condition:
• The position is closed after a set number of periods (exit_periods) have passed since the entry.
Plotting:
• The McClellan Oscillator and the threshold are plotted on the chart for visual reference.
• Entry and exit signals are highlighted with background colors to make the signals more visible.
Scientific Background:
The McClellan A-D Oscillator is a popular market breadth indicator developed by Sherman and Marian McClellan. It is used to gauge the underlying strength of a market by analyzing the difference between the number of advancing and declining stocks. The oscillator is typically calculated using exponential moving averages (EMAs) of the A-D line, with the idea being that crossovers of these EMAs indicate potential changes in the market’s direction.
The integration of A-D volume into this model adds another layer of analysis, as volume is often considered a leading indicator of price movement. By factoring in volume, the strategy becomes more sensitive to not just the number of advancing or declining stocks but also how significant those movements are based on trading volume, as discussed in Schwager, J. D. (1999). Technical Analysis of the Financial Markets. This enhanced version aims to capture stronger and more sustainable trends in the market, helping to filter out false signals.
Additionally, volume analysis is often used to confirm price movements, as described in Wyckoff, R. (1931). The Day Trading System. Therefore, incorporating the volume of advancing and declining stocks in the McClellan Oscillator offers a more robust signal for trading decisions.
Cryptocurrency SentimentOverview
This script focuses on calculating and visualizing the sentiment difference between LONG positions and SHORT positions for a selected cryptocurrency pair on the Bitfinex exchange. It provides a clean and clear visual representation of the sentiment, helping traders analyze market behavior.
Key Features
Dynamic Symbol Selection:
The script automatically detects the cryptocurrency symbol from the chart (syminfo.basecurrency) and dynamically constructs the LONGS and SHORTS ticker symbols.
Works seamlessly for pairs like BTCUSD, ETHUSD, and others available on Bitfinex.
Sentiment Calculation:
The sentiment difference is calculated as:
Sentiment Difference=−1×(100− SHORTS/LONGS ×100)
LONGS : The total number of long positions.
SHORTS : The total number of short positions.
If SHORTS is 0, the value is safely skipped to avoid division errors.
Color Coding:
The script visually highlights the sentiment difference:
Green Line: Indicates that LONG positions are dominant (bullish sentiment).
Red Line: Indicates that SHORT positions are dominant (bearish sentiment).
Zero Reference Line:
A gray horizontal line at 0 helps users quickly identify the transition between bullish (above zero) and bearish (below zero) sentiment.
How It Works
Fetching Data:
The script uses request.security to fetch LONGS and SHORTS data at the current chart timeframe (timeframe.period) for the dynamically generated Bitfinex tickers.
Handling Data:
Missing or invalid data (NaN) is filtered out to prevent errors.
Extreme spikes or irregular values are safely avoided.
Visualization:
The sentiment difference is plotted with dynamic color coding:
Green when LONGS > SHORTS (bullish sentiment).
Red when SHORTS > LONGS (bearish sentiment).
Benefits
Market Sentiment Insight: Helps traders quickly identify if the market is leaning towards bullish or bearish sentiment based on actual LONG and SHORT position data.
Dynamic and Adaptive: Automatically adjusts to the selected cryptocurrency symbol on the chart.
Clean Visualization: Focuses solely on sentiment difference with color-coded signals, making it easy to interpret.
Best Use Cases
Trend Confirmation: Use the sentiment difference to confirm trends during bullish or bearish moves.
Market Reversals: Identify potential reversals when sentiment shifts from positive (green) to negative (red) or vice versa.
Sentiment Monitoring: Monitor the overall market bias for cryptocurrencies like BTC, ETH, XRP, etc., in real-time.
Sample Chart Output
Above Zero → Green Line: Bullish sentiment dominates.
Below Zero → Red Line: Bearish sentiment dominates.
Zero Line → Transition point for shifts in sentiment.
Open to High/Low % Movementto track the movement of open to low and open to high in % terms, please create a trading view pine script which can plot this movement in a separate chart
Triple VWAP# Triple VWAP Indicator
## Description
The Triple VWAP Indicator is a powerful tool for traders who rely on Volume Weighted Average Price (VWAP) in their analysis. This indicator displays three VWAP lines on a single chart, each representing a different time frame: Session, Weekly, and Monthly.
## Features
- Session VWAP (Blue Line): Resets daily, providing intraday volume-weighted average price.
- Weekly VWAP (Green Line): Resets weekly, offering a medium-term perspective.
- Monthly VWAP (Red Line): Resets monthly, giving a longer-term view of price action relative to volume.
## How It Works
The indicator calculates the VWAP for each time frame separately, using the specified price source (default is HLC3). It then plots these values on your chart, allowing you to see how the current price compares to the volume-weighted average across different time periods.
## Use Cases
- Multi-timeframe Analysis: Compare short-term price movements against longer-term trends.
- Support and Resistance: VWAP lines often act as dynamic support/resistance levels.
- Mean Reversion: Identify potential overbought or oversold conditions when price deviates significantly from VWAP.
- Trend Confirmation: Use multiple VWAP lines to confirm trend strength and potential reversals.
## Customization
Users can customize the indicator by changing the price source and offset in the settings. The color and thickness of each VWAP line can also be adjusted in the code for personal preference.
## Note
This indicator is most effective on intraday charts but can provide valuable insights on any time frame. Remember that VWAP is typically most relevant for institutional traders on a session-by-session basis.
Enhance your trading strategy with the Triple VWAP Indicator – a versatile tool for comprehensive price-volume analysis across multiple time frames.
HSI 15 MAS A/D LineHSI 15 MAS A/D Line
This script calculates the Advance-Decline Line (AD Line) for the top 15 most active stocks within the Hang Seng Index, representing a significant 65.82% of the index's total weight. The AD Line is a crucial breadth indicator, measuring the difference between the number of advancing and declining stocks within the selected 15 constituents. By tracking this cumulative difference over time, the AD Line provides insights into market trends and potential reversals, reflecting the underlying strength or weakness of the market.
Features :
Top 15 Constituents : The script focuses on the 15 most influential stocks based on their weight in the Hang Seng Index, ensuring that the analysis is concentrated on the stocks that most impact the index's movements.
Advance-Decline Calculation : The script calculates whether each stock in the list is advancing or declining on a given day and then sums these values to create the AD Line.
Cumulative Indicator : The AD Line is plotted as a cumulative indicator, providing a clear visual representation of the overall market trend based on the breadth of advancing versus declining stocks.
How It Works :
Symbol Input : The script uses TradingView's `request.security` function to pull data for each of the 15 stocks.
Calculation of Advances and Declines : For each stock, the script determines whether it is advancing or declining compared to the previous day’s closing price.
Cumulative Sum : The script then cumulatively sums the number of advancing stocks minus the declining ones to plot the AD Line.
Use Case :
This AD Line is useful for traders and analysts who want to gauge the strength of the market trend beyond just price movement, by analyzing how many stocks are participating in the trend. It's particularly effective in confirming or questioning the sustainability of a trend, making it a valuable tool in both bullish and bearish market conditions.
Important Notes :
Ensure that the 15 selected stocks represent a diverse cross-section of sectors within the Hang Seng Index for a more accurate reflection of the market’s overall health.
The AD Line should be used in conjunction with other technical indicators to make more informed trading decisions.
Murrey Math
The Murrey Math indicator is a set of horizontal price levels, calculated from an algorithm developed by stock trader T.J. Murray.
The main concept behind Murrey Math is that prices tend to react and rotate at specific price levels. These levels are calculated by dividing the price range into fixed segments called "ranges", usually using a number of 8, 16, 32, 64, 128 or 256.
Murrey Math levels are calculated as follows:
1. A particular price range is taken, for example, 128.
2. Divide the current price by the range (128 in this example).
3. The result is rounded to the nearest whole number.
4. Multiply that whole number by the original range (128).
This results in the Murrey Math level closest to the current price. More Murrey levels are calculated and drawn by adding and subtracting multiples of the range to the initially calculated level.
Traders use Murrey Math levels as areas of possible support and resistance as it is believed that prices tend to react and pivot at these levels. They are also used to identify price patterns and possible entry and exit points in trading.
The Murrey Math indicator itself simply calculates and draws these horizontal levels on the price chart, allowing traders to easily visualize them and use them in their technical analysis.
HOW TO USE THIS INDICATOR?
To use the Murrey Math indicator effectively, here are some tips:
1. Choose the appropriate Murrey Math range : The Murrey Math range input (128 by default in the provided code) determines the spacing between the levels. Common ranges used are 8, 16, 32, 64, 128, and 256. A smaller range will give you more levels, while a larger range will give you fewer levels. Choose a range that suits the volatility and trading timeframe you're working with.
2. Identify potential support and resistance levels: The horizontal lines drawn by the indicator represent potential support and resistance levels based on the Murrey Math calculation. Prices often react or reverse at these levels, so they can be used to spot areas of interest for entries and exits.
3. Look for price reactions at the levels: Watch for price action like rejections, bounces, or breakouts at the Murrey Math levels. These reactions can signal potential trend continuation or reversal setups.
4. Trail stop-loss orders: You can place stop-loss orders just below/above the nearest Murrey Math level to manage risk if the price moves against your trade.
5. Set targets at future levels: Project potential profit targets by looking at upcoming Murrey Math levels in the direction of the trend.
7. Adjust range as needed: If prices are consistently breaking through levels without reacting, try adjusting the range input to a different value to see if it provides better levels.
In which asset can this indicator perform better?
The Murrey Math indicator can potentially perform well on any liquid financial asset that exhibits some degree of mean-reversion or trading range behavior. However, it may be more suitable for certain asset classes or trading timeframes than others.
Here are some assets and scenarios where the Murrey Math indicator can potentially perform better:
1. Forex Markets: The foreign exchange market is known for its ranging and mean-reverting nature, especially on higher timeframes like the daily or weekly charts. The Murrey Math levels can help identify potential support and resistance levels within these trading ranges.
2. Futures Markets: Futures contracts, such as those for commodities (e.g., crude oil, gold, etc.) or equity indices, often exhibit trading ranges and mean-reversion trends. The Murrey Math indicator can be useful in identifying potential turning points within these ranges.
3. Stocks with Range-bound Behavior: Some stocks, particularly those of large-cap companies, can trade within well-defined ranges for extended periods. The Murrey Math levels can help identify the boundaries of these ranges and potential reversal points.
4. I ntraday Trading: The Murrey Math indicator may be more effective on lower timeframes (e.g., 1-hour, 30-minute, 15-minute) for intraday trading, as prices tend to respect support and resistance levels more closely within shorter time periods.
5. Trending Markets: While the Murrey Math indicator is primarily designed for range-bound markets, it can also be used in trending markets to identify potential pullback or continuation levels.
Market Internals & InfoThis script provides various information on Market Internals and other related info. It was a part of the Daily Levels script but that script was getting very large so I decided to separate this piece of it into its own indicator. I plan on adding some additional features in the near future so stay tuned for those!
The script provides customizability to show certain market internals, tickers, and even Market Profile TPO periods.
Here is a summary of each setting:
NASDAQ and NYSE Breadth Ratio
- Ratio between Up Volume and Down Volume for NASDAQ and NYSE markets. This can help inform about the type of volume flowing in and out of these exchanges.
Advance/Decline Line (ADL)
The ADL focuses specifically on the number of advancing and declining stocks within an index, without considering their trading volume.
Here's how the ADL works:
It tracks the daily difference between the number of stocks that are up in price (advancing) and the number of stocks that are down in price (declining) within a particular index.
The ADL is a cumulative measure, meaning each day's difference is added to the previous day's total.
If there are more advancing stocks, the ADL goes up.
If there are more declining stocks, the ADL goes down.
By analyzing the ADL, investors can get a sense of how many stocks are participating in a market move.
Here's what the ADL can tell you:
Confirmation of Trends: When the ADL moves in the same direction as the underlying index (e.g., ADL rising with a rising index), it suggests broad participation in the trend and potentially stronger momentum.
Divergence: If the ADL diverges from the index (e.g., ADL falling while the index is rising), it can be a warning sign. This suggests that fewer stocks are participating in the rally, which could indicate a weakening trend.
Keep in mind:
The ADL is a backward-looking indicator, reflecting past market activity.
It's often used in conjunction with other technical indicators for a more complete picture.
TRIN Arms Index
The TRIN index, also called the Arms Index or Short-Term Trading Index, is a technical analysis tool used in the stock market to gauge market breadth and sentiment. It essentially compares the number of advancing stocks (gaining in price) to declining stocks (losing price) along with their trading volume.
Here's how to interpret the TRIN:
High TRIN (above 1.0): This indicates a weak market where declining stocks and their volume are dominating the market. It can be a sign of a potential downward trend.
Low TRIN (below 1.0): This suggests a strong market where advancing stocks and their volume are in control. It can be a sign of a potential upward trend.
TRIN around 1.0: This represents a more balanced market, where it's difficult to say which direction the market might be headed.
Important points to remember about TRIN:
It's a short-term indicator, primarily used for intraday trading decisions.
It should be used in conjunction with other technical indicators for a more comprehensive market analysis. High or low TRIN readings don't guarantee future price movements.
VIX/VXN
VIX and VXN are both indexes created by the Chicago Board Options Exchange (CBOE) to measure market volatility. They differ based on the underlying index they track:
VIX (Cboe Volatility Index): This is the more well-known index and is considered the "fear gauge" of the stock market. It reflects the market's expectation of volatility in the S&P 500 index over the next 30 days.
VXN (Cboe Nasdaq Volatility Index): This is a counterpart to the VIX, but instead gauges volatility expectations for the Nasdaq 100 index over the coming 30 days. The tech-heavy Nasdaq can sometimes diverge from the broader market represented by the S&P 500, hence the need for a separate volatility measure.
Both VIX and VXN are calculated based on the implied volatilities of options contracts listed on their respective indexes. Here's a general interpretation:
High VIX/VXN: Indicates a high level of fear or uncertainty in the market, suggesting investors expect significant price fluctuations in the near future.
Low VIX/VXN: Suggests a more complacent market with lower expectations of volatility.
Important points to remember about VIX and VXN:
They are forward-looking indicators, reflecting market sentiment about future volatility, not necessarily current market conditions.
High VIX/VXN readings don't guarantee a market crash, and low readings don't guarantee smooth sailing.
These indexes are often used by investors to make decisions about portfolio allocation and hedging strategies.
Inside/Outside Day
This provides a quick indication of it we are still trading inside or outside of yesterdays range and will show "Inside Day" or "Outside Day" based upon todays range vs. yesterday's range.
Custom Ticker Choices
Ability to add up to 5 other tickers that can be tracked within the table
Show Market Profile TPO
This only shows on timeframes less than 30m. It will show both the current TPO period and the remaining time within that period.
Table Customization
Provided drop downs to change the text size and also the location of the table.
Auto Fibonacci Retracement // Atilla YurtsevenOverview:
This Pine Script™ is a specialized tool for traders, designed to automatically plot Fibonacci retracement levels over a user-defined date range in trading charts. It also indicates the extent of price retracement within these levels.
Key Features:
Date Range Customization: Users can specify the start and end dates to focus the analysis on a particular trading period.
Dynamic Fibonacci Levels: The script includes various Fibonacci ratios (0.0, 0.236, 0.382, 0.5, 0.618, 0.786, 1.0), with the flexibility to enable or disable individual levels.
Visual Customization: Each Fibonacci level can be customized for color and line style (solid, dotted, dashed). Labels for each level are also configurable.
Retracement Measurement: The script not only draws the Fibonacci levels but also measures and displays how much the price has retraced within these levels.
Extension and Additional Options: Users have options to extend the Fibonacci lines and additional features such as using close values, trend drawing, date range display, and more.
Technical Insights:
The script identifies high and low values within the selected time frame, assessing the market's trend direction.
Within the specified date range, this script effortlessly plots the Fibonacci levels automatically, bringing clarity and precision to your market analysis as it unfolds.
The tool's adaptability makes it suitable for various trading styles and chart preferences.
Intended Use:
This script is particularly valuable for technical analysts and traders who use Fibonacci retracements to identify potential support and resistance areas and understand the depth of market corrections or rallies.
Disclaimer:
This Pine Script™ is offered 'as is', without any guarantees or warranties. It is intended for informational purposes and should not be taken as investment advice. Atilla Yurtseven, the creator of this script, assumes no responsibility for any financial losses or gains that may result from its usage. Users should perform their own due diligence and consult with professional advisors before making any investment decisions.
Remember to follow and comment!
Trade smart, stay safe
Atilla Yurtseven
NYSE & NASDAQ Advance Minus Decline OscillatorThis indicator is meant to observe NYSE & NASDAQ Advance minus Decline Oscillator in one. It also paints extreme levels at +2000 and -2000. It is used in combination to identify changes across the two markets or to observe broad market strength/weakness.
Deemer Breakaway Momentum ThrustBreakaway momentum is a "breadth thrust" coined by Walter Deemer in the 1970s that occurs when the ten-day total advances on the NYSE are greater than 1.97 times the ten-day total NYSE declines.
This indicator calculates the ratio and plots it as a histogram. The 1.97 threshold is also plotted as a horizontal line. Anytime the histogram gets above the line Breakaway Momentum has occurred.
This is a rare signal that has only happened 25 times since 1945.
(CM|DB) Caruso Market DashboardThe Caruso Market Dashboard (CM|DB) provides a snapshot of key US market data, market internals (breadth), and economic statistics. It displays real-time prices of seven major markets along with daily updates of the put/call ratio and multiple breadth measurements. Lastly, it displays the Federal Reserve’s balance sheet and 4-week change of assets held to help investors keep abreast of important FED changes in policy.
Presented for both the Nasdaq and NYSE composites and updated at the end of each trading day, the market breadth section shows:
· the number of net 52-week highs and lows
· the actual number of new 52-week highs and 52-week lows.
· The percentage of volume traded on up stocks vs. total volume
· The percentage of stocks advancing vs. all stocks
· Percentage of stocks above their 5-day average
· Percentage of stocks above their 50-day average
· Percentage of stocks above their 200-day average
In addition to presenting all of this valuable information in a table, users can hide the table and plot each market and economic data point. This is very helpful when viewing trends as well as overbought and oversold levels for these data points.