Session Probability Grid [JOAT]Session Probability Grid
Introduction
Session Probability Grid is an open-source session auction map. It builds percent-based ladder levels from the active session open, tracks historical hit behavior for those levels, and displays probability-style context for expansion, exhaustion, and unusual session movement.
The problem it solves is session framing. Traders often know the open is important, but they may not know whether a move is normal for the current symbol and timeframe. This script records session outcomes and converts them into visible ladder probabilities.
Core Concepts
1. Session Open Ladder
The script creates six upside and six downside levels from the session open using configurable percentage steps. These levels frame how far price has moved away from the open.
2. Historical Hit Memory
At the end of each session, the script updates arrays storing hit counts, sample counts, and continuation distance. This creates a rolling sample of how often each ladder has been reached.
3. Opening Range Context
The first configurable number of bars defines the opening range. The session box and opening range box help distinguish early balance from later expansion.
4. Expansion and Exhaustion States
Expansion states identify movement through areas with supportive historical behavior. Exhaustion states mark stretched locations where continuation may be less reliable.
5. Session VWAP Gradient
The optional session VWAP gradient adds a live auction mean reference so ladder movement can be compared against the developing session control line.
Features
Open-relative ladder: Six upside and six downside levels based on configurable percent steps.
Statistical memory: Tracks hit count, sample count, and continuation distance from completed sessions.
Probability cards: Right-side cards show ladder behavior without crowding price.
Expansion and exhaustion states: Highlights meaningful session movement conditions.
Session and opening range boxes: Frames current auction development.
Session VWAP gradient: Adds a developing mean reference.
Candle coloring: Bars can be colored by session state.
Dashboard: Shows session state, nearest ladder, hit probability, expected continuation, and range condition.
Alerts: Upside expansion, downside expansion, upper exhaustion, and lower exhaustion.
Input Parameters
Core Session: Active Session, Opening Range Bars, Stat Sample Cap, Session Range Box, Opening Range Box.
Ladder: Open-Relative Ladders and Step 1 through Step 6.
Signals and Visuals: Auction State Zones, State Projection Bars, Continuation Probability Gate, Right Probability Cards, Session Candle Color, Session VWAP Gradient, Dashboard.
How to Use This Indicator
Step 1: Start from the session open
The ladder levels are built from the open, so they frame the current session relative to its starting price.
Step 2: Compare price to the ladder
As price approaches a ladder level, check the probability card and dashboard for historical hit and continuation context.
Step 3: Distinguish expansion from exhaustion
Expansion and exhaustion states help separate normal auction development from stretched movement.
Indicator Limitations
Probabilities are based on the chart's available historical sessions and are not universal statistics.
Session boundaries depend on the selected exchange/session setting.
The script needs enough completed sessions to build useful samples.
Probability context does not predict future price.
Originality Statement
Session Probability Grid is original in its combination of open-relative ladders, rolling hit memory, continuation-distance storage, session VWAP context, opening range framing, and expansion/exhaustion visualization. It is not just a static percent-level tool; it updates its context from completed session behavior.
Disclaimer
This script is for educational and informational purposes only. It is not financial advice and does not recommend trades. Historical session behavior may not repeat. Use independent analysis and risk management.
Made with passion by jackofalltrades
Indicator

