Indian Market Price LevelsScript to mark levels in Indian market to look for levels in market that including supports and resistance in the market
Kitaran
3 KZ w/ DSTScript is based on the guide from www.tradingcode.net
I have added and aligned multiple User input, formating, timezones and DST options for Japan, Berlin, London and New York.
I have created it to make my back testing easier without needing to think about DST changes.
If anybody have an good idea on how to place session name and day above each session (like in "MKT Session"). Please let me know. Plan is to added it eventually.
Feel free to reuse and please give a heads-up if You add additional cool features.
Kind regards
Bjørn Voss
Quarterly Theory ICT 04 [TradingFinder] SSMT 4Quarter Divergence🔵 Introduction
Sequential SMT Divergence is an advanced price-action-based analytical technique rooted in the ICT (Inner Circle Trader) methodology. Its primary objective is to identify early-stage divergences between correlated assets within precise time structures. This tool not only breaks down market structure but also enables traders to detect engineered liquidity traps before the market reacts.
In simple terms, SMT (Smart Money Technique) occurs when two correlated assets—such as indices (ES and NQ), currency pairs (EURUSD and GBPUSD), or commodities (Gold and Silver)—exhibit different reactions at key price levels (swing highs or lows). This lack of alignment is often a sign of smart money manipulation and signals a lack of confirmation in the ongoing trend—hinting at an imminent reversal or at least a pause in momentum.
In its Sequential form, SMT divergences are examined through a more granular temporal lens—between intraday quarters (Q1 through Q4). When SMT appears at the transition from one quarter to another (e.g., Q1 to Q2 or Q3 to Q4), the signal becomes significantly more powerful, often aligning with a critical phase in the Quarterly Theory—a framework that segments market behavior into four distinct phases: Accumulation, Manipulation, Distribution, and Reversal/Continuation.
For instance, a Bullish SMT forms when one asset prints a new low while its correlated counterpart fails to break the corresponding low from the previous quarter. This usually indicates absorption of selling pressure and the beginning of accumulation by smart money. Conversely, a Bearish SMT arises when one asset makes a higher high, but the second asset fails to confirm, signaling distribution or a fake-out before a decline.
However, SMT alone is not enough. To confirm a true Market Structure Break (MSB), the appearance of a Precision Swing Point (PSP) is essential—a specific candlestick formation on a lower timeframe (typically 5 to 15 minutes) that reveals the entry of institutional participants. The combination of SMT and PSP provides a more accurate entry point and better understanding of premium and discount zones.
The Sequential SMT Indicator, introduced in this article, dynamically scans charts for such divergence patterns across multiple sessions. It is applicable to various markets including Forex, crypto, commodities, and indices, and shows particularly strong performance during mid-week sessions (Wednesdays and Thursdays)—when most weekly highs and lows tend to form.
Bullish Sequential SMT :
Bearish Sequential SMT :
🔵 How to Use
The Sequential SMT (SSMT) indicator is designed to detect time and structure-based divergences between two correlated assets. This divergence occurs when both assets print a similar swing (high or low) in the previous quarter (e.g., Q3), but in the current quarter (e.g., Q4), only one asset manages to break that swing level—while the other fails to reach it.
This temporal mismatch is precisely identified by the SSMT indicator and often signals smart money activity, a market phase transition, or even the presence of an engineered liquidity trap. The signal becomes especially powerful when paired with a Precision Swing Point (PSP)—a confirming candle on lower timeframes (5m–15m) that typically indicates a market structure break (MSB) and the entry of smart liquidity.
🟣 Bullish Sequential SMT
In the previous quarter, both assets form a similar swing low.
In the current quarter, one asset (e.g., EURUSD) breaks that low and trades below it.
The other asset (e.g., GBPUSD) fails to reach the same low, preserving the structure.
This time-based divergence reflects declining selling pressure, potential absorption, and often marks the end of a manipulation phase and the start of accumulation. If confirmed by a bullish PSP candle, it offers a strong long opportunity, with stop-losses defined just below the swing low.
🟣 Bearish Sequential SMT
In the previous quarter, both assets form a similar swing high.
In the current quarter, one asset (e.g., NQ) breaks above that high.
The other asset (e.g., ES) fails to reach that high, remaining below it.
This type of divergence signals weakening bullish momentum and the likelihood of distribution or a fake-out before a price drop. When followed by a bearish PSP candle, it sets up a strong shorting opportunity with targets in the discount zone and protective stops placed above the swing high.
🔵 Settings
⚙️ Logical Settings
Quarterly Cycles Type : Select the time segmentation method for SMT analysis.
Available modes include: Yearly, Monthly, Weekly, Daily, 90 Minute, and Micro.
These define how the indicator divides market time into Q1–Q4 cycles.
Symbol : Choose the secondary asset to compare with the main chart asset (e.g., XAUUSD, US100, GBPUSD).
Pivot Period : Sets the sensitivity of the pivot detection algorithm. A smaller value increases responsiveness to price swings.
Activate Max Pivot Back : When enabled, limits the maximum number of past pivots to be considered for divergence detection.
Max Pivot Back Length : Defines how many past pivots can be used (if the above toggle is active).
Pivot Sync Threshold : The maximum allowed difference (in bars) between pivots of the two assets for them to be compared.
Validity Pivot Length : Defines the time window (in bars) during which a divergence remains valid before it's considered outdated.
🎨 Display Settings
Show Cycle :Toggles the visual display of the current Quarter (Q1 to Q4) based on the selected time segmentation
Show Cycle Label : Shows the name (e.g., "Q2") of each detected Quarter on the chart.
Show Bullish SMT Line : Draws a line connecting the bullish divergence points.
Show Bullish SMT Label : Displays a label on the chart when a bullish divergence is detected.
Bullish Color : Sets the color for bullish SMT markers (label, shape, and line).
Show Bearish SMT Line : Draws a line for bearish divergence.
Show Bearish SMT Label : Displays a label when a bearish SMT divergence is found.
Bearish Color : Sets the color for bearish SMT visual elements.
🔔 Alert Settings
Alert Name : Custom name for the alert messages (used in TradingView’s alert system).
Message Frequency :
All: Every signal triggers an alert.
Once Per Bar: Alerts once per bar regardless of how many signals occur.
Per Bar Close: Only triggers when the bar closes and the signal still exists.
Time Zone Display : Choose the time zone in which alert timestamps are displayed (e.g., UTC).
Bullish SMT Divergence Alert : Enable/disable alerts specifically for bullish signals.
Bearish SMT Divergence Alert : Enable/disable alerts specifically for bearish signals
🔵 Conclusion
The Sequential SMT (SSMT) indicator is a powerful and precise tool for identifying structural divergences between correlated assets within a time-based framework. Unlike traditional divergence models that rely solely on sequential pivot comparisons, SSMT leverages Quarterly Theory, in combination with concepts like liquidity sweeps, market structure breaks (MSB) and precision swing points (PSP), to provide a deeper and more actionable view of market dynamics.
By using SSMT, traders gain not only the ability to identify where divergence occurs, but also when it matters most within the market cycle. This empowers them to anticipate major moves or traps before they fully materialize, and position themselves accordingly in high-probability trade zones.
Whether you're trading Forex, crypto, indices, or commodities, the true strength of this indicator is revealed when used in sync with the Accumulation, Manipulation, Distribution, and Reversal phases of the market. Integrated with other confluence tools and market models, SSMT can serve as a core component in a professional, rule-based, and highly personalized trading strategy.
AI-123's BTC vs Gold (Lag Correlation)
DISCLAIMER
I made this indicator with the help of ChatGPT and using what I have learned so far from The Pine Script Mastery Course, LOTS of edits based on what I have learned so far had to be made as well as additions and modifications to my liking thanks to what I have learned so far. I am aware this already exists but I have done my best to make a first ever script/indicator while learning how to properly publish as well, so please bear that in mind.
Overview
This indicator analyzes the correlation between Bitcoin (BTC) and Gold (XAUUSD), with a customizable lag applied to the Gold price, providing insight into the macro relationship between these two assets.
It is designed for traders and investors who want to track how Bitcoin and Gold move in relation to each other, particularly when Gold is lagged by a specific number of days.
Key Features:
BTC and Gold (Lagged) Price Overlay: Display Bitcoin (BTC) and Gold (XAUUSD) prices on the chart, with an adjustable lag applied to the Gold price.
Rolling Correlation Calculation: Measures the correlation between Bitcoin and lagged Gold prices over a customizable lookback period.
Adjustable Lag: The number of days that Gold is lagged relative to Bitcoin is fully customizable (default: 20 days).
Customizable Correlation Length: Allows you to choose the lookback period for the correlation (default: 50 days), providing flexibility for short-term or long-term analysis.
Normalized Plotting: Prices of Bitcoin and Gold are normalized for better visual alignment with the correlation values. BTC is divided by 1000, and Gold by 100.
Correlation Scaling: The correlation value is amplified by 10 for better visual clarity and comparison with price data.
Zero Line: Horizontal line representing a correlation of 0, making it easier to identify positive or negative correlation shifts.
Maximum Correlation Lines: Horizontal lines at +10 and -10 values for extreme correlation scenarios.
Input Settings:
Gold Symbol: Customize the Gold ticker (default: OANDA:XAUUSD).
Bitcoin Symbol: Customize the Bitcoin ticker (default: BINANCE:BTCUSDT).
Lag (in trading days): Adjust the number of trading days to lag the Gold price relative to Bitcoin (default: 20).
Correlation Length (days): Set the number of days over which the rolling correlation is calculated (default: 50).
How to Use:
Price Comparison: The BTC (Spot) and Lagged Gold plots give you a side-by-side visual comparison of the two assets, normalized for clarity.
Correlation Line: The correlation line helps you gauge the strength and direction of the relationship between BTC and lagged Gold. Positive values indicate a strong positive correlation, while negative values indicate a negative correlation.
Visual Analysis: Watch how the correlation shifts with changes in lag and correlation length to identify potential market dynamics between Bitcoin and Gold.
Potential Applications:
Macro Trading: Track how Bitcoin and Gold behave in relation to each other during periods of economic uncertainty or inflation.
Sentiment Analysis: Use the correlation data to understand the sentiment between digital and traditional assets.
Strategic Timing: Identify potential opportunities where Bitcoin and Gold show a strong correlation or diverge based on the lag adjustment.
Understanding Macro Trends/Correlations.
Disclaimer:
This indicator is for informational purposes only. The correlation between Bitcoin and Gold does not guarantee future performance, and users should conduct their own research and use risk management strategies when making trading decisions.
Notes: This script uses historical data, so results may vary across different timeframes.
Customization options allow users to adjust the lag and correlation length to better fit their trading strategy.
Future Enhancements: Additional Correlation Line: A second correlation line for different lengths of lag or different assets.
Color-Coding of Correlation: Future updates may include color-coded correlation strength, visually indicating positive or negative correlation more effectively.
BINANCE:BTCUSDT RSI📊 BTC RSI Deviation Visualizer
This indicator visualizes the deviation of BTC RSI from the neutral level (50) to highlight momentum extremes and potential reversal zones in a simplified and color-coded format.
It is specifically designed for traders who prefer to monitor RSI strength centered around neutrality (0 as midpoint) instead of absolute RSI values.
🧠 Concept
This tool subtracts 50 from the RSI of BINANCE:BTCUSDT, creating a deviation value:
java
복사
편집
RSI Deviation = RSI - 50
This approach allows traders to interpret bullish or bearish bias more intuitively:
RSI > 50 → positive deviation → bullish
RSI < 50 → negative deviation → bearish
The result is plotted as a zero-centered histogram, where color and shape dynamically indicate the strength of deviation.
🔍 Visual Components
Color-coded Histogram:
Gradient bar colors reflect the size and direction of deviation.
Strong bullish (+10 to +30): light to dark orange
Strong bearish (-10 to -30): light to dark blue
Extreme values (>|30|): highlighted in yellow
Reversal Zone Circles:
Green circles are plotted when RSI deviation exceeds +30
Red circles appear when deviation is below -30
Circles are rate-limited to avoid visual noise (one signal every 5+ bars)
Reference Lines:
0 line (neutral RSI 50)
±35 threshold lines for identifying abnormal momentum
🔧 Settings
RSI Length: Default 14 (can be adjusted based on your time frame or strategy)
✅ Use Cases
Momentum Strength Monitoring:
Identify when BTC is showing sustained buying/selling pressure above typical ranges.
Reversal Signal Layer:
Use the circle markers to flag possible overbought/oversold peaks in conjunction with other tools.
Trend Filtering:
Use deviation direction (+/-) as an additional filter for trend-based strategies.
🧩 Compatibility
Works on any time frame
Only uses BINANCE:BTCUSDT price
Lightweight and highly responsive
🔐 Originality & Value
Unlike traditional RSI plots, this indicator offers a centered and directional perspective on RSI momentum.
The design emphasizes trend pressure, not just overbought/oversold thresholds, making it highly compatible with scalping, swing, or trend-following strategies.
EMA Envelope + EMA Bollinger BandsEMA envelope and bollinger bands together. It works on the principal of exponential moving average useful in identifying rallies top and bottoms.
Precision is high on higher timeframes like weekly and daily and monthly for swingtrades
Trend Dashboard (Short / Medium / Long)🔍 Overview
This script:
Calculates the short, medium, and long-term trend based on moving average crossovers
Displays the current trend status in a color-coded table on your TradingView chart
Helps you visually identify market trend direction at a glance — great for quick decision making
🧱 1. Inputs Section
shortMA_len = input.int(9, title="Short-Term MA")
mediumMA_short = input.int(21, title="Medium-Term Fast MA")
mediumMA_long = input.int(50, title="Medium-Term Slow MA")
longMA_short = input.int(50, title="Long-Term Fast MA")
longMA_long = input.int(200, title="Long-Term Slow MA")
This part lets you customize the moving averages used to determine each trend type:
Short-term: 9 vs 21 SMA
Medium-term: 21 vs 50 SMA
Long-term: 50 vs 200 SMA
You can change these from the indicator settings on your chart.
📈 2. Calculating the Moving Averages
shortMA = ta.sma(close, shortMA_len)
mediumFast = ta.sma(close, mediumMA_short)
mediumSlow = ta.sma(close, mediumMA_long)
longFast = ta.sma(close, longMA_short)
longSlow = ta.sma(close, longMA_long)
This section calculates:
The short MA (e.g. 9-period)
The medium fast & slow MAs (21 & 50)
The long fast & slow MAs (50 & 200)
📊 3. Determining the Trend
shortTrend = shortMA > mediumFast ? "Bullish" : shortMA < mediumFast ? "Bearish" : "Neutral"
mediumTrend = mediumFast > mediumSlow ? "Bullish" : mediumFast < mediumSlow ? "Bearish" : "Neutral"
longTrend = longFast > longSlow ? "Bullish" : longFast < longSlow ? "Bearish" : "Neutral"
Here, each trend is determined by a simple moving average crossover:
If the fast MA is above the slow MA → Bullish
If below → Bearish
If equal → Neutral
🎨 4. Trend Color Helper Function
getColor(trend) =>
trend == "Bullish" ? color.lime : trend == "Bearish" ? color.red : color.gray
Returns a color based on the trend type:
Green for Bullish
Red for Bearish
Gray for Neutral
📋 5. Creating and Updating the Table
var table trendTable = table.new(position.top_right, 2, 4, border_width=1)
This creates a 2-column, 4-row table in the top-right of the chart.
pinescript
Copy
Edit
table.cell(...)
Updates the table every few bars:
Row 1: headers
Row 2: Short-term trend
Row 3: Medium-term trend
Row 4: Long-term trend
Each trend is colored based on its status.
📌 6. Optional: Plot the Moving Averages
plot(shortMA, ...)
plot(mediumFast, ...)
...
Just to give you a visual reference, it plots each moving average on the chart in a different color.
✅ Summary: What You Get
🧠 Short-Term Trend: (e.g., 9 vs 21 SMA)
📈 Medium-Term Trend: (e.g., 21 vs 50 SMA)
📉 Long-Term Trend: (e.g., 50 vs 200 SMA)
🎨 Color-coded dashboard for instant recognition
📊 Great for trend-following, filtering trades, and quick analysis
[blackcat] L2 Ehlers Convolution Indicator V2OVERVIEW The L2 Ehlers Convolution Indicator V2 is an advanced technical analysis tool that applies convolution techniques to identify market trends and potential reversal points. It uses adaptive filtering to analyze price movements across multiple timeframes.
FEATURES
• Advanced convolution algorithm based on Ehlers' methodology
• Multiple timeframe analysis (S2 through S60)
• Dynamic color coding for trend direction:
Red: Downward trend
Green: Upward trend • Adjustable sensitivity through period inputs
HOW TO USE
Input Parameters:
• ShortestPeriod: Minimum period length for calculations
• LongestPeriod: Maximum period length for calculations
Interpretation:
• Red bars indicate downward momentum
• Green bars indicate upward momentum
• Bar height corresponds to the timeframe analyzed
LIMITATIONS
• Requires sufficient historical data for accurate calculations
• May produce false signals during volatile markets
• Performance depends on selected period parameters
NOTES
• The indicator uses arrays to store correlation, slope, and convolution values
• Each bar represents a different timeframe analysis
• Color intensity varies based on the strength of the signal
[blackcat] L2 Ehlers Autocorrelation Periodogram V2OVERVIEW
The Ehlers Autocorrelation Periodogram is a sophisticated technical analysis tool that identifies market cycles and their dominant frequencies using autocorrelation and spectral analysis techniques.
BACKGROUND
Developed by John F. Ehlers and detailed in his book "Cycle Analytics for Traders" (2013), this indicator combines autocorrelation functions with discrete Fourier transforms to extract cyclic information from price data.
FUNCTION
The indicator works through these key steps:
Calculates autocorrelation using minimum three-bar averaging
Applies discrete Fourier transform to extract cyclic information
Uses center-of-gravity algorithm to determine dominant cycle
ADVANTAGES
• Rapid response within half-cycle periods
• Accurate relative cyclic power estimation over time
• Correlation constraints between -1 and +1 eliminate amplitude compensation needs
• High resolution independent of windowing functions
HOW TO USE
Add the indicator to your chart
Adjust AvgLength input parameter:
• Default: 3 bars
• Higher values increase smoothing
• Lower values increase sensitivity
Interpret the results:
• Colored bars represent spectral power
• Red to yellow spectrum indicates cycle strength
• White line shows dominant cycle period
INTERPRETATION
• Strong colors indicate significant cyclic activity
• Sharp color transitions suggest potential cycle changes
• Dominant cycle line helps identify primary market rhythm
LIMITATIONS
• Requires sufficient historical data
• Performance may vary in non-cyclical markets
• Results depend on proper parameter settings
NOTES
• Uses highpass and super smoother filtering techniques
• Spectral estimates are normalized between 0 and 1
• Color intensity varies based on spectral power
THANKS
This implementation is based on Ehlers' original work and has been adapted for TradingView's Pine Script platform.
Market Session StrategyMarket Session Strategy Indicator Explanation
This is a TradingView Pine Script indicator called "Market Session Strategy" that monitors different market sessions and generates trading signals based on pattern analysis between sessions. Let me break down how it works:
Core Functionality
The indicator divides the trading day into three sessions:
Pre-Market (7:30 PM - 3:00 AM ET by default)
Regular Market (3:00 AM - 9:30 AM ET by default)
After Hours (9:30 AM - 4:00 PM ET by default)
For each session, it:
Tracks price action (open, high, low, close)
Calculates range percentages
Identifies session bias (bullish or bearish)
Draws visual session boxes on the chart
Generates trading signals based on historical patterns
Signal Generation Methodology
The indicator generates BUY/SELL signals at the beginning of the Regular Market and After Hours sessions using three main strategies:
1. Trend Continuation/Reversal Analysis
The script tracks how often a bullish/bearish trend in one session continues or reverses in the next session. For example:
If pre-market trends historically continue into regular hours 70% of the time and today's pre-market is bullish, it may generate a BUY signal.
If reversals are more common, it may generate a counter-trend signal.
2. Tight Range Breakout Signal
The indicator identifies "tight range" sessions (where price movement is unusually constrained compared to recent averages). A tight range with a bullish bias generates a BUY signal, while a bearish bias generates a SELL signal.
3. Day of Week Pattern Analysis
The script analyzes which days of the week show stronger trend continuation probabilities. If a particular day (like Monday) historically shows strong trend continuation and the threshold is met, it generates a signal accordingly.
Visual Components
The indicator provides several visual elements:
Colored session boxes showing high/low ranges
Signal labels at entry points
Session background colors with high transparency
A comprehensive dashboard showing session status, range percentages, bias, and signals
Performance Tracking
The script tracks trade success by session and day of week, which helps refine future signals. A trade is considered successful if:
A BUY signal is followed by a close higher than open
A SELL signal is followed by a close lower than open
Daily Borders with Weekday Labels[fitfatq]Indicator Overview
This indicator displays daily vertical border lines and the previous day’s weekday label on intraday charts (i.e., charts with a timeframe lower than Daily). It draws a vertical line at the start of each new trading day and places a label displaying the previous day’s weekday (e.g., Monday) at the horizontal midpoint between the previous and the current day. Users can customize various visual aspects such as the separator line style and width, label style, text color, and text size. Additionally, the indicator offers an option to fix the label’s Y coordinate at a specified price level to prevent it from being overlapped by candlesticks.
Parameter Details
Use Fixed Weekday Label Y Coordinate
Type: Boolean
Default: false
Description: When enabled, the weekday label’s vertical position will be fixed at a specified price level (see next parameter). Otherwise, the label’s Y position is determined dynamically (typically based on the current bar’s low minus 3 ticks).
Fixed Weekday Label Y Coordinate (price)
Type: Float
Default: 130.0
Description:
This parameter sets the fixed price level at which the weekday label will be displayed if the "Use Fixed Weekday Label Y Coordinate" option is enabled. Please input a value that corresponds to your chart’s price scale (e.g., 130.50). Note: In charts with high price levels (for example, stocks trading at 3000 or above), it is recommended to set this value to 3000 or above. The higher the value, the closer the label will appear to the candlesticks.
Separator Line Style
Type: String (Options: "Solid", "Dotted", "Dashed")
Default: "Dotted"
Description: Specifies the style of the vertical separator line drawn at the start of each new day. "Solid" displays a continuous line, "Dotted" shows a dotted line, and "Dashed" provides a dashed line.
Separator Line Width
Type: Integer
Default: 1
Description: Determines the thickness of the separator line. A higher number results in a thicker line; the minimum value is 1.
Label Style
Type: String (Options: "None", "Label Up", "Label Down", "Label Left", "Label Right", "Label Center")
Default: "None"
Description: Sets the built-in style for the weekday label. "None" means no background or border (plain text only), while other options apply predefined visual effects.
Text Color
Type: Color
Default: Black
Description: Determines the text color of the weekday label.
Label Text Size
Type: String (Options: "Tiny", "Small", "Normal", "Large", "Huge")
Default: "Normal"
Description: Specifies the text size of the weekday label. Adjust according to preference to ensure the label is readable.
Usage Summary
How It Works:
The indicator detects the start of a new trading day using a change in the daily timeframe (via ta.change(time("D"))). When a new day begins, it draws a vertical separator line at the first bar of that day. If previous day data is available, the indicator calculates the horizontal midpoint between the start of the previous day and the current day and displays the previous day’s weekday label at that position. If the fixed Y coordinate option is enabled, the label is drawn at the specified price level; otherwise, it is positioned relative to the current bar’s low.
Customization:
Users can adjust all visual aspects, including the line style and width as well as the label style, text color, and text size. The fixed Y coordinate option allows the label’s vertical position to remain constant, which helps prevent overlapping with price bars.
Chart Requirement:
This indicator only operates on intraday charts (timeframes lower than Daily) and will not display on Daily or higher timeframe charts.
License
This indicator is released under the Mozilla Public License 2.0. Please credit the original author (fitfatq) when using or sharing this script.
Global M2 Money+ Supply Input Lead (USD)Global M2 Money Supply + INR+CAD Input Lead (USD)
This indicator calculates the global M2 money supply in USD by aggregating M2 data from multiple economies, converted to USD using their respective exchange rates. It overlays the scaled M2 data on the chart with a user-defined time shift to analyze potential correlations with asset prices, such as Bitcoin. The indicator is designed to help traders assess global liquidity trends with a customizable lead or lag.
Countries Included:
Eurozone (EUM2)
North America: United States (USM2), Canada (CAM2)
Non-EU Europe: Switzerland (CHM2), United Kingdom (GBM2), Finland (FIM2), Russia (RUM2)
Pacific: New Zealand (NZM2)
Asia: China (CNM2), Taiwan (TWM2), Hong Kong (HKM2), India (INM2), Japan (JPM2), Philippines (PHM2), Singapore (SGM2)
Latin America: Brazil (BRM2), Colombia (COM2), Mexico (MXM2)
Middle East: United Arab Emirates (AEM2), Turkey (TRM2)
Africa: South Africa (ZAM2)
Input for Lead/Lag:
Time Shift (days): Adjust this input to shift the M2 data forward (positive values) or backward (negative values) on the chart. For example, setting a lead of 85 days shifts the M2 data 85 days into the future, helping traders analyze potential leading indicators for price movements.
30 Day EMA and Donchian ChannelA simple way to follow trend with the help of 30 EMA & Donchian channel best works on weekly charts
Webby's Market OrderThis is visual representation of Webby's Market Order.
When three consecutive lows are above 21 EMA, Uptrend expectation is natural.
When three highs are below 21 EMA, Downtrend expectation is natural.
Alert Conditions can be set when uptrend and down trend are expected.
Use this indicator with IXIC or SPY or major indices.
This is set at three lows/Highs above 21 EMA as looked by Mike Webster.
Relative Strength IndexAdjusted RSI indicator with customizable colors, allowing you to easily change the appearance of bullish and bearish divergences. This version is designed for traders who prefer a more neutral or minimalistic color palette, improving visual clarity without losing key signals. Ideal for cleaner charts and better integration with personalized themes.
BySq - Market PsychologyThe script I provided is a Market Psychology Index indicator for TradingView, which focuses on three key psychological market phases:
FOMO (Fear of Missing Out)
Panic Selling
Reversal
This indicator uses volume, price changes, and specific time periods to gauge market sentiment. Let me break it down:
1. Input Parameters:
FOMO Period: Defines how many bars (candles) the FOMO index will consider for its calculation.
Panic Period: Defines the period to evaluate Panic Selling.
Reversal Period: Defines the period to evaluate potential price reversals.
You can adjust these periods based on your analysis preferences. The default for each period is 14.
2. FOMO Index:
The FOMO Index aims to capture the "fear of missing out" behavior in the market.
It uses volume and price change:
Volume is compared to the Simple Moving Average (SMA) of volume over the specified period.
Price change is calculated as the percentage change in price compared to the previous bar.
If both volume and price change indicate strong upward movement, the FOMO index spikes.
3. Panic Selling Index:
The Panic Selling Index captures when traders are selling out of fear, often in a rapid or irrational way.
Similar to the FOMO Index, it considers volume and price change:
It uses volume and compares it to the SMA of volume for the panic period.
Price change is negative, meaning it considers only price drops.
When there is high volume coupled with significant price drops, it signals panic selling.
4. Reversal Index:
The Reversal Index aims to detect potential trend reversals in the market.
This index also considers volume and price change:
It focuses on upward price movement and compares volume to its SMA.
If there’s strong upward price movement along with increasing volume, it signals the possibility of a price reversal.
5. Graphical Output:
Histograms are drawn on the chart for each of the three indices:
FOMO is shown in green (indicating the presence of FOMO) and red (when the index is low).
Panic Selling is shown in orange.
Reversal is shown in purple.
The Zero Line (horizontal dotted line) helps identify when any of the indices is positive or negative.
6. Labels:
Labels for each index are shown on the chart at the relevant bar when the index spikes.
FOMO is labeled "FOMO" in green when it spikes.
Panic Selling is labeled "Panic Selling" in orange when it spikes.
Reversal is labeled "Reversal" in purple when it spikes.
Additionally, period labels show above the chart, indicating the specific periods (FOMO, Panic, and Reversal periods) currently being applied. This provides clarity on what time frame each index is analyzing.
7. How to Use:
FOMO: High values may indicate that traders are buying out of fear of missing out on a rally, suggesting a potentially overheated market.
Panic Selling: High values could suggest irrational selling behavior or capitulation, potentially marking the bottom of a downtrend.
Reversal: High values signal the potential for a market reversal, where the price could change direction due to increased volume and upward movement.
8. Visual Appearance:
The indicator’s histograms change colors based on the level of market sentiment detected. The color-coded approach provides an easy-to-read visual representation of different psychological phases in the market.
The horizontal zero line allows easy differentiation between positive and negative values.
Summary:
This script combines the psychology of the market (FOMO, Panic Selling, and Reversal) into a set of indicators that help traders identify potential turning points or emotional states in the market. By focusing on volume and price change, the script attempts to give a clear picture of market sentiment and possible future movements.
SL - 4 EMAs, 2 SMAs & Crossover SignalsThis TradingView Pine Script code is built for day traders, especially those trading crypto on a 1‑hour chart. In simple words, the script does the following:
Calculates Moving Averages:
It computes four exponential moving averages (EMAs) and two simple moving averages (SMAs) based on the closing price (or any price you select). Each moving average uses a different time period that you can adjust.
Plots Them on Your Chart:
The EMAs and SMAs are drawn on your chart in different colors and line thicknesses. This helps you quickly see the short-term and long-term trends.
Generates Buy and Sell Signals:
Buy Signal: When the fastest EMA (for example, a 10-period EMA) crosses above a slightly slower EMA (like a 21-period EMA) and the four EMAs are in a bullish order (meaning the fastest is above the next ones), the script will show a "BUY" label on the chart.
Sell Signal: When the fastest EMA crosses below the second fastest EMA and the four EMAs are lined up in a bearish order (the fastest is below the others), it displays a "SELL" label.
In essence, the code is designed to help you spot potential entry and exit points based on the relationships between multiple moving averages, which work as trend indicators. This makes it easier to decide when to trade on your 1‑hour crypto chart.
analyzPian### Description of the Script: **AnalyzPian Indicator**
The **AnalyzPian** indicator is a TradingView Pine Script designed to identify and visualize bullish and bearish price swings, breakouts, and retests on a chart. It uses pivot points (highs and lows) to detect significant price movements and overlays boxes and labels to highlight these areas for traders. Below is a detailed breakdown of its functionality and features:
---
### **Key Features**
1. **Dual Swing Detection**:
- The script identifies both **bullish** and **bearish** swings using pivot points (`ta.pivothigh` and `ta.pivotlow`).
- These swings are used to define potential breakout zones.
2. **Breakout and Retest Zones**:
- Once a swing is detected, the script creates a box around the price level to represent the **potential breakout zone**.
- If the price breaks out of the box, it transitions into a **retest phase**, where the script looks for retests of the breakout level.
3. **Customizable Display Options**:
- Users can choose to display **Bullish**, **Bearish**, or both types of swings.
- Additional options allow filtering for **last retest only** or showing **all retests** with labels.
4. **Dynamic Box Adjustments**:
- Boxes dynamically adjust their width based on user-defined parameters (`maxBars`, `minBars`).
- If the right side of the box exceeds the maximum allowed bars without a signal, the box is either deleted or reset to the last retest position.
5. **Labeling System**:
- Labels are added to indicate **breakouts** (▲ or ▼) and **retests** (▽ or △).
- Labels are styled differently for bullish and bearish signals and can be customized in terms of color and size.
6. **State Management**:
- The script uses a state machine (`state`) to track the lifecycle of each swing:
- **State 0**: Initial state, waiting for a swing detection.
- **State 1**: Swing detected, breakout zone created.
- **State 2**: Breakout confirmed, retest zone active.
7. **ATR-Based Width**:
- The width of the boxes is calculated using the **Average True Range (ATR)**, ensuring that the zones adapt to market volatility.
8. **User Inputs**:
- Extensive customization options are provided through input parameters:
- **Display Options**: Choose between bullish, bearish, or both.
- **Box Width**: Adjust the multiplier for ATR-based width.
- **Maximum Bars**: Set the maximum number of bars without a signal before resetting.
- **Minimum Bars**: Define the minimum distance between labels.
- **Set Back Option**: Reset the box to the last retest position if the right side is too far.
9. **Visual Enhancements**:
- Boxes and labels are styled with customizable colors and transparency for better visualization.
- Labels use intuitive symbols (▲, ▼, ▽, △) to clearly indicate the type of signal.
---
### **How It Works**
1. **Swing Detection**:
- The script uses `ta.pivothigh` and `ta.pivotlow` to identify significant highs and lows based on user-defined left and right lookback periods.
- These pivots serve as the foundation for creating breakout and retest zones.
2. **Box Creation**:
- When a swing is detected, a box is drawn around the price level to represent the breakout zone.
- The box's height is determined by the ATR, and its width expands dynamically as new bars are added.
3. **Breakout Confirmation**:
- If the price moves outside the box (breakout), the script transitions to the next state and creates a new box for the retest phase.
- Labels are added to mark the breakout point.
4. **Retest Detection**:
- During the retest phase, the script monitors whether the price revisits the breakout level.
- If a retest occurs, a label is added to indicate the event.
5. **Reset Mechanism**:
- If no signal is detected within the maximum allowed bars, the box is either deleted or reset to the last retest position.
---
### **Use Cases**
1. **Trend Identification**:
- Traders can use the indicator to identify bullish and bearish trends by observing the direction of breakouts and retests.
2. **Entry and Exit Points**:
- Breakout zones can serve as potential entry points, while retests provide confirmation for trades.
3. **Risk Management**:
- The boxes help visualize key support and resistance levels, aiding in stop-loss placement and risk assessment.
4. **Market Analysis**:
- The dynamic nature of the indicator makes it suitable for analyzing both trending and ranging markets.
---
### **Code Structure**
1. **Settings Section**:
- Contains user-defined inputs for customizing the behavior and appearance of the indicator.
2. **UDT (User-Defined Type)**:
- Defines a `bin` type to store information about each swing, including its state, price level, and associated labels.
3. **Methods**:
- Includes helper functions for managing labels, checking conditions, and updating states.
4. **Execution Logic**:
- Implements the core logic for detecting swings, managing states, and drawing boxes and labels.
---
### **Conclusion**
The **AnalyzPian** indicator is a powerful tool for traders who want to visually analyze price swings, breakouts, and retests. Its flexibility, combined with its intuitive design, makes it suitable for a wide range of trading strategies. By leveraging pivot points and ATR-based zones, the script provides actionable insights into market dynamics while maintaining a clean and customizable interface.
StonkGame Major Market Open/ClosePlots vertical lines for Tokyo, London, and New York session opens and closes — auto-adjusted to your chart's timezone.
Open lines = lighter, dashed style.
Close lines = solid, full-color style.
Helps identify key liquidity windows, session-driven volatility, and clean market structure — without chart clutter.
Fully customizable colors and line styles for a professional, minimal look.
China 10-Year Yield Inverted with Time Lead (Months)The "China 10-Year Yield Inverted with Time Lead (Months)" indicator is a Pine Script tool for TradingView that displays the inverted China 10-Year Government Bond Yield (sourced from TVC:CN10Y) with a user-defined time lead or lag in months. The yield is inverted by multiplying it by -1, making a rising yield appear as a downward movement and vice versa, which helps visualize inverse correlations with other assets. Users can input the number of months to shift the yield forward (lead) or backward (lag), with the shift calculated based on the chart’s timeframe (e.g., 20 bars per month on daily charts). The indicator plots the shifted, inverted yield as a blue line in a separate pane, with a zero line for reference, enabling traders to analyze leading or lagging relationships with other financial data, such as the PBOC Balance Sheet or Bitcoin price.
Price Position Percentile (PPP)
Price Position Percentile (PPP)
A statistical analysis tool that dynamically measures where current price stands within its historical distribution. Unlike traditional oscillators, PPP adapts to market conditions by calculating percentile ranks, creating a self-adjusting framework for identifying extremes.
How It Works
This indicator analyzes the last 200 price bars (customizable) and calculates the percentile rank of the current price within this distribution. For example, if the current price is at the 80th percentile, it means the price is higher than 80% of all prices in the lookback period.
The indicator creates five dynamic zones based on percentile thresholds:
Extremely Low Zone (<5%) : Prices in the lowest 5% of the distribution, indicating potential oversold conditions.
Low Zone (5-25%) : Accumulation zone where prices are historically low but not extreme.
Neutral Zone (25-75%) : Fair value zone representing the middle 50% of the price distribution.
High Zone (75-95%) : Distribution zone where prices are historically high but not extreme.
Extremely High Zone (>95%) : Prices in the highest 5% of the distribution, suggesting potential bubble conditions.
Mathematical Foundation
Unlike fixed-threshold indicators, PPP uses a non-parametric approach:
// Core percentile calculation
percentile = (count_of_prices_below_current / total_prices) * 100
// Threshold calculation using built-in function
p_extremely_low = ta.percentile_linear_interpolation(source, lookback, 5)
p_low = ta.percentile_linear_interpolation(source, lookback, 25)
p_neutral_high = ta.percentile_linear_interpolation(source, lookback, 75)
p_extremely_high = ta.percentile_linear_interpolation(source, lookback, 95)
Key Features
Dynamic Adaptation : All zones adjust automatically as price distribution changes
Statistical Robustness : Works on any timeframe and any market, including highly volatile cryptocurrencies
Visual Clarity : Color-coded zones provide immediate visual context
Non-parametric Analysis : Makes no assumptions about price distribution shape
Historical Context : Shows how zones evolved over time, revealing market regime changes
Practical Applications
PPP provides objective statistical context for price action, helping traders make more informed decisions based on historical price distribution rather than arbitrary levels.
Value Investment : Identify statistically significant low prices for potential entry points
Risk Management : Recognize when prices reach historical extremes for profit taking
Cycle Analysis : Observe how percentile zones expand and contract during different market phases
Market Regime Detection : Identify transitions between accumulation, markup, distribution, and markdown phases
Usage Guidelines
This indicator is particularly effective when:
- Used across multiple timeframes for confirmation
- Combined with volume analysis for validation of extremes
- Applied in conjunction with trend identification tools
- Monitored for divergences between price action and percentile ranking
Liquidity Zones Alerts"Liquidity Zones Alerts" is a powerful smart-money-based indicator designed to detect key liquidity grabs and provide high-probability reversal signals using a combination of market structure, volume, volatility, and candlestick confirmation.
🧠 How It Works
The core logic of this indicator is built around the Smart Money Concepts:
🔺 Liquidity Sweeps: Detects when price takes out previous daily or weekly highs/lows, suggesting stop hunts or engineered liquidity moves by institutional players.
📈 Volume Filter: Ensures signals only appear during above-average volume, filtering out noise and low-interest moves.
⚡ Volatility Filter: Flags high-range candles relative to the average, catching flash crashes/spikes that often precede strong reversals.
🔄 Engulfing Candle Confirmation: Confirms entry with a bullish or bearish engulfing pattern after liquidity is taken — increasing signal reliability.
🧭 Premium/Discount Zone Logic: Trades are filtered to ensure longs are only taken in discount zones, and shorts in premium zones, using a 20-period market range for context.
📌 Features
✅ Daily & Weekly liquidity zones toggle
✅ Visual signals with clean 🔻(short) & 🔺(long) arrows
✅ Auto-detection of flash crashes
✅ Alerts on both long and short setups
✅ Optional previous high/low level plotting for context
✅ Background highlighting of valid signal candles
✅ Multi-timeframe friendly and compatible with any asset
🛠️ Use Case
Whether you're a scalper or a swing trader, this tool helps you spot institutional entry zones before the move happens. It works especially well when combined with your existing bias or supply/demand zones.
💬 “Price doesn't move randomly — it hunts liquidity. This indicator shows you where and when it happens.”