Historical IQBy:MasterTonyTA
---
**Historical IQ— Track % Bull/Bear to gauge Historical Context of moves**
This indicator measures the historical reliability of key percentage levels derived from pivot highs and pivot lows. Rather than simply drawing support and resistance zones, it scores each level based on what price actually did when it arrived there — giving you a data-driven read on whether a level is worth trading or fading. CUSTOM PICK A % MOVE TO SEE HOW PRICE AS REACTED AT THAT %
---
**HOW IT'S CALCULATED**
The indicator operates in one of two modes — Bear or Bull — never both at once, keeping the chart clean and the analysis focused.
**Bear Mode (Pivot High → -N%)**
Every confirmed pivot high is identified using a configurable left/right bar lookback. From that pivot, a horizontal band is drawn at your chosen percentage below it — for example, -10% — with an adjustable tolerance creating a band rather than a single line. Once price enters a new pivot's range the previous band is closed off and locked for historical scoring.
On the final bar, every historical band is scanned bar by bar across its entire time window. Each band falls into one of three outcomes: price reached the band and closed above it (held as support — painted gold), price reached the band and closed below it (broke through — painted red), or price never reached the band at all (untouched — painted red but excluded from scoring).
**Bull Mode (Pivot Low → +N%)**
The same logic runs in reverse. Every confirmed pivot low generates a band at your chosen percentage above it. The three outcomes become: price reached the band and stalled without closing above it (resistance held — gold), price reached the band and closed above it (broke through — painted green), or price never reached the band (untouched — excluded from scoring).
**The Scoring**
Only bands that price actually tested are included in the stats. Untouched bands are deliberately excluded because a level that was never reached tells you nothing about whether it would have held. The gold hit rate is therefore a pure measure — out of every time price came to this level, how often did it respect it?
---
**HOW TO READ THE TABLE**
The stats table sits top-right and updates on every bar. It shows:
**🟡 Gold (held/stalled)** — the number of historical bands where price tested the level and respected it. In Bear mode this means closed above; in Bull mode this means stalled without closing above.
**🔴 Broke through / 🟢 Broke through** — the number of times price tested the level and pushed straight through. These are the failures.
**Times tested** — gold plus broke. This is the denominator for all calculations. Untouched bands are not included here.
**○ Not yet reached** — shown for context only. These bands exist on the chart but have no vote in the ratio since price never arrived.
**🎯 Gold hit rate** — the headline number. This is gold divided by times tested, expressed as a percentage. A reading above 60% lights up gold. Below 60% it turns red. This is the number to watch.
**Gold : Broke ratio** — the same relationship expressed as a simplified ratio. A 3:1 ratio means for every three times the level held, it broke once.
**Reading** — a plain-language verdict based on the gold hit rate:
- 70% and above → Strong support / Strong resistance
- 50–69% → Moderate support / Moderate resistance
- 30–49% → Weak support / Weak resistance
- Below 30% → Unreliable
---
**HOW TO USE IT** FIND HISTORICAL % AND WHAT HAPPENED TO SEE THE IMPLICATIONS OF MOVES
**Dialing in your target** — start by choosing a percentage that is meaningful for the asset you are trading. Volatile assets like crypto may show more meaningful clusters around larger moves such as 15–20%. Blue chip equities or indices often show cleaner structure at 8–12%. The goal is to find the percentage where the gold hit rate is consistently above 60% across history — that tells you the market has a genuine memory of that level.
**Using the tolerance** — the band width setting controls how precise price needs to be to count as a test. A tighter tolerance like 0.2% gives you a sharper level but fewer touches. A wider tolerance like 1% captures more wicks and approaches but may dilute the quality signal. Start tight and widen only if you are seeing very few tests.
**Bear mode use case** — after a significant high has formed and the market is declining, the gold bands ahead of price show levels where the market has historically found buyers at this same percentage distance from a prior peak. A high gold hit rate at your chosen decline level is a data-backed reason to watch for a bounce or entry there rather than guessing.
**Bull mode use case** — after a significant low has formed and the market is rallying, the gold bands show levels where price has historically stalled at this percentage distance from a prior trough. A high gold hit rate is a reason to consider taking profits, tightening stops, or watching for reversal signals as price approaches.
**Pivot sensitivity** — the left and right bar inputs control how significant a pivot needs to be to qualify. Higher values require a more dominant high or low with more bars confirming on either side, producing fewer but more meaningful pivots. Lower values produce more pivots and more bands but may include minor swings that add noise.
**The live label** — the percentage shown at the current bar tells you exactly where price sits relative to the most recent pivot. When price enters a band the label turns gold as a real-time visual alert that price is at a historically significant level right now.
--- Indicator

Adaptive Volatility Matrix [JOAT]Adaptive Volatility Matrix
Introduction
The Adaptive Volatility Matrix (AVM) is an advanced open-source volatility regime classification indicator that combines Bollinger Band Width Percentile (BBWP), ATR percentile analysis, regime transition prediction, volatility clustering detection, and historical regime statistics to classify market conditions into distinct volatility regimes. This indicator helps traders adapt their strategies to current market conditions by systematically identifying when volatility is expanding, contracting, or transitioning between regimes.
Unlike basic volatility indicators that simply plot ATR or Bollinger Bands, AVM employs a sophisticated dual-metric system that combines BBWP (measuring price range compression/expansion) with ATR percentile (measuring absolute volatility) to create a combined volatility score (0-100%). The indicator then classifies this score into five distinct regimes and predicts regime transitions through momentum analysis.
Why This Indicator Exists
This indicator addresses the challenge of adapting trading strategies to volatility conditions. Different market regimes require different approaches - mean reversion works in low volatility, breakout strategies work in expansion, and risk management becomes critical in extreme volatility. AVM systematically reveals:
BBWP Analysis: Measures Bollinger Band width percentile to identify compression/expansion cycles
ATR Percentile: Tracks normalized ATR percentile to measure absolute volatility levels
Combined Volatility Score: Weighted average (60% BBWP, 40% ATR) for robust regime classification
Regime Classification: Five distinct regimes (Extreme Expansion, Expansion, Normal, Contraction, Extreme Contraction)
Transition Prediction: Momentum-based forecasting of next regime with probability
Volatility Clustering: Detects sustained high/low volatility periods
Historical Statistics: Tracks regime duration and frequency for context
Each component provides unique intelligence. BBWP shows compression cycles, ATR shows absolute volatility, combined score provides robust classification, regime system categorizes conditions, transition prediction anticipates changes, clustering detects persistence, and statistics provide historical context.
Core Components Explained
1. BBWP (Bollinger Band Width Percentile) Calculation
BBWP measures where current Bollinger Band width ranks relative to historical width:
f_calculate_bbwp(int length, int lookback) =>
float basis = ta.sma(close, length)
float dev = ta.stdev(close, length)
float bb_width = (dev * 2) / basis * 100
// Calculate percentile rank
int count = 0
for i = 1 to lookback
if bb_width > nz(bb_width )
count += 1
float bbwp = (count / lookback) * 100
BBWP ranges from 0-100%:
- 0-20%: Extreme compression (volatility squeeze)
- 20-40%: Contraction (below average volatility)
- 40-60%: Normal (average volatility)
- 60-80%: Expansion (above average volatility)
- 80-100%: Extreme expansion (volatility breakout)
2. ATR Percentile Analysis
ATR percentile measures where current normalized ATR ranks historically:
f_atr_percentile(int period, int lookback) =>
float atr_val = ta.atr(period)
float natr = close > 0 ? (atr_val / close) * 100 : 0.0
float percentile = ta.percentrank(natr, lookback)
Normalized ATR (NATR) accounts for price level differences, making volatility comparable across different price ranges. Percentile ranking shows where current volatility sits in historical distribution.
3. Combined Volatility Score & Regime Classification
The combined score weights BBWP more heavily than ATR percentile:
float combined_score = (bbwp_value * 0.6) + (atr_percentile * 0.4)
f_classify_regime(float bbwp_val, float atr_perc, float exp_th, float con_th, float ext_th) =>
string regime = "Normal"
int regime_code = 0
if bbwp_val >= ext_th or atr_perc >= ext_th
regime := "Extreme Expansion"
regime_code := 4
else if bbwp_val >= exp_th or atr_perc >= exp_th
regime := "Expansion"
regime_code := 3
// Additional classifications...
Five regime classifications:
1. Extreme Contraction (code 1): Both metrics <30%, volatility squeeze
2. Contraction (code 2): One metric <40%, below average volatility
3. Normal (code 0): Both metrics 40-60%, average conditions
4. Expansion (code 3): One metric >70%, above average volatility
5. Extreme Expansion (code 4): Both metrics >85%, volatility breakout
4. Regime Transition Prediction
AVM predicts next regime through momentum analysis:
float regime_momentum = combined_score - combined_score
string momentum_direction = regime_momentum > 2 ? "Accelerating" :
regime_momentum < -2 ? "Decelerating" : "Stable"
string predicted_regime = regime_code == 4 and regime_momentum < -5 ? "→ Expansion" :
regime_code == 3 and regime_momentum < -3 ? "→ Normal" :
// Additional predictions...
"Stable"
float transition_prob = math.min(math.abs(regime_momentum) * 10, 100)
Transition probability (0-100%) based on momentum magnitude. >50% probability triggers warning.
5. Volatility Clustering Detection
Clustering identifies sustained high/low volatility periods:
int cluster_lookback = 20
float cluster_threshold = 70.0
int high_vol_count = 0
for i = 0 to cluster_lookback - 1
if combined_score >= cluster_threshold
high_vol_count += 1
float cluster_ratio = high_vol_count / cluster_lookback * 100
bool in_vol_cluster = cluster_ratio >= 60 // 60% of bars are high vol
string cluster_strength = cluster_ratio >= 80 ? "Strong" :
cluster_ratio >= 60 ? "Moderate" :
cluster_ratio >= 40 ? "Weak" : "None"
Clusters indicate persistent volatility conditions that tend to continue.
6. Historical Regime Statistics
AVM tracks regime history for context:
var array regime_history = array.new_int(0)
var array regime_durations = array.new_int(0)
if regime_changed
array.push(regime_history, regime_code)
array.push(regime_durations, bars_in_regime)
// Calculate statistics
float avg_expansion_duration = exp_sum / exp_cnt
float avg_contraction_duration = con_sum / con_cnt
float duration_ratio = bars_in_regime / avg_expansion_duration
bool regime_extended = duration_ratio > 1.5
Statistics show if current regime is extended (>1.5x average duration), suggesting potential transition.
Visual Elements
Combined Score Line: Main plot (0-100%) with regime-based coloring
ATR Percentile Overlay: Circles showing ATR percentile for comparison
Histogram: Gradient-colored bars showing volatility score with regime colors
Reference Lines: 70% (expansion), 50% (neutral), 30% (contraction), 85% (extreme)
Background Zones: Regime-colored backgrounds (purple for expansion, yellow for contraction)
Transition Warnings: ⚠ symbols when transition probability >50%
BBWP Percentile Bands: 20th, 50th, 80th percentile circles for context
Dashboard: Real-time metrics including regime, score, BBWP, ATR%, trend, duration, momentum, transition prediction, cluster status, duration ratio, historical stats
Input Parameters
BBWP Parameters:
BBWP Length: Bollinger Band period (default: 13)
BBWP Lookback: Historical comparison period (default: 252)
ATR Analysis:
ATR Period: ATR calculation period (default: 14)
ATR Percentile Lookback: Historical ranking period (default: 100)
Regime Classification:
Expansion Threshold: Score for expansion regime (default: 70%)
Contraction Threshold: Score for contraction regime (default: 30%)
Extreme Threshold: Score for extreme regimes (default: 85%)
Visualization:
Show Regime Zones: Toggle background coloring
Show Histogram: Toggle volatility histogram
Show ATR Overlay: Toggle ATR percentile circles
How to Use This Indicator
Step 1: Identify Current Regime
Check dashboard "Regime" row. Adjust strategy based on classification.
Step 2: Monitor Combined Score
Score >70% = expansion (use breakout strategies)
Score <30% = contraction (use mean reversion)
Score 40-60% = normal (use balanced approach)
Step 3: Check Momentum Direction
"Accelerating" = volatility increasing
"Decelerating" = volatility decreasing
"Stable" = no significant change
Step 4: Watch for Transition Warnings
⚠ symbols indicate >50% probability of regime change. Prepare to adjust strategy.
Step 5: Assess Cluster Status
"Strong" or "Moderate" cluster = persistent conditions likely to continue
Step 6: Consider Duration Ratio
Ratio >1.5x = extended regime, higher probability of mean reversion
Best Practices
Use regime classification to select appropriate trading strategies
Extreme contraction often precedes volatility breakouts - prepare for expansion
Extreme expansion often mean-reverts - reduce position sizes
Transition warnings provide early signal to adjust risk management
Volatility clusters suggest persistence - don't fight the regime
Extended regimes (>1.5x average) have higher reversal probability
BBWP and ATR percentile divergence suggests regime uncertainty
Historical statistics provide context for current regime duration
Combine with directional indicators - AVM shows conditions, not direction
Indicator Limitations
Regime classification is backward-looking - transitions lag actual changes
BBWP calculation is computationally intensive on large lookback periods
Transition predictions are probabilistic, not deterministic
Extreme regimes can persist longer than expected during major events
Historical statistics require sufficient data (50+ regime changes)
Clustering detection has fixed lookback - may miss longer-term patterns
Combined score weighting (60/40) may not be optimal for all instruments
Regime thresholds may need adjustment for different markets
Technical Implementation
Built with Pine Script v6 using:
Custom BBWP calculation with percentile ranking
ATR percentile analysis with normalized ATR
Weighted combined score (60% BBWP, 40% ATR)
Five-tier regime classification system
Momentum-based transition prediction with probability
Volatility clustering detection (20-bar lookback)
Historical regime tracking with arrays (last 50 regimes)
Duration ratio calculation vs historical averages
BBWP percentile bands (20th, 50th, 80th)
Adaptive background coloring based on regime and duration
Comprehensive dashboard with 12 metrics
The code is fully open-source and can be modified to suit individual trading styles.
Originality Statement
This indicator is original in its comprehensive volatility regime classification approach. While BBWP and ATR are established concepts, this indicator is justified because:
It combines BBWP and ATR percentile into weighted combined score for robust classification
The five-tier regime system provides granular volatility categorization
Momentum-based transition prediction with probability quantification is unique
Volatility clustering detection identifies persistent regime conditions
Historical regime statistics provide context for current regime duration
Duration ratio calculation identifies extended regimes with mean reversion potential
BBWP percentile bands add additional context layers
Adaptive background intensity based on regime stability
Each component contributes unique information: BBWP shows compression cycles, ATR shows absolute volatility, combined score provides robust classification, regime system categorizes conditions, transition prediction anticipates changes, clustering detects persistence, statistics provide context, and duration ratio identifies extremes. The indicator's value lies in presenting these complementary perspectives simultaneously with unified regime framework.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Regime classifications do not guarantee future volatility behavior. Trading involves substantial risk of loss. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
-Made with passion by officialjackofalltrades Indicator

Indicator

ADR Study [TFO]This indicator is focused on the Average Daily Range (ADR), with the goal of collecting data to show how often price reaches/closes through these levels, as well as a look at historical moves that reached ADR and at similar times of day to study how price moved for the remainder of the session.
The ADR here (blue line) is calculated using the difference between a day's highest and lowest points. If our ADR length is 5, then we are taking this difference from the last 5 days and averaging them together. At the following day's open, we take half of this average and plot it above and below the daily opening price to place theoretical limits on how far price may move according to the lookback period. The triangles indicate when price has reached ADR (either +ADR or -ADR), and alerts can be created for these events.
The Scale Factor is an optional parameter to scale the ADR by a certain amount. If set to 2 for example, then the ADR would be 2x the average daily range. This value will be reflected in the statistics options so that users can see how different values affect the outcomes.
Show Table will display data collected on how often price reaches these levels, and how often price closes through them, for each day of the week. By default, these are colored as blue and red, respectively. From the following chart of NQ1!, we can see for example that on Mondays, price reached +ADR 38% of the time and closed through it 23% of the time. Note that the statistics for closing through the ADR levels are derived from all instances, not just those that reached ADR.
Show Sample Sizes will display how many instances were collected for all given sets of data. Referring to the same example of NQ1!, we can see that this particular chart has collected data from 109 Mondays. From those Mondays, 41 reached +ADR (38%, verifying our initial claim) and 25 closed through it (23%). This is important to understand the scope of the data that we're working with, as percentages can be misleading for smaller sample sizes.
Show Histogram will plot the same exact data as the table, just in a histogram form to visually emphasize the differences on a day-by-day basis. On this chart of RTY1!, we can see for example from the top histogram that on Wednesdays, 40% reached +ADR and only 22% closed through it. Similarly if we look at the bottom histogram, we can see that Wednesdays reached -ADR 46% of the time and closed through it only 28% of the time.
We can also use Show Sample Sizes to display the same information that would be in the table, showing how many instances were collected for each event. In this case we can see that we observed 175 Fridays, where 76 reached +ADR (43%) and 44 closed above it (25%).
Show Historical Moves is an interesting feature of this script. When enabled, if price has reached +/- ADR in the current session, the indicator will plot the evolution of the close prices from all past sessions that reached +/- ADR to see how they traded for the remainder of the session. These calculations are made with respect to the ADR range at the time that price traded through these levels.
Historical Proximity (Bars) allows the user to observe historical moves where price reached ADR within this many bars of the current session (assuming price has reached an ADR level in the current session). In the above chart, this is set to 1000 so that we can observe each and every instance where price reached an ADR level. However, we can refine this a bit more.
By limiting the Historical Proximity to something like 20, we are only considering historical moves that reached ADR within 20 bars of todays +ADR reach (9:50 am EST, noted by the blue triangle up). We can enable Show Average Move to display the average move by the filtered dataset, and Match +/-ADR to only observe moves inline with the current day's price action (in this case, only moves that reached +ADR, since price has not reached -ADR).
We can add one more filter to this data with the setting Only Show Days That: closed through ADR; closed within ADR; or either. The option either is what you see above, as we are considering both days that closed through ADR and days that closed within it (note that in this case, closing within ADR simply means that price reached +ADR and closed the day below it, and vice versa for -ADR; this does not mean that price must have closed in between +ADR and -ADR). If we set this to only show instances that closed within ADR, we see the following data.
Alternatively, we can choose to Only Show Days That closed through ADR, where we would see the following data. In this case, the average move very much resembles the price action that occurred on this particular day. This is in no way guaranteed, but it makes an interesting case for how we could use this data in our analysis by observing similar, historical price action.
Please note that this data will change over time on a rolling basis due to PulseWire's bar lookback, and that for this same reason, lower timeframes will yield less data than larger timeframes. Indicator

Historical Price Projection [LuxAlgo]The Historical Price Projection tool aims to project future price behavior based on historical price behavior plus a user defined growth factor.
The main feature of this tool is to plot a future price forecast with a surrounding area that exactly matches the price behavior of the selected period, with or without added drift.
Other features of the tool include:
User-selected period up to 500 bars anywhere on the chart within 5000 bars
User selected growth factor from 0 (no growth) to 100, this is the percentage of drift to be used in the forecast.
User selected area wide
Show/hide forecast area
🔶 USAGE
This tool generates a price projection with exactly the same price behavior over the period selected by the user, plus a growth factor .
The user must confirm the selection of the anchor point in order for the tool to be executed; this can be done directly on the chart by clicking on any bar, or via the date field in the settings panel.
As we can see on this chart, the four phases of the market cycle are clearly defined and marked, so we choose the distribution phase as our anchor point because in our analysis, we want to see how the market would behave if we were currently at the same point in the cycle.
In the image above, the growth factor parameter is set to 0 so that the projection matches the selection. The tool will use up to 500 bars after the selection point.
The growth factor is defined as the percentage of drift that the tool will use.
Drift is defined as follows:
For periods with a positive return: average negative return within the period
For negative return periods: average positive return within the period
On the chart above, we have selected the same period but added a growth factor of 10, so that the tool uses a 10% drift in its calculations of future prices.
As the return in the selected period is negative, the added drift will make the projection more bearish than the prices from the selection.
On this chart we have changed the selected period, we have chosen the accumulation phase of the last cycle as the anchor point, again with a growth factor of 10%.
As we can see, prices explode higher, making the projection very bullish, as the added effect of both the bullish selected period and the 10% drift is taken into account.
This last chart is a long-term chart, a quarterly chart of the Dow, and it will serve as a review exercise.
What if... everything goes south and the crash of '29 is repeated?
The answer is in the chart, and it is not for the faint of heart
In this case we have chosen a growth factor of 0 to see exactly the same price behaviour projected into the future.
🔶 SETTINGS
🔹 Data Gathering
Anchor point: Starting point for data collection, up to 500 bars will be used.
🔹 Data Transformation
Growth Factor: Values from 0 to 100, is the amount of drift used to calculate the next price in the series.
Area Width: Values from 0 to 100, controls the width of the area around the forecast as an increment/decrement of the growth factor.
🔹 Style
Price line width: Size of the price line.
Bullish color
Bearish color
Show Area: Show forecast area.
Area color
Indicator

Indicator

Indicator

Indicator

Indicator

Indicator

Volatility Gap TrackerThe Volatility Gap Tracker ( *VGT ) indicator calculates the historical volatility of an asset using the standard deviation of the natural logarithm of the closing price relative to the previous period's closing price. *VGT visualizes the HV with gap lines to highlight when the current HV has increased or decreased significantly compared to the previous period, and adds labels to show the HV value for each of those bars.
Low HV calculated by *VGT can potentially signify a potential move up or down in the price of an asset. When HV is low, it indicates that the price of the asset has been relatively stable or range-bound over the specified period of time. This can sometimes be a precursor to a significant move in either direction, as the price may be building up energy to break out of its range.
*VGT can be used for any market that PulseWire supports, including stocks, forex, and cryptocurrencies. It is especially useful for traders who want to identify periods of high volatility or sudden changes in volatility , which can indicate potential trading opportunities or risks. However, it's important to note that HV is a historical measure and may not always accurately predict future volatility .
The indicator can be used under various market conditions, but is especially useful during periods of high volatility , such as market crashes or major news events. It can also be useful for traders who want to monitor the volatility of specific stocks or assets over a longer period of time.
*VGT is provided for informational purposes only and is not a guarantee of future performance or accuracy. Traders should use multiple indicators and analysis methods to make informed trading decisions. Trading involves risks and traders should always conduct their own research and analysis before making any investment decisions. Indicator

Multi-Asset Month/Month % change 10yr Averages10 Year Averages of Month-on-Month % change: Shows current asset, and 3x user input assets
-For comparing seasonal tendencies among different assets.
-Choose from a variety of monthly average measures as source: sma(close, length), sma(ohlc4, length); as well as sma's of vwap, vwma, volume, volatility. (sma = simple moving average).
-Averages based on month cf previous month: i.e. Feb % = Feb compared to Jan; Jan % = Jan compared to prev year's Dec. Average of the last 10yrs of these values is the printed value.
-Plot on current year (2023), or previous year (2022). If Plotting on current year, and a month of year has not yet occured, a 9yr average will be printed.
/// notes ///
-daily bars in month is a global setting; so choose assets which have similar trading days per month. i.e. Crypto: length = 30 (days per month); Stocks/FX/Indices: length = 21 (days per month).
-only plots on Daily timeframe.
10yr Avgs; Plotting with Year = 2022; using sma(close, 21) as source for average M/M change
Indicator

Indicator

Indicator

Indicator

10yr, 20yr, 30yr Averages: Month/Month % Change; SeasonalityCalculates 10yr, 20yr and 30yr averages for month/month % change
~shows seasonal tendencies in assets (best in commodities). In above chart: August is a seasonally bullish month for Gold: All the averages agree. And January is the most seasonally bullish month.
~averages represent current month/previous month. i.e. Jan22 average % change represents whole of jan22 / whole of dec21
~designed for daily timeframe only: I found calling monthly data too buggy to work with, and I thought weekly basis may be less precise (though it would certainly reduce calculation time!)
~choose input year, and see the previous 10yrs of monthly % change readings, and previous 10yrs Average, 20yr Average, 30yr Average for the respective month. Labels table is always anchored to input year.
~user inputs: colors | label sizes | decimal places | source expression for averages | year | show/hide various sections
~multi-yr averges always print, i.e if only 10yrs history => 10yr Av = 20yr Av = 30yr Av. 'History Available' label helps here.
Based on my previously publised script: "Month/Month Percentage % Change, Historical; Seasonal Tendency"
Publishing this as seperate indicator because:
~significantly slower to load (around 13 seconds)
~non-premium users may not have the historical bars available to use 20yr or 30yr averages =>> prefer the lite/speedier version
~~tips~~
~after loading, touch the new right scale; then can drag the table as you like and seperate it from price chart
##Debugging/tweaking##
Comment-in the block at the end:
~test/verifify specific array elements elements.
~see the script calculation/load time
~~other ideas ~~
~could tweak the array.slice values in lines 313 - 355 to show the last 3 consecutive 10yr averages instead (i.e. change 0, 10 | 0,20 | 0, 30 to 0, 10 | 10, 20 | 20,30)
~add 40yr average by adding another block to each of the array functions, and tweaking the respective labels after line 313 (though this would likely add another 5 seconds to the load time)
~use alternative method for getting obtaining multi-year values from individual month elements. I used array.avg. You could try array.median, array.mode, array.variance, array.max, array.min (lines 313-355)
Indicator

Month/Month Percentage % Change, Historical; Seasonal TendencyTable of monthly % changes in Average Price over the last 10 years (or the 10 yrs prior to input year).
Useful for gauging seasonal tendencies of an asset; backtesting monthly volatility and bullish/bearish tendency.
~~User Inputs~~
Choose measure of average: sma(close), sma(ohlc4), vwap(close), vwma(close).
Show last 10yrs, with 10yr average % change, or to just show single year.
Chose input year; with the indicator auto calculating the prior 10 years.
Choose color for labels and size for labels; choose +Ve value color and -Ve value color.
Set 'Daily bars in month': 21 for Forex/Commodities/Indices; 30 for Crypto.
Set precision: decimal places
~~notes~~
-designed for use on Daily timeframe (pulsewire is buggy on monthly timeframe calculations, and less precise on weekly timeframe calculations).
-where Current month of year has not occurred yet, will print 9yr average.
-calculates the average change of displayed month compared to the previous month: i.e. Jan22 value represents whole of Jan22 compared to whole of Dec21.
-table displays on the chart over the input year; so for ES, with 2010 selected; shows values from 2001-2010, displaying across 2010-2011 on the chart.
-plots on seperate right hand side scale, so can be shrunk and dragged vertically.
-thanks to @gabx11 for the suggestion which inspired me to write this Indicator

Indicator

Last Available Bar InfoLibrary "Last_Available_Bar_Info"
getLastBarTimeStamp()
getAvailableBars()
This simple library is built with an aim of getting the last available bar information for the chart. This returns a constant value that doesn't change on bar change.
For backtesting with accurate results on non standard charts, it will be helpful. (Especially if you are using non standard charts like Renko Chart).
Methods
getLastBarTimeStamp()
: Returns Timestamp of the last available bar (Constant)
getAvailableBars()
:Returns Number of Available Bars on the chart (Constant)
Example
import paragjyoti2012/Last_Available_Bar_Info/v1 as LastBarInfo
last_bar_timestamp=LastBarInfo.getLastBarTimeStamp()
no_of_bars=LastBarInfo.getAvailableBars()
If you are using Renko Charts, for backtesting, it's necesary to filter out the historical bars that are not of this timeframe.
In Renko charts, once the available bars of the current timeframe (based on your Tradingview active plan) are exhausted,
previous bars are filled in with historical bars of higher timeframe. Which is detrimental for backtesting, and it leads to unrealistic results.
To get the actual number of bars available of that timeframe, you should use this security function to get the timestamp for the last (real) bar available.
tf=timeframe.period
real_available_bars = request.security(syminfo.ticker, tf , LastBarInfo.getAvailableBars() , lookahead = barmerge.lookahead_off)
last_available_bar_timestamp = request.security(syminfo.ticker, tf , LastBarInfo.getLastBarTimeStamp() , lookahead = barmerge.lookahead_off)
Library

Indicator

vol_rangesThis script shows three measures of volatility:
historical (hv): realized volatility of the recent past
median (mv): a long run average of realized volatility
implied (iv): a user-defined volatility
Historical and median volatility are based on the EWMA, rather than standard deviation, method of calculating volatility. Since Tradingview's built in ema function uses a window, the "window" parameter determines how much historical data is used to calculate these volatility measures. E.g. 30 on a daily chart means the previous 30 days.
The plots above and below historical candles show past projections based on these measures. The "periods to expiration" dictates how far the projection extends. At 30 periods to expiration (default), the plot will indicate the one standard deviation range from 30 periods ago. This is calculated by multiplying the volatility measure by the square root of time. For example, if the historical volatility (hv) was 20% and the window is 30, then the plot is drawn over: close * 1.2 * sqrt(30/252).
At the most recent candle, this same calculation is simply drawn as a line projecting into the future.
This script is intended to be used with a particular options contract in mind. For example, if the option expires in 15 days and has an implied volatility of 25%, choose 15 for the window and 25 for the implied volatility options. The ranges drawn will reflect the two standard deviation range both in the future (lines) and at any point in the past (plots) for HV (blue), MV (red), and IV (grey). Indicator

Indicator
