Indicatore

CyclesCycle Days — Weekdays & Month Dates
A visual cycle-analysis tool for TradingView. It highlights the days you care about so weekly and monthly patterns are easy to see on any timeframe.
Use it to mark Mondays, Fridays, the 15th, month-end, or any mix of those dates. Background tint, vertical lines, and labels are optional.
What it does
The indicator colors every bar that matches your rules:
> selected weekdays (Mon–Sun)
> selected calendar dates of the month (for example 15 or 1,15,31)
> optionally the last calendar day of each month
On lower timeframes the whole day is shaded. The vertical line and label appear only on the first bar of that day so the chart stays readable.
Features
> Three modes: Weekdays, Month dates, or Both
> Separate on/off switch and color for each weekday
> Month dates entered as a comma-separated list (15, 1,15,31)
> Optional last-day-of-month highlight
> Optional shift: if the chosen date falls on a weekend, mark the nearest weekday instead (useful for stocks and futures)
> Timezone: Exchange, UTC, Moscow, Kyiv, London, New York, Shanghai
> Display toggles: background fill, dotted vertical line, label
> Labels show MON / 15 / 31 (month end)
How to use:
Add the script to the chart from Pine Editor → Add to chart.
Open indicator settings.
Pick a mode.
Enable the weekdays you want, or type month dates in the input field.
Adjust colors and display options.
Notes
Time is taken from the bar open in the selected timezone. Overnight sessions can sit on the previous calendar day.
Weekend shift is meant for markets that are closed Sat–Sun. Leave it off for 24/7 crypto.
This is a visual aid only. It does not generate buy/sell signals.
Disclaimer
For educational and charting use. Not financial advice. Always verify the script on your instrument and timeframe before relying on it. Indicatore

INDEX Dashboard + Round Number MagnetThis TradingView indicator plots a pre-market dealer map for SPX based on the levels described by @azrael_options.
It draws the daily expected-move envelope from a reference close and the ATM straddle (1σ budget), the halfway shelves, the reference/magnet level, and two user-defined gamma walls (typically the nearest heavy-OI round strikes). A light box highlights the session range so you can see at a glance whether price is trading inside dealer parameters or outside them.
Each morning you update four numbers: previous close (or cash-converted overnight ES reference), ATM straddle points, lower gamma wall, and upper gamma wall. The script then draws the ±1σ walls, ±0.5σ shelves, and gamma levels automatically. A close beyond the outer walls is treated as the session invalidation.
The overlay is meant to replace discretionary chart lines with the same coordinates used in the five-minute open routine: mark the gap, price the straddle as the day’s budget, plot the boundaries, and size to 1R against those fixed levels. Indicatore

Daily Stock Stats | ADR, Levels & LiquidityDaily Stock Stats displays key stock metrics in a compact panel that can be positioned anywhere on your chart.
• ADR%: Average high-to-low percentage range over the selected lookback, defaulting to 20 daily bars. Choose Daily or Chart timeframe calculations.
• Move: Today’s percentage change from the previous regular-session close, expressed as a multiple of ADR. A stock up 4% with a 2% ADR displays +2.00x.
• LOD / HOD: Percentage distance from the current price to today’s low and high, using the current price as the denominator.
• Avg $ Volume: Average daily close × volume over completed trading days, defaulting to 20 days and adjustable to 30 or another lookback.
• Market Cap: Latest available shares outstanding × current price, converted to USD and formatted with two decimals and K/M/B suffixes.
• Sector / Industry: TradingView’s classifications for the symbol.
Customization includes nine panel positions, text size, background color, line order, and separate colors for each label—including its colon—and value. Set a line’s order to 0 to hide it.
Daily statistics use regular-session candles. Intraday HOD and LOD include the sessions visible on the chart. Daily ADR includes the developing day. Unavailable data displays as N/A. Indicatore

CPI Strat - Points, Levels & SentimentCPI Strat — Points, Levels & Sentiment
CPI Strat is a clean, visual level-based trading tool designed to help traders quickly identify potential long and short entry zones and predefined profit targets.
The indicator automatically calculates Long and Short Entry levels from the current market price using a customizable point offset, along with corresponding Take Profit levels.
Key Features
🟢 Long Levels
Automatically calculates a long entry and upside target.
🔴 Short Levels
Automatically calculates a short entry and downside target.
📏 Customizable Point Levels
Adjust the Entry Offset and Target Distance to fit your trading style and instrument.
📊 Market Sentiment Dashboard
A compact dashboard displays the current market sentiment as BULLISH, BEARISH, or NEUTRAL, based on the current candle.
💡 Clear Price Levels
Each level displays the actual price as well as the corresponding point distance, making the setup easy to read directly from the chart.
✨ Clean Visual Design
Bright, solid green long levels and red short levels provide an easy-to-read visual framework without cluttering the chart.
Example
With an Entry Offset of 25 points and a Target Distance of 15 points:
LONG
Entry: +25 points
Target: +40 points
SHORT
Entry: −25 points
Target: −40 points
The goal of CPI Strat is to provide a simple, structured visual framework for planning potential trade levels and quickly assessing current market direction.
Disclaimer: This indicator is an analytical tool and does not provide financial advice or guarantee trading results. Always use proper risk management and conduct your own analysis before entering a trade. Indicatore

GM RSI Hook v1.3 - Regular + Hidden DivergenceGM RSI Hook – ADX & Divergence
GM RSI Hook highlights RSI momentum turns and confirmed regular and hidden divergence in a separate indicator panel.
The default setup combines:
• RSI: 14 periods, calculated from close.
• WMA: 6 periods, applied directly to RSI.
• EMA: 3 periods, applied directly to RSI.
RSI HOOK SIGNALS
A bullish hook occurs when RSI changes from falling to rising after forming a trough below the lower threshold, default 30.
A bearish hook occurs when RSI changes from rising to falling after forming a peak above the upper threshold, default 70.
Hooks are confirmed at candle close. The confirming RSI value may already be back inside the threshold. No EMA/WMA crossover is required.
Thresholds, lengths and display settings are adjustable.
OPTIONAL ADX FILTER
Choose between:
• Off: no ADX restriction.
• Below limit: ADX must be below the selected limit.
• Falling: ADX must be lower than on the previous candle.
• Both: ADX must be below the limit and falling.
Defaults are DI length 14, ADX smoothing 14 and limit 25. The filter is off by default.
REGULAR AND HIDDEN DIVERGENCE
The indicator compares consecutive confirmed price pivots with RSI values on those same candles.
• REG+: price makes a lower low while RSI makes a higher low.
• REG−: price makes a higher high while RSI makes a lower high.
• HID+: price makes a higher low while RSI makes a lower low.
• HID−: price makes a lower high while RSI makes a higher high.
Select Regular, Hidden or Both. Price pivots can use High/Low or Close. Hidden divergence detection does not include a separate trend filter.
CONFIRMATION AND TIMING
Default pivot settings use three candles to the left and two confirmation candles to the right. Divergence therefore becomes available at the close two candles after the pivot.
Markers appear on the confirmation candle and are not shifted backward onto the earlier pivot.
An optional setting requires a recent confirmed divergence before a new hook can qualify. The default validity window is 10 subsequent candles. Earlier hooks are not replayed when divergence is confirmed later.
ALERTS
Separate alerts are available for bullish and bearish hooks, regular divergence and hidden divergence.
Divergence alerts operate independently of the hook thresholds and ADX filter. Enable the desired alert options and create a TradingView alert.
USAGE AND LIMITATIONS
Use the indicator to study momentum changes alongside price structure and your own trading rules. Divergence can occur outside the 30/70 zones, and RSI can remain extreme during strong trends.
Signals do not guarantee a price reversal. This is an indicator, not an automated trading strategy, and it does not define stop-loss, take-profit or position sizing. Indicatore

Adaptive Statistical Location + Pressure Engine V1Adaptive Statistical Location + Pressure Engine — V1
ASLP describes where price sits relative to historical daily and session excursions, whether the current movement is directional or two-sided, and whether expansion is strengthening or deteriorating. When enough comparable resolved events exist, it also displays empirical first-touch outcome estimates.
Its distinguishing design combines separate upside/downside excursion distributions, independent daily/session context, non-overlapping pressure observations, and a causal event database. It keeps statistical location, movement consumption and future outcomes separate.
A high percentile describes an extended location. It does not, by itself, imply a reversal or provide a buy/sell instruction.
1. Reading the display
Teal curve: signed location relative to the selected session open.
Purple curve: signed location relative to the trading-day open.
Positive values: price is above the corresponding open; magnitude is its upper-excursion percentile.
Negative values: price is below the corresponding open; magnitude is its lower-excursion percentile. A reading of -90 means the 90th percentile of downside excursion, not the 10th percentile of a symmetric price distribution.
Zero: the corresponding open. Location is not a distance scale: a 10-point change on the pane does not mean a fixed price change.
State ribbon: green indicates expansion, darker green strong expansion, gold two-sided volatility, blue an extreme state, orange/red an exhaustion candidate, and purple reversion in progress. Gray shades represent normal, compressed or unavailable context. The ribbon's vertical position is a layout choice, not a score.
Small pane markers: circles identify extreme entries; red diamonds identify exhaustion candidates. Price-chart text and event paths are off by default.
Dashboard: Compact emphasizes location, state, pressure and the most recent event forecast. Detailed and Research expose additional diagnostics.
Curves deliberately break when their session/day reference changes or a valid estimate is unavailable. Connecting different opens would imply continuity that does not exist. The subtle daily boundary tint appears in the indicator pane.
2. What location measures
For each completed historical period, the engine stores percentage Open-to-High and Open-to-Low excursions separately. During an active period it compares the current close's displacement from that period's open with the appropriate historical distribution.
Upper location = 100 × fraction of matched historical upper excursions less than or equal to the current upward displacement.
Lower location = 100 × fraction of matched historical lower excursions less than or equal to the current downward displacement.
For example, an upper reading of 90 means the current upward displacement equals or exceeds 90% of sampled historical upper excursions. It does not mean a 90% chance of continuation or reversal. Finite-sample readings can reach 100 without imposing a price ceiling.
Movement matching uses weekday, session, completed-day volatility regime and previous completed-period state where supported, then relaxes conditioning when samples are sparse. The selected historical distributions are frozen at the start of the active period.
Default location regions
Below 25: Central.
25 to below 75: Normal.
75 to below 90: Stretch.
90 to below 95: Extreme.
95 and above: Tail.
The direction is reported separately as Upper or Lower. These are empirical descriptive regions, not fair-value estimates. Daily and session location use independent opens and distributions; a stretched session can coexist with a normal daily reading. Benchmarks are completed-period distributions, not same-minute-of-session distributions, so an early session can naturally look compressed.
3. Range, efficiency and pressure
Range percentile: ranks the active High-Low range against historical completed ranges. It measures total movement, not where the close sits.
Consumption: current range divided by historical Q50, Q75 or Q90 range. Consumption above 100% means that historical quantile has been exceeded; it does not mean price has exhausted a fixed allowance.
Directional efficiency: abs(Close-Open)/(High-Low). High values indicate net displacement accounts for much of the observed range.
Close Location Value: ((Close-Low)-(High-Close))/(High-Low). Its -1 to +1 scale identifies where the close sits inside the active range. A separate direction-adjusted close rank evaluates proximity to the movement's own extreme.
Marginal progress: over completed non-overlapping blocks, the engine divides signed close progress by incremental range, with a denominator floor of 0.05 × frozen Q50 by default. This limits instability when range barely grows. The value can exceed 1 and is not a probability.
Marginal progress is ranked against historical blocks from the same session and elapsed-age bucket. The direction must remain consistent across the block. Default blocks are 30 minutes.
Pressure categories
Strengthening: efficiency and direction-adjusted close ranks are at least the 75th percentile, marginal progress rank is at least the 50th percentile, signed progress is positive, and price extends the directional extreme.
Weakening: efficiency declines, price retreats from the directional extreme, and either marginal rank is at or below the 25th percentile or signed progress is negative.
Stable: a rated block meets neither condition.
Unrated: insufficient valid block history. This is not evidence of stable pressure.
Pressure reflects completed blocks and can remain unchanged between them. Efficiency and close ranks use completed-period benchmarks; they are descriptive comparisons, not calibrated future-outcome probabilities.
4. State and exhaustion logic
Compressed so far: range percentile is below the Central boundary. This does not predict that the completed session will remain compressed.
Directional expansion: range percentile reaches the Stretch threshold, while efficiency and directed-close ranks both reach 75.
Strong expansion: directional expansion plus strengthening pressure.
Two-sided volatility: range reaches the Stretch threshold while efficiency rank is 25 or lower.
Statistical extreme: location reaches the Extreme threshold when a higher-priority state does not apply.
Exhaustion candidate: the same direction previously expanded during this session, location remains extreme, range reaches the Stretch threshold, and pressure weakens.
Reversion in progress: after an exhaustion candidate, price crosses the session open in the opposing direction.
States follow an explicit precedence rather than displaying overlapping categories. Exhaustion requires deterioration after expansion. The separate toward-open event outcome below can occur before any cross of the session open.
5. Empirical first-touch outcomes
Eligible observations come from expansion, extreme-entry and post-expansion weakening states. Their forecasts and barriers are frozen at the confirmed entry close. Observation starts on the following candle.
With default settings, an event records which of these happens first:
Continuation first (C): price travels another 0.25 × frozen session Q50 in the event direction.
Toward-open first (R): price travels 0.35 × Q50 against that direction, capped at the distance back to the session open. R means a retracement toward the open, not necessarily a full trend reversal.
Timeout: neither barrier is reached within 120 minutes or before the source session ends, whichever comes first.
Ambiguous: both barriers are touched in the same candle and OHLC cannot establish their order. If the candle opens beyond a barrier, that known first observation is used; otherwise the event remains a separate ambiguous class.
Invalid/gapped observations can be censored and excluded from outcome training. There is one pending event across the engine at a time. Each session instance can admit each direction/family combination only once, with optional admission at completed-block checkpoints. This prevents repeatedly labeling every candle of one sustained condition.
The dashboard percentages belong to the timestamped last admitted event. They are not continuously recalculated predictions for the latest candle. Compact shows C and R; Detailed also shows Timeout and Ambiguous. The four classes sum to 100% before display rounding.
6. Samples, fallback and uncertainty
A forecast requires at least 40 resolved events in its selected bucket by default. Total learned events can be much larger than the number matching a particular state.
Core matching uses session, location and pressure, while always preserving direction, elapsed-age bucket and event family. Fallback progressively removes session, pressure and location. The optional broadest fallback also pools event families while retaining direction and age. Such estimates are explicitly labeled broad/pooled; they are not precise forecasts for one narrow state.
When at least 20 records exist in the broader parent group outside the selected bucket, estimates are shrunk toward that disjoint group's frequencies. The default prior weight is 20. Otherwise raw frequencies are used. Prior weight never increases the reported observed sample count.
Optional regime, weekday or previous-state refinement is selected only when supported by paired historical forecast errors: at least 60 evaluations and mean Brier improvement greater than 2.4 estimated standard errors. Only one additional feature is selected at a time. This is a practical screening rule, not proof that a feature will remain useful.
Reliability labels follow explicit rules:
Insufficient: fewer observations than Minimum outcome bucket n.
Low / broad fallback: location-only, family-base or pooled-family matching.
Moderate: a more specific bucket with at least 80 events and maximum raw class-wise Wilson interval width no greater than 22 percentage points.
Good (nominal): a more specific bucket with at least 160 events and maximum interval width no greater than 16 percentage points.
Low: other supported forecasts.
Research mode reports raw 95% Wilson intervals for C and R. These are nominal binomial intervals around unshrunk class frequencies, not posterior intervals around the displayed shrunk probabilities. Serial dependence and market change can make actual uncertainty larger.
7. Setup and daily/session timing
Use standard time-based candles on a positive-priced instrument. Start with 5-minute or 15-minute charts. The script accepts 1–30 minutes; pressure blocks and outcome horizons must be exact multiples of the selected timeframe.
Leave Daily reset reference at Symbol trading day to follow the data feed's daily-bar boundaries. Use Custom timezone boundary only when a different analytical day is intended. DAY START shows the active anchor and its timezone.
Configure sessions to match available trading hours. Session candles must not straddle configured boundaries. Each session's IANA timezone handles its own daylight-saving changes; changing the chart's display timezone does not redefine these sessions.
For 24/7 crypto, enable Include weekends. Defaults exclude weekends.
Wait for movement and event warm-up. Start with Compact, then use Detailed to inspect consumption and Research to inspect forecast evidence.
Default independent session windows:
Asia: 09:00–17:00, Asia/Tokyo.
London: 08:00–12:00, Europe/London.
London/NY overlap: 12:00–16:00, Europe/London.
New York: 09:00–15:00, America/New_York.
NY PM: 15:00–17:00, America/New_York; disabled by default.
These are configurable analytical windows, not universal exchange definitions. The overlap window is London-timed and does not automatically recalculate the true intersection of London and New York hours during differing DST transition weeks. Auto priority selects the highest-numbered enabled active session: NY PM, New York, overlap, London, then Asia. Independent session statistics continue to update, but event admission follows the focus session.
8. Parameter guide
Sampling: completed session/day/block caps default to 1200/500/2400. Minimum distribution n is 30. These caps bound retained records, not how much data TradingView loads. Completed-day regime mean length defaults to 10; the period-range data guard is 50%. Regime and previous-state movement conditioning are enabled.
Daily gap treatment: Observed feed permits maintenance closures inside daily aggregation. Strict contiguous rejects gaps. The default cannot distinguish planned closures from missing data; analytical sessions, pressure blocks and outcome labels still apply gap checks.
Location / pressure: Central/Stretch/Extreme/Tail boundaries default to 25/75/90/95. Pressure blocks default to 30 minutes; the marginal denominator floor is 0.05 × Q50. These thresholds are explicit model choices, not statistically optimized constants.
Outcome storage and support: retain up to 1200 resolved events; minimum bucket size 40; prior strength 20. Pooled-family fallback and completed-block checkpoint admission are enabled by default.
Outcome definition: horizon 120 minutes, continuation distance 0.25 × Q50, toward-open distance 0.35 × Q50, minimum entry displacement 0.10 × Q50. Changing these settings changes the question being estimated and rebuilds the historical labels.
Optional feature gate: enabled by default; paired evaluation window 200 and minimum evaluations 60. Turning it off uses the core/fallback model rather than forcing every optional feature into conditioning.
Probability alerts: default threshold 60%. These can fire only on a newly admitted event with sufficient empirical support.
Display: Compact, Detailed or Research; Light/Dark theme; Small/Normal/Large font. Dashboard, historical location and state ribbon are enabled by default. Price labels, nearest-level tags, active price zone and event paths are optional.
Label controls: text on price requires the master Research: allow text labels on price switch plus the relevant marker/path option. Marker cap defaults to 100; event-path retention defaults to 70. These affect drawing retention, not learning.
Historical research / audit: defaults to the last 300 eligible resolved observations. Entry-from and resolution-through timestamps filter audit inclusion, not the underlying training history. The audit table appears only in Research mode. Session-reset dots can be enabled independently.
9. Historical evaluation and alerts
Research mode compares forecasts frozen at entry with later first-touch outcomes. It reports model and broader-base Brier loss on the same supported events, Brier skill, most-likely-class accuracy, and mean predicted versus observed R frequency. Lower Brier loss is better. Zero skill means no improvement over the baseline; negative skill means worse performance. This is a forecast-quality audit, not a trading strategy backtest: it has no entries/exits, costs, slippage or portfolio P&L.
Supported historical entry forecasts, barrier prices and entry/result timestamps are available in the Data Window. Use the entry timestamp to associate an outcome with its original forecast. Unscored warm-up observations are not retroactively assigned predictions using later data.
Available alerts cover upper/lower extreme entry, strong expansion, weakening pressure, upper/lower exhaustion candidates, empirical C/R thresholds, and resolved C/R outcomes. Configure alerts for Once Per Bar Close. Statistical alerts describe observed conditions or empirical event forecasts; they are not order instructions.
10. Training and limitations
State changes use confirmed chart bars. Resolved outcomes enter training only on a later bar, never while their future outcome is unknown.
Training is reconstructed from the chart data available on each execution. There is no persistent external model, imported pretrained weights, or hidden additional intraday history.
A historical lookup buffer is different from the total number of executed chart bars. Increasing record caps cannot manufacture older candles or independent events.
Session coverage, symbol feed, chart timeframe and loaded start date affect samples and results. Some instruments cannot supply complete coverage for the default sessions.
Incomplete starting periods and invalid observations are excluded where applicable. Missing estimates remain unavailable instead of being filled with invented values.
No lower-timeframe reconstruction is used to resolve within-candle ordering. Ambiguous outcomes remain visible as their own class.
Changing parameters, chart history or feed data rebuilds the study and can change results. Confirmed-bar processing does not make the study invariant to those changes.
Adjacent events can remain dependent despite de-duplication. Small samples, feature selection and changing market structure limit inference. No predictive advantage or profitability is claimed.
Author and license
V1 is the first public release by uPaSKaL. Source code is distributed under the Mozilla Public License 2.0. Indicatore

YURI Fixing Window EngineTwo things happen on an FX chart at a fixed hour of the local clock, and neither is a reading taken off price. A benchmark rate is struck, and on certain calendar dates a Japanese settlement convention decides who has to be finished by then. This marks where those windows sit on the chart, says whether today is one of those dates, and keeps a day by day record of what price did across the window on the days that have already finished. It prints that record as medians, as shares, and with the number of days behind each figure, because the number of days is what decides whether any of it means anything.
HOW TO USE IT
Put it on an intraday forex chart of sixty minute bars or finer. The Tokyo window needs a pair with a JPY leg; the London window accepts any forex pair. Anything else is refused by name in the status line. Choose the window with Fixing window.
Scroll back before reading anything. The record is built from the days the chart has loaded, and the count of days printed beside every figure is the first thing to look at. How many days that is depends on the bar length and on how many bars your plan serves: the fifteen minute chart this was checked on loaded about 120 days, and a five minute chart holds fewer.
On price, the shaded bands show where the window sits each day: the interval before the fix, the bar carrying it, and the interval after. Orange is a settlement date, blue is any other date.
In the table, Settlement calendar says whether today is a settlement date and which rule made it one. Today gives the two moves for the current day as they arrive, the run into the fix and the move after it. The four rows under that are the record, split into settlement dates and other dates: the median move, the share of days it went up or went the other way from the run up, the error on that share, and the number of days behind it. Compare a settlement row with the row for other dates, and compare the gap between them with the errors printed beside both.
On a weekend or a holiday the top rows say there is no trading date and the record rows still read.
Minutes before the fix and Minutes after the fix move the two intervals. Changing either one rebuilds the record on the new definition.
WHAT THE CALENDAR IS
The convention is the one usually called gotobi. Japanese settlement clusters on the 5th, the 10th, the 15th, the 20th, the 25th and the last day of the month, and the account usually given of it is that an importer settling on one of those dates has to have bought its currency by the reference rate that morning. That account is what the record below lets a reader check rather than something this script establishes.
Two things follow that this script has to say out loud. First, it holds no holiday table, so it carries the weekend half of the rule only: a settlement date that lands on a Saturday or a Sunday flags the Friday before it, and a date that lands on a Japanese bank holiday is flagged on the holiday itself rather than on the business day the convention would move it to. The table names which rule produced today's flag, and the roll is an input so a reader can see the calendar with and without it. Over 2024 and 2025 the plain dates give 115 flags and the weekend roll adds 39 more.
Second, the flag is evaluated on the calendar date of the fixing window's own city. The Tokyo window reads a Tokyo date, the London window a London date. Both are the same nominal date; they are simply two different instants.
The calendar was checked against an independent implementation written from the calendar rather than from this code, on every date from 2000-01-01 to 2035-12-31, in both timezones, at five different local hours per date, with the roll rule on and off. That is 262980 comparisons and no disagreement. Leap day, the 28th of a short February, month ends that fall on a multiple of five and month ends that do not, year end, and the Friday that absorbs both a Saturday the 30th and a Sunday the 31st are each pinned as their own case. Across those thirty six years the flag lands on 29.5 percent of weekdays, which is about six and a half dates a month.
WHICH BAR CARRIES THE FIX
The fix is an instant and a chart is made of bars, so the script takes the first bar of the day whose close falls at or after the fix minute and within one bar length of it. On a five minute chart of the Tokyo window that bar closes exactly at 09:55 and the offset is zero. On an hourly chart the nearest close is 10:00 and the offset is five minutes, which the table prints. The London fix sits on the hour, so an hourly bar closes on it exactly.
The same rule sets the two ends of the measurement. The near end is the last close at or before the requested number of minutes ahead of the fix; the far end is the first close at or after the requested number of minutes past it. On a chart whose bars do not land on those minutes the interval that gets measured is longer than the one asked for, so the table prints both. At the default 45 and 90 minutes, a five minute chart measures exactly 45 and 90, and an hourly chart measures 60 and 120.
A day whose bars miss the fix minute by more than one bar length, or whose ends fall outside that tolerance, is counted out by name instead of being pooled with the rest, and the table shows how many days that has happened to. The alternative is a record quietly containing days whose windows were a different length from the ones it claims.
Daylight saving is handled by naming the timezone rather than by an offset. On real hourly bars from 2023-12 to 2026-09 the London fix bar sits at two different UTC hours across the window and at one single London local time; the Tokyo fix bar sits at one UTC hour throughout, Tokyo having no clock change. The calendar arithmetic is anchored near local noon for the same reason: adding twenty four hours to a bar close lands on the next date at every hour except the one or two either side of a clock change, and a test over thirty six years of every London calendar date at four local hours finds ten date-and-hour combinations where the unanchored form returns the wrong calendar date, every one of them at the March clock change; the October change is inside the tested range and moved no flag there.
WHAT THE RECORD KEEPS
For each finished day the script stores two numbers in basis points. The run up is the move from the near end of the window to the close of the bar carrying the fix. The second number is the move from that bar to the far end. On the Tokyo window it keeps those for the flagged dates and for every other date separately; on the London window every date goes into one record, because a Japanese settlement date is not a claim about who trades a London benchmark.
For each group the readout is the median of both numbers, the share of days the run up was positive, the share of days the second move went the other way from the run up, and the count of days behind them. A day counts as going the other way when one move is up and the other is down; an exact zero on either side is counted as neither, which is why that share and the share of positive run ups are not two views of one count. Every share carries a binomial standard error. The days do not overlap, so the count is a real sample size rather than a bar count, but the days do cluster by month and by regime, and a record of two years is two years of one currency pair.
The reference before the window and the close of the bar carrying the fix are read off price as it stands, so on the bar that is forming they move as it forms and settle when it closes, and once a bar has closed its reading is not rewritten afterwards. Today's row therefore shows a run up while the fix bar is still forming, at a figure that moves until that bar closes. The record is held to a stricter rule: a day joins it on the close of its far-side bar and not while that bar is forming, so the medians, the shares and the counts move only on closed bars. Without that rule the day would join on the far-side bar's first tick, since a forming bar already reports the close time it is scheduled to have.
The cap on the record is shared between the two groups rather than applied to each. When it fills, the oldest day leaves whichever group held it, so the two groups cover the same stretch of chart. Capping each group on its own would let the larger one fill first and start reporting a shorter span than the other, and the two medians printed side by side would then be measurements of different years.
MEASURED
All of the following are from a transcription of this script run over real bars, not from a strategy and not from a chart. USDJPY hourly from 2023-12-04 to 2026-09-18, the Tokyo window at default settings: 665 days produced a window and 60 were counted out, and the 500 day record holds 154 flagged dates and 346 others. That record is what a chart reaches once it has loaded about two years of hourly bars; on a chart that has loaded less, the counts and the medians are smaller and different, which is the record filling rather than the script disagreeing with itself. All three groups quoted here hold an even number of days, so each median is the average of its two middle readings, and a chart that returns one of the two instead can print a different last digit.
On the flagged dates the median run up was minus 1.04 basis points and it was positive on 44.8 percent of them, with a standard error of 4 points. On the other dates the median was plus 1.09 and it was positive on 52.9 percent, standard error 3. The difference between the two, 8.1 points, is 1.67 standard errors of itself. The second move opposed the run up on 53.2 percent of flagged dates and 51.7 percent of the others.
Two controls say what that 8.1 points is worth, and they are the reason this section exists. Run the identical measurement on the identical dates at a fix time six hours earlier and the same split comes out at plus 5.2 points; six hours later, minus 1.4. A split of that size therefore appears at hours where no fix is struck, which is what a difference inside the noise looks like. And the pair drifted 7.0 percent over the window, which puts 51.3 percent of every sixty minute interval in that tape on the positive side and 51.8 percent of every hundred and twenty minute one. Both shares above have to be read against those numbers rather than against fifty.
On the London window over the same bars the pooled record of 500 days has a median run up of plus 1.50 basis points, positive on 54.8 percent with a standard error of 2.2, which the table cell rounds to 55. Against the 51.3 percent drift baseline that is 3.5 points, about one and a half standard errors.
A five minute chart reaches back far less. Over bars from 2026-06-28 to 2026-09-18, the first of which is a Sunday and carries no record, the Tokyo window produced 60 days, 19 of them flagged, with the window measured at exactly 45 and 90 minutes and no day counted out. Nineteen days is not a sample and is quoted here to show what a fine grained chart actually gives you, which is precision on the window and almost nothing on the count.
WHY THIS IS NOT A SHADED BOX WITH A DATE ON IT
Put as what the script computes and keeps. It resolves a settlement convention into a per date flag, including the roll, on the fixing window's own calendar. It resolves an instant on a local clock into a specific bar on whatever chart is loaded, reports how far that bar sits from the instant, and refuses the day when the distance is more than a bar. And it accumulates, day by day and bar by bar as the chart runs, the displacement across that window on each side of the fix, in a record whose two halves are kept on a shared cap so that they describe the same stretch of chart.
That record is the part that could not be read off a static drawing. The medians and shares exist only because something has been keeping a day by day ledger while the chart ran, and the count printed beside them is what turns the folk version of this calendar into something a reader can check rather than repeat.
The claim itself is not original and is not presented as such. The gotobi effect has been discussed for a long time and the version this script measures is that discussion's own quantity. What is here is the measurement and its sample size.
READING IT
Shading on price: a light band over the interval before the fix, a stronger one on the bar that carries it, and a fainter one after it. Orange on a settlement date, blue on any other date, so the calendar is visible without reading the table. Both outer edges are the requested interval widened by one bar, which is what makes the shading reach the two bars the measurement was actually taken from on a chart whose bars do not land on those minutes. The coarser the chart the fewer bars each band covers: at the default 45 minutes the band before the fix is nine bars on a five minute chart, three or four on a fifteen depending on which window is selected, two on a thirty and a single bar on an hourly one. The Tokyo window gives four on a fifteen minute chart and the London window three, because 09:55 and 16:00 sit differently against a fifteen minute grid.
The table carries the window and its clock, the date on that clock, whether the date is a settlement date and whether the roll rule is what made it one, how far the fix bar closed from the fix, the intervals asked for against the intervals measured, today's two numbers as they arrive, then four rows of the record, then the split setting with the count of days counted out, then a status line.
The data window carries the day's run up and second move in basis points, the two measured intervals, the flag as a one or a zero, the size of each group and the number of days counted out.
The status line names every reason there is no reading rather than printing a plausible number in its place. There are seven messages besides ok, in the order they are tested. That the chart is not a standard one, which is tested first and is explained below. That the chart is not intraday. That it is measured in seconds or in ticks. That its bars are longer than sixty minutes. That the symbol is not forex. That the Tokyo window has been put on a pair with no JPY leg. And that no window has finished yet on this chart. The six chart and symbol messages are tested ahead of the warmup one on purpose, because a chart that can produce no reading at all should say so on the first bar.
On a refused chart nothing else speaks. All eight data window rows are empty, all eleven value cells read as a dash, no band is drawn and nothing is recorded. That was checked by enumerating every one of them on each of the seven refusals rather than by looking at two of them.
SETTINGS THAT MATTER
The minutes before and after the fix decide what is being measured, and the interval that gets measured is the one the table reports rather than the one requested. The first of the two also decides which days survive, which is easy to miss on a calendar study. The FX week opens on a Monday morning in Tokyo, so a Monday can lack a close far enough ahead of the fix: on the hourly tape measured above the record holds 84 Mondays at the default 45 minutes against about 145 of every other weekday, and at 60 minutes and beyond it holds none, leaving a Tuesday to Friday record. Nothing disappears, since the days that leave go to the counted out tally and the two add to 725 at every setting, but the mix of weekdays changes and the table does not show it. On a coarse chart there are also narrow values that leave no day at all: on the same hourly tape any setting from 56 to 59 minutes puts the reference on a bar 120 minutes out while the tolerance allows 119, so every day fails the span test and the record stays empty. The status line then reads that no window has finished yet, which looks like warmup rather than an incompatible setting, so the counted out tally is the number to read when a record refuses to fill. Both are capped at 240 so that neither end of the widest window can cross local midnight on either clock, which would put the two ends of a measurement on different calendar dates.
The weekend roll changes which dates are flagged and therefore both groups at once. Turning it off is the way to see how much of the flagged set is the rule rather than the raw dates.
The record size decides how far back the medians reach, which matters more than how many days they hold. Five hundred weekdays is about two years.
WHAT IT WILL NOT DO
It generates no entries, no exits and no alerts. There is no direction in it, no threshold that turns any of these numbers into a condition, and no filter, because a filter bolted onto a readout makes the readout look like it answered a question it cannot answer.
It is not evidence that the calendar does anything. The measurements above are one pair over one window, and the split at the real fix hour is the size of the split at an hour where nothing is fixed. The two controls answer different questions and neither substitutes for the other: the placebo hour is what the difference between the two groups has to be read against, and the drift is what each group's own level has to be read against. A reader who loads a different pair or a different stretch should expect different numbers and should read them against both.
The shares are frequencies, not probabilities. At a hundred days a share carries a standard error of five points, at four hundred two and a half, and a share sitting ten points from a coin toss at a hundred days is two of those. The table prints the count next to every share so that division is available without doing arithmetic off the chart.
The record is right censored at both ends. Today's window is not in it until the far end has closed, and the count of days counted out runs over all the history the chart has loaded while the record itself stops at its cap, so the two are not a ratio.
It needs a standard intraday forex chart of sixty minutes or less, and the Tokyo window needs a pair with a JPY leg. Charts measured in seconds or in ticks, daily and higher charts, non forex symbols and JPY free pairs on the Tokyo window are each refused by name and produce no numbers at all.
The chart type is tested first and is the refusal worth explaining. On a Heikin Ashi, Renko, Kagi, Line break, Point and figure or Range chart the price series is constructed by the chart rather than dealt in the market, so every other test here still passes while every basis point would be measured off a price nobody traded. Those chart types are refused by name for that reason, and the readout stays blank on them.
The forex test reads how the data source classifies the symbol rather than what the symbol is, and sources differ. A feed that files the same pair under another class is refused by name, so if a major pair reads as not forex, the thing to try is the same pair from another source before concluding the script is broken. The gotobi calendar is a Japanese settlement convention, so the symbol it has anything to say about is USDJPY first and other JPY crosses after that; on EURUSD the London window still measures a real benchmark, and the settlement flag is a date rather than a claim.
Bars are what the feed supplies. A pair with holes around the fix hour loses those days to the counted out tally, and different brokers' FX feeds do not carry identical bars, so two charts of the same pair can produce slightly different medians.
This is context for a decision, not the decision.
Indicatore

YURI Calendar Window EngineThree date rules and one measurement. The rules mark the week the monthly listed-option expiry falls in, the turn of the month, and the last session before a US market holiday. The measurement is what this symbol's own daily returns have done on the days each rule marks, set against the days none of the three rules mark, with an error band built from one figure per run of the window rather than one per day. On the funds measured below, none of the three differences reaches that band. That is the result, and it is why nothing here is an entry.
HOW TO USE IT
Put it on a daily chart of a symbol that keeps a US exchange calendar, and load as much history as the chart will give. Each window needs 20 completed runs before its row reads, which is around two years of bars, and the error band goes on narrowing for a long time after that. A symbol that trades seven days a week is refused by name.
Read the status line first. It counts up to the minimum and then reads ok.
Then read the table. Today says which of the three windows the current bar falls in, if any. Each window row gives the mean daily return on the days that window marks, less the mean on ordinary days, in basis points a day, with its error band, its day count and its run count beside it. The comparison that matters is the difference against its own band. A difference smaller than its band is one the history on this chart does not separate from zero, and on the funds measured below that is how all three rows read.
The pane draws one window at a time. Pick it with Window drawn in the pane. The orange line is the running difference, the grey band is its error, and the tint marks the bars the rule selects, so the rule itself can be checked by eye against a calendar.
If the symbol pays dividends, set the chart's dividend adjustment on purpose before comparing any figure with the ones quoted here. THE CHART SETTING THAT MOVES ONE OF THEM says which row it moves and by how much.
WHY THE THREE RULES ARE IN ONE SCRIPT
An ordinary day can only be defined by naming every calendar rule it is not. The baseline each window is measured against is therefore not defined until all three calendars have been computed on the same bar, which is the thing a single-window marker cannot do for itself.
Compare a window against its own complement instead and the comparison is contaminated in a way that is easy to miss. The turn of the month then sits inside the expiry week's baseline, the expiry week sits inside the turn of the month's, and each rule is measured against a mixture containing the others. At the default edges the three rules between them label three days in five of a US equity fund's history, so the contamination would not be small: expiry weeks are 23 percent of days and the turn of the month window is 37 percent, against 38 percent left over.
The three windows are not versions of each other. On SPY's history the expiry week and the turn of the month share no day at all, by construction, since the expiry Friday is dated 15 to 21 and the turn window opens on the 26th. A session before a holiday lands inside an expiry week on 48 days and inside a turn of month on 136. The rank correlations between the three daily flags are small, the largest being minus 0.42, but that pair is the mutually exclusive one and its correlation is driven by the exclusivity rather than by anything in the returns. The count of shared days is the number that carries the point.
WHAT THE THREE WINDOWS ARE
Expiry week is the Monday to Friday week whose Friday is dated 15 to 21 of the month, which is the third Friday and the monthly expiry of US listed options. The rule is written as the nth Friday, so the setting can be moved to the second or fourth Friday's week to see what an ordinary week of the month reads by comparison. The whole week is marked, not the Friday alone.
The setting starts at the second Friday rather than the first, and the reason is worth stating because it is a limit of the arithmetic. A bar is tested by projecting it forward to the Friday of its own week and asking whether that day of month falls in the right range. A week containing a Friday dated 8 or later begins on a Monday dated 4 or later and so begins in the same month, which makes the projection exact; that was checked against a direct computation over every weekday from 1993 to 2026 at the second, third and fourth Friday, with no disagreement. The week of a month's first Friday can begin in the month before, where the projection runs past the end of the range and the early part of the week goes unmarked. At that setting 582 of the 2040 weekdays in those weeks would be missed, so the setting is out of range rather than approximately right.
Turn of the month opens on the first session dated on or after the 26th and closes after the fourth session of the new month. That is around four sessions either side of the boundary. The month's sessions are counted as they arrive rather than backwards from the month's end, which is what lets the far edge be placed without needing to know in advance which days the market will be open.
Session before a holiday is the last session before a day the US market is shut. Holidays are computed rather than listed. Most are a weekday-of-month rule plus the observed-day shift for the fixed dates, with two start years in them: Juneteenth from 2022, and the third Monday of January from 1998. That second one came out of checking the rules against a large index fund's own trading days, which show the exchange open on that Monday in 1994, 1995, 1996 and 1997 and shut on it from 1998 on. Good Friday follows Easter rather than the day of the month, so it is computed too, by the anonymous Gregorian computus in the Meeus, Jones and Butcher form, taking Easter Sunday and stepping back two days.
HOW THE HOLIDAY RULES WERE CHECKED
Against the market's own record rather than against a published list. Every weekday from 1993 to 2026 was compared with whether a large index fund printed a bar on it. Over 8467 sessions, no day the rules call a holiday is a day the market traded, and every one of the 34 Good Fridays in that window is a day it did not. Eleven closed weekdays are not caught: one in April 1994, four in September 2001, two in October 2012, and one each in June 2004, January 2007, December 2018 and January 2025. All eleven are one-off closures the market announced at the time, which is outside what any calendar rule can compute. The session before each of them is not marked, which is a miss on eleven days in 8467.
The Easter computation is why there is no date table in this script and no year it runs out in. An earlier version of this file carried a list of eleven Good Fridays and set aside two months of every year the list did not reach, which on a permanently published script would have meant a permanent degradation from 2027. The computation was checked against that list year for year, and against an independent implementation on every year from 1900 to 2099, with no disagreement in either; in all 200 of those years the result is a Friday, and it falls between March 21 and April 23.
Because of that, the session before Good Friday is marked in every year a chart carries. On the index fund's history that is 34 of 34, where a list covering eleven years could have reached eleven.
A bar that falls on a rules holiday while the chart still prints one, which is what a contract for difference on an index does, is set aside: it ends no run, enters no average of its own, and is counted in its own table row. Its close is still the price the next session's return is measured from, so that session is measured from the set-aside bar rather than from the last real session before it. On a US-listed fund the row reads zero and none of that arises, which is the check that says the calendar and the symbol agree.
WHAT THE NUMBER BESIDE EACH WINDOW IS
The mean daily log return of the days that window marks, in basis points, less the same mean over the days none of the three rules mark. A bar carries the label of its own date, and its return is the close to close move ending on it. No cost is deducted anywhere.
The band is two standard errors of that difference, and it is built from one figure per completed run of the window rather than one per day. A run is a maximal stretch of consecutive marked days: an expiry week is one run of four or five sessions, a turn of month is one run of five to nine, a session before a holiday is a run of one. Counting days would be the wrong denominator if the days inside one run moved together. Measured, they do not: on the twelve comparisons where a run is longer than a day, the run band comes out between 0.940 and 0.969 of the per day band, so the two ways of counting land within six percent of each other. Both figures are in the data window.
Six of the eighteen band comparisons are the pre-holiday bucket, whose runs are one day long by construction, so for those the two bands are arithmetically almost the same whatever the returns do and they are not evidence of anything. The claim above rests on the other twelve, which is why it is quoted as twelve.
Two point estimates are also kept apart and both are printed, and the relationship between them and the band is worth being exact about. Pooling days weights a long run more heavily than a short one; averaging run averages weights them alike. Those are not the same number when run lengths differ: across the eighteen combinations they differ by up to 39 percent of the printed band, and on SPY alone by up to 32. The pane draws the pooled one, while the band is the standard error of the run-weighted one, so the line and the band belong to two different estimators. The direction of that is one-sided and is stated here rather than left to be worked out: the run-weighted estimate is the smaller of the two in every one of the eighteen, with no exception in the other direction, so the pane shows the bigger estimate against the band of the smaller. Both sit inside the band throughout, and since nothing here is claimed to separate from zero, the pairing errs toward showing an effect that then fails to appear. A reader who wants the matched pair should read the run-weighted difference from the data window against the same band.
The run that is open when the chart's history begins is dropped, because its length is whatever the chart happens to start at, and the run still open on the last bar is not counted as a run either. Their days are still in the daily average. That last point is a right censoring and it moves the run count, not the mean.
MEASURED
SPY daily bars, 1993-01-29 to 2026-09-18, chart dividend adjustment on, 8466 classified daily returns. Ordinary days average +1.4 basis points. Expiry week averages +3.8, a difference of +2.4 against a band of 6.5, over 1983 days in 403 runs. Turn of the month averages +6.6, a difference of +5.2 against a band of 5.6, over 3124 days in 403 runs. The session before a holiday averages +9.9, a difference of +8.5 against a band of 11.6, over 298 days in 298 runs.
QQQ from 1999-03-10: minus 0.2 against 10.2, +4.0 against 8.9, +10.9 against 19.7. IWM from 2000-05-26: minus 0.6 against 9.2, +5.0 against 8.2, +14.4 against 16.4. Eighteen window and symbol and adjustment combinations were computed and none reaches two of its own standard errors. The closest is the turn of the month on SPY with the adjustment off, at +5.2 against 5.6, which is 94 percent of its own band.
Two sensitivity checks, because a number that only survives one setting is not a number. Moving the turn of month edges over a grid of three opening days by three closing days moves the SPY difference between +5.2 and +7.2, a span of 2.0 against a band of 5.6. Moving the marked week to a different Friday of the month gives minus 1.9 for the second Friday's week, +2.4 for the third and +1.2 for the fourth, each with a band near 7. Adjacent weeks of the same month come out on opposite sides of zero and all three sit inside their own bands. That is the shape a set of numbers inside their own error takes, and it is the most useful single fact in this description.
THE CHART SETTING THAT MOVES ONE OF THEM
The chart's adjust-for-dividends setting moves the expiry week figure by more than moving the window edges does, and it does so for a structural reason. All 135 of the ex-dividend dates in SPY's loaded history fall inside an expiry week, with a median size of 44 basis points. Turning the adjustment off takes SPY's expiry week reading from +2.4 basis points a day to minus 0.7, a swing of 3.03 on a band of 6.5, and it changes the sign.
The three funds are not alike in this. QQQ has 55 percent of its ex dates inside an expiry week and moves by 0.43. IWM has 17 percent and moves by 0.35. So the size of the effect is a property of the fund's distribution calendar, not of the market.
This script does not read the chart's adjustment setting. Whichever way it is set, both the window average and the ordinary day average are computed on the same series, so the comparison is internally consistent; it is the level of the expiry week figure that changes. The figures quoted above are with it on. Which way a fresh chart arrives set is a platform default rather than a property of the data, so read it off the chart rather than assuming it, and note which way it was when one of these numbers is quoted.
WHAT SEPARATES, AND IT IS NOT A RETURN
The one reading that comes apart cleanly is the spread, which is in the data window as the ratio of the window's daily standard deviation to an ordinary day's. The session before a holiday carries about four fifths of an ordinary session's daily spread: 0.79 on SPY, 0.86 on QQQ, 0.77 on IWM, and under one in 25 of SPY's 34 single years, 25 of QQQ's 28 and 25 of IWM's 27, so it is not one stretch of history doing the work. Part of it is the two shortened sessions, July 3 and December 24, which come in at 0.61, but the 261 full length pre-holiday sessions are still at 0.82. Expiry week and turn of month sit at 0.98 to 1.00 and separate on nothing.
The spread ratio carries no error band in this script and should be read as description rather than as a test. It was kept because it is measurably not the mean difference in other clothes: Spearman is asked second here, because rank correlation is blind to a fold: two readings related by something of the shape y = |2x - 100| can rank near zero against each other and still be one number. So the first question is whether either reading can be computed from the other. Reconstructing the spread ratio from the mean difference over a basis that contains the fold shapes leaves a largest residual of a third of the spread ratio's own range, and the same in reverse leaves a quarter, so neither is a formula of the other. Only then the rank tests: minus 0.73 straight, minus 0.66 against the absolute value of the difference and minus 0.46 against its fold about the median, and minus 0.29 as running series on SPY. All inside the 0.8 bar set beforehand.
A third candidate reading was computed and dropped. The share of up days in a window, less the same share on ordinary days, tracks the mean difference at a Spearman of +0.92 across the same eighteen combinations. That is past the bar, so it says nothing the mean difference has not already said and it is not in the file.
WHERE THE METHODS COME FROM
The turn of the month effect is Lakonishok and Smidt, 1988. The pre-holiday effect is Ariel, 1990. Neither is this script's idea and neither is claimed as one. For expiry week only the calendar definition is used, the third Friday being the monthly expiry of US listed options; no account of why a week around it might differ is offered here, because this script measures and does not explain.
What is added is the shared baseline, the run-based error band, the two point estimates side by side, the set-aside accounting, and the measurement above showing that on these funds the three differences sit inside their own error.
READING IT
A pane on a basis points a day scale. One orange line, the running difference for whichever window is selected, against a grey band at plus and minus two standard errors and a dotted line at zero. Both are running figures, so the band narrows as history accumulates and the line settles. What the pane mostly shows is an estimate wandering inside its own error, which is the honest picture.
The pane tints when the current bar falls inside the drawn window. All three windows are in the table whichever one is drawn.
The table carries which windows today falls in, one row per window with its difference, its band, its day count and its run count, the ordinary day average with its own counts, the days that fall in two windows at once, the days set aside and how many of those were days the market was shut, the total number of daily returns measured, a standing note that the basis is close to close log returns with no costs, and a status line.
The data window carries the two standard errors separately, the difference over its standard error, the spread ratio, the run-weighted difference, the shortest, longest and mean run length of the drawn window, and the classified and set-aside counts.
Wherever a reading is withheld the status line says which of the tests withheld it, instead of a number appearing with a caveat somewhere else. Eight sentences besides ok can appear there, and they are evaluated top to bottom: the bars are synthetic; the bar length is not one day; the symbol keeps a seven day week; weekend bars have shown up in the history; no month has turned over yet; this particular bar was not a session; the ordinary day ledger is short of runs; the drawn window's ledger is short of runs. The last pair are worded alike and kept apart because the two ledgers fill at different rates, so the one that is short is the one named. Synthetic bars are tested before anything else because that is the single case in which all the remaining tests would pass and a wrong reading would look right.
The default minimum is twenty completed runs per bucket. On a chart of 400 daily bars the expiry week ledger holds 18 of them and the pre-holiday ledger 15, so all three rows come in somewhere around two years of loaded history, and the status line counts up to it.
SETTINGS THAT MATTER
The turn of month opening day is the one judgement among the defaults. Twenty six is a round choice and nothing in this script argues it is the right one. The sensitivity above is what it is worth, and the setting is exposed with a range so that moving it is a keystroke.
Which Friday of the month the expiry falls on is three for US listed options. Two and four are there as a control rather than as settings to optimise, and one is out of range for the reason given above.
Completed runs before a window reads applies to the window and to the ordinary day baseline separately. Raising it delays every row and narrows nothing.
The error band in standard errors is two by default. Two standard errors is the usual convention and it is not an exact 95 percent interval here, since it assumes returns that are independent across runs and symmetric, and daily equity returns are neither exactly.
WHAT IT WILL NOT DO
There is no order in it, no alert in it, and nothing it prints is a signal. No filter, no trend condition and no position appear anywhere, deliberately: a readout with a condition bolted to it starts to look like it has answered a question it has not.
It does not say that any of these windows is worth trading. On the three funds measured, every one of the eighteen differences computed sits inside its own two standard error band, which is the opposite of that claim. What it is, is a marker for where in the calendar today falls, carrying how large the effect has been on the symbol in front of you and how large the error on that is.
No cost is deducted anywhere. These are gross close to close moves. A number of a few basis points a day is inside the cost of acting on it for most people, and that comparison is left to the reader because this script does not know what anyone pays.
The averages describe the history loaded on the chart. Scroll back further and they change. A reader on a longer history will see different counts from the ones quoted above, and the table prints the number of daily returns behind every figure for that reason.
The holiday rules are a US exchange calendar. On a symbol that keeps a different holiday calendar the rules will mark the last session before a US holiday, which may be an ordinary session for that symbol. On a symbol that trades at weekends, or whose type is crypto, the script refuses by name rather than reading anything, because the trading day counter behind the turn of month window would be counting days the rules do not recognise.
The bars have to be real prices. Chart types that synthesise a bar out of other bars, Heikin Ashi and Renko and Kagi and Line Break and Point and Figure and Range among them, produce a close that no trade happened at, and an average of those is an average of the chart's own construction. This is the one condition checked before all the others, because it is the one where nothing else would object and the readout would look ordinary.
The bar length has to be one day. Anything shorter, anything weekly or monthly, and the two, three and five day variants are each turned away with the reason on the status line. The multi-day variants deserve their own mention: they answer to most tests the way a daily chart does, so a script that only asked whether the chart was daily would read them and be wrong by a factor of two, three or five. When a chart is turned away, all twenty drawn elements go empty and all nine value cells show a dash, so there is nothing on screen to misread. The ten labels down the table's left column are fixed text and stay where they are.
Every figure looks backwards only. Nothing printed on a bar was computed from a later one, which means the bar still forming will move while it forms and stop moving at its close, and a bar already closed keeps the reading it had. The way that was established: the entire series was recomputed on histories cut short at three different points, one of them three thousand bars back, and each cut's final bar came out bit for bit equal to the same bar of the uncut run.
This is context for a decision, not the decision.
Indicatore

YURI VWAP Excursion EngineSession VWAP has a deadline that most levels do not. When the session ends the average resets, and whether price got back to it stops being an open question. This script keeps the record of how that question has been answered on the chart in front of you: every time price left VWAP by more than a set distance, how long it took to touch VWAP again, and how often the session simply ran out first.
HOW TO USE IT
Put it on an intraday chart of a symbol that reports volume. One minute bars and coarser are accepted. Leave Regular hours only switched on unless you want pre and post market bars counted into the average.
Read the status line first. The ledger builds as the chart is walked, so it needs loaded history: at the defaults each half of the session wants 15 finished excursions before it reads, and the status counts up until then. If the ledger stays thin on your symbol, the distance is large for it. Lower Distance that starts an excursion and the ledger fills faster, with the trade off set out under THE SENSITIVITY THAT MOVES THE HEADLINE.
Most of the time the pane is empty and the status reads ok, no excursion open. That is the normal state. When price closes further from session VWAP than the distance, the background shades and a line starts. The line is the share of comparable past excursions that were already back at VWAP by the age this one has now reached. Time out gives that age, and Still watched at this age gives how many past excursions the share is built from at that point, which is the cell that says how much weight the line will bear.
The two group rows lower down are the standing record: the same share at a fixed reference age, 60 minutes by default, for excursions that began early in the session and for those that began later. They are there on every bar, whether or not an excursion is open.
WHAT AN EXCURSION IS
An excursion opens on the first bar whose close sits more than the chosen distance from session VWAP, measured in basis points of VWAP. It closes on the first later bar whose range contains VWAP, which is a touch rather than a close through it.
One push that retreats partway and goes out again without reaching VWAP stays a single excursion. That is what makes the number a duration rather than a count of pokes. A bar that trades through VWAP and still closes past the threshold ends one excursion and starts another on the same bar, because the close is tested before the open.
If the session ends with an excursion still open, it is not discarded. It goes into the ledger with the elapsed time kept as a lower bound and a mark saying the deadline arrived first. The pushes that did not come back are the ones a record of return times is most tempted to lose, and a record that loses them is an advertisement.
THE OBVIOUS NUMBER IS THE WRONG ONE
The tempting headline is the share of excursions that got back to VWAP before the close. That number is mostly a clock readout.
Grouped by the hour of the session they started in, that raw share ranked against the minutes remaining in the session at a Spearman of 0.96 across the tested window. A push that leaves at 09:40 has most of the day to come back and a push that leaves at 15:10 has fifty minutes, so comparing the two tells you which one left earlier and little else.
WHAT IS READ INSTEAD
A Kaplan-Meier estimate of the share already back at the current age. Each entry in the ledger contributes to the number still under observation for as long as it was actually watched, contributes an event only where a return was seen, and leaves the pool at the point its session ended if it was still out then. It is neither counted as a failure to return nor thrown away.
Both simpler repairs break, in opposite directions, and the difference is not small at long ages. Admitting an entry only when it was watched at least as long as the age being asked about throws away returns that were already seen, and every one of those is a late departure, because in a fixed length session a short horizon is a late start: on the tested window that reads the later group at 25.5 percent at two hours against 29.5 for Kaplan-Meier. Admitting every entry whose outcome is determined swings it the other way, because a short horizon entry gets in only when it came back fast: 37.5 percent at the same age. At one hour, which is where most of the reading happens, the three land at 17.4, 18.6 and 16.1, so the choice matters much less.
THE CLOCK, AND EXACTLY WHAT SURVIVES
The ledger is kept in two groups split at a settable minute of the session, because departure time separates them. At an age of one hour the early group reads 41.0 percent against 16.1 for the later group, a gap of 24.9 points against a standard error of 5.9, on 122 and 89 entries.
Two things have to be said about that rather than left for you to find.
In a session of fixed length the departure minute and the minutes remaining are one variable with the sign flipped, and the two groups have no overlap on it at all. So this is not a time of day effect sitting on top of a remaining time effect, and no matching inside this design could separate the two. What survives is narrower: after the observation window is equalised at each age, departure time still separates the groups.
And the most likely mechanism is measured in this same script. VWAP is still mobile early in the session and nearly frozen late, so the distance can close from either end. Splitting the same measurement by the same two groups, the VWAP itself supplied a median 38.8 percent of the closing distance for early departures against 16.9 for later ones. That is a ratio of 2.3 against the ratio of 2.5 in the return shares. A reader will take the 41 against 16 as a statement about price behaviour at different times of day, and much of it is a statement about how mobile the session average still is.
Below about half an hour of age the two groups are not distinguishable on this sample at all. At fifteen minutes the gap is 1.0 points against a standard error of 3.1, so the split matters to the reading only once an excursion has been out a while, which is not when a reader is most likely to be looking at it.
WHAT A RETURN ACTUALLY IS
A return does not mean price moved. VWAP walks toward price as the session accumulates volume, and either side closing the distance ends the excursion the same way. The numbers in the section above are what that is worth. The ledger does not separate the two and does not try to. Reading a return as price coming back is a reading you are adding, not one the script supports.
THE TWO SIDES ARE POOLED, AND THAT WAS CHECKED
At an age of one hour the estimate reads 30.7 percent for the 100 pushes above VWAP and 32.0 percent for the 111 below. That is the same number written twice, so the sides are pooled. A split that buys nothing costs half the sample, and this ledger is thin enough that halving it matters.
MEASURED
All of the following is five minute bars on SPY, QQQ and IWM, sixty sessions each from 2026-06-25 to 2026-09-18, at the default 35 basis point distance and the default split at 120 minutes. They are measurements of this script's own record, not results of a strategy.
Two hundred and eleven excursions in total: 125 came back before the close and 86 were still out when it arrived. Per symbol that is 0.65 excursions a session on SPY, 1.57 on QQQ and 1.30 on IWM, which is the spread you should expect from one distance setting applied to three instruments.
The estimate by age, early group against later group: at 15 minutes 5.7 percent against 4.7, at 30 minutes 16.4 against 7.0, at 60 minutes 41.0 against 16.1, at 120 minutes 62.3 against 29.5. Pooling the two groups at one hour would print 31.4 percent, a number that describes neither.
THE SENSITIVITY THAT MOVES THE HEADLINE
The distance threshold is the setting the gap between the groups depends on, and it does not hold up evenly. At 25 basis points the gap at an hour is 29.1 points against a standard error of 5.2, on 313 excursions. At the default 35 it is 24.9 against 5.9, on 211. At 50 basis points it falls to 8.4 against 9.0, on 96 excursions, which is no gap at all. At 70 it comes back to 24.2 against 13.2, on 44.
Two things to keep in mind reading that. The four rows are not four replications: the 70 basis point excursions are a subset of the 50, which are a subset of the 35, so they are four views of one sixty session sample and the agreement between them counts for much less than four independent tests would. And the default is not the flattering cell. Twenty five basis points has both the larger gap and the larger sample; 35 was set for ledger size, not for the gap.
The 50 basis point row sits about 1.8 standard errors below the 35 row, which on its own is unremarkable, and both groups moved toward each other there rather than one collapsing. But sixty sessions on three US equity ETFs is not enough to settle it, and it is the weakest number in this file.
The split point is steadier. Moving it to 60, 90, 120 and 180 minutes gives early group estimates at an hour of 47.1, 42.6, 41.0 and 37.4 percent against later group estimates of 22.9, 21.6, 16.1 and 14.4. The separation survives every one of those and degrades smoothly, so the default is a choice about where to cut rather than the thing producing the result.
READING IT
The pane draws one line: the share of comparable past excursions already back at the age the open excursion has now reached. It appears while an excursion is open and is absent otherwise. Dotted guides sit at 25, 50 and 75.
That line is a distribution function of the age, so it is non-decreasing while an excursion stays open, and it ranked against that age between 0.88 and 0.93 across the three tested symbols. That is the same kind of clock relation the raw return share was rejected for two sections above, and it is not hidden here: the line rises because the excursion is getting older, not because anything has happened. What it adds over the age printed one row above it in the table is the conversion of that age into a historical frequency. It is not a second piece of information.
The background is shaded while an excursion is open. It is the same shade whichever side of VWAP price left from, on purpose. Which side price is on is on the price chart already, and colouring it here would dress a state as a lean.
The table carries nine rows. The first five describe the bar in front of you: the state, the distance from VWAP in basis points, how long the current excursion has been open, the share already back, and how many entries in this group are still under observation at that age against how many the group holds. That fifth row belongs with the first four rather than with the ledger, because it is read at the current age and the current age is a clock that only runs inside the session. The next three are the ledger behind it: the same estimate at a fixed reference age for each of the two groups, and the size of the whole ledger with how many of its entries were still out at the close. The ninth is a status line.
The data window carries four series: the age, the number still under observation, the size of the group and the size of the ledger. The distance from VWAP is in the table only. It is the same quantity a session VWAP band script already publishes, so it is here to make the excursion definition legible on screen and not as a reading of its own.
The status line names every reason there is no reading rather than printing something plausible in its place. There are nine messages besides the two that begin with ok, in the order they are tested. That the chart is built from synthetic prices. That it is not intraday. That it is a seconds or tick chart. That the symbol reports no volume. That no session has opened yet. That the bar is outside the counting window. That it is the first bar of a session, which has no distance to measure against a one bar average. How far along the ledger is, in excursions. And that this half of the session holds too few excursions to read, which is a different shortage from an empty ledger. Two notes can be appended to either ok message rather than replacing it, so the count of nine stands: how many entries are still under observation at this age when that number is below the floor, and, if it ever happened, that a session held more excursions than the buffer could carry.
On a refused chart the line and all four data window series are empty, all eight value cells in the table are empty, and only the status line speaks. The three dotted guides stay, being fixed levels rather than series, and the row labels stay so the table keeps its shape.
Outside the counting window is not a refusal but it blanks the same way for everything it affects. A bar before the open or after the close has fed nothing into the average and moved no clock, so the line, the shading, the first five table rows and three of the four data window series go empty rather than holding the last in-session value. The three ledger rows and the ledger size series stay, because they are history rather than a reading about that bar.
SETTINGS THAT MATTER
The distance that starts an excursion is the setting to move first and the one to set by the resulting ledger size rather than by taste. Too wide and the ledger holds nothing. Too narrow and it fills with round trips through a VWAP that price was sitting on anyway. It is in basis points of VWAP so that the same setting means the same proportional distance at any price level, and it is instrument specific: the same number gave 0.65 excursions a session on one ETF and 1.57 on another.
The split point decides which past excursions count as a similar time of day. The section above shows what moving it does. Its upper limit is twelve hours, so on an instrument whose counting window runs longer than that the split cannot reach the middle of the session and the two groups stop meaning early and late.
The reference age changes the two group rows in the table and nothing else. It does not touch the line, the live reading or the ledger.
The minimum group size is a floor, and it is worth knowing what it is a floor on. It counts the excursions in that half of the session, not the ones still under observation at the age being read. Those are different numbers and the second is usually much smaller, because an entry leaves the pool once its own session ended. Below the floor the line stays empty and the status line says how many excursions that half of the session holds. Above it the line draws, and whenever the number still under observation falls below the same figure the status line appends that count, so a thin reading says so. On the tested window that appended note was earned on between half and four fifths of the bars that drew a line, which is worth seeing rather than hiding. The same count is the fifth row of the table on every bar. The line itself is drawn dimmed wherever that count is below the floor, so the thin stretch is visible when scrolling back rather than only in the table on the last bar. Where the count reaches zero the estimate is carried forward from the last return the ledger saw, which is past everything it has observed, and the table says so beside the number.
Regular hours only decides both what feeds the average and what the session clock counts. Turning it off counts pre and post market bars into both.
WHAT IT WILL NOT DO
It generates no entries or exits, no alerts and no signals. Nothing in it is one.
It does not say that a push which has been out a long time is coming back. The estimate is a historical frequency and its complement is not a forecast. The excursions that stayed out are in the pool for as long as they were observable, and a push that has been out longer than most is equally consistent with a day that has simply gone somewhere. Nothing here separates those two cases, and treating the reading as a reason to take the other side is a use the record does not support.
It does not distinguish price returning to VWAP from VWAP arriving at price, and the section above says how large that second effect measured.
The estimator assumes that how long an excursion runs and how much session was left when it started are unrelated, and in this design they are related by construction, since the deadline is the session close and the whole file is about departure time mattering. Kaplan-Meier removes the part of that which comes from discarding observations. It does not remove the dependence itself, and no estimator computed from this ledger could.
Which way that pushes the numbers is worth being plain about, because the obvious answer is not the one the data gives. The mechanism is certain: inside the later group the 19 entries that leave the pool before an hour have a mean departure minute of 352, against 222 for the 57 still under observation at that age. Kaplan-Meier credits those departed entries with the return rate of the ones still being watched. If the latest departures were the slower returners, the later group's estimate would be pushed up and the gap this file reports would be conservative. On the tested window they are the faster ones: splitting the later group of 89 at its own median departure, the latest half reads 10.2 percent against 4.3 at thirty minutes, 20.3 against 13.0 at an hour, and 40.3 against 21.7 at ninety. That points the bias the other way, and would make the reported gap too wide rather than too narrow. Those percentages are thinner than they look. The 40.3 rests on 10 events with 6 of 43 entries still under observation, and the 20.3 on 17 of 43. And the deeper problem is not the sample. The test uses the very estimator whose assumption is in question, on the subgroup where that assumption bites hardest, so it is circular by construction rather than merely underpowered. The honest statement is that the sign is not determined here.
The ledger is built as the script runs across the loaded history, so two charts of the same symbol with different amounts of history loaded hold different ledgers and print different numbers. The ledger holds the most recent 300 excursions and then begins overwriting the oldest, so on a long chart the reference is recent history rather than all of it.
Excursions are disjoint in time, so unlike a rolling window count they are separate observations rather than overlapping ones. They are still not independent draws. The 211 excursions behind the numbers above come from 180 symbol sessions across three US equity funds that move together, on the same sixty calendar days, so a standard error computed as though they were independent is too small. At 122 entries a 41 percent share carries such a standard error of 4.5 points, and the honest one would be wider.
An excursion that opens on the last bar of a session is committed with a horizon of zero. It counts toward the ledger size and toward the entries marked still out at the close, and it enters no comparison at any age above zero, because there is nothing it could have shown. Three of the 211 excursions in the tested window were of this kind.
The current session's excursions are held back until that session ends, since the horizon each one needs is not known until then. So today's pushes inform tomorrow's reading and not today's.
The tested window contained no half day, so every session in it ran the same length. A shortened session produces shorter horizons and the ledger handles it by construction, but that path was not exercised by the measurements above.
It needs real volume. On a feed reporting tick counts instead of shares, VWAP and everything built on it are approximations, and spot FX has no consolidated volume to build one from.
It needs a standard chart. On Heikin Ashi, Renko, Kagi, Line Break, Point and Figure or Range bars the close is a synthetic price that no share traded at, and a ledger built from those would be a record of something that did not happen. Those charts are refused by name, as are seconds and tick charts.
Every reading is computed on closed bars. The forming bar carries the last closed bar's reading until it closes and takes its own then, and nothing already printed is rewritten afterwards.
This is context for a decision, not the decision.
Indicatore

Silvara-Mcx-ComexSilvara MCX-COMEX Arbitrage Monitor
This indicator tracks the price gap between India's MCX and the international COMEX market for Silver and Gold. It converts the COMEX price to Indian rupees (INR), adds import duty, and compares it with the live MCX price. It shows how much MCX is trading at a premium or discount to the international price, which is the gap arbitrage traders watch.
WHAT IT SHOWS
A dashboard in the centre of the chart with three sections:
- Silver Deviation and Gold Deviation: COMEX day-change %, MCX day-change %, the difference between them, the converted landed price and MCX price in INR, and the live percentage gap.
- Ratio Dashboard: daily open, high, low and close of Gold/Silver, Gold/Platinum and Platinum/Silver.
HOW IT IS CALCULATED
1. Daily divergence % = COMEX % change since the previous day's close minus MCX % change since the previous day's close, calculated separately for Silver and Gold.
2. Landed price (INR):
- Silver (per kg) = COMEX USD/oz x USDINR x (1000 / 31.1034768) x (1 + duty%)
- Gold (per 10 g) = COMEX USD/oz x USDINR x (100 / 311) x (1 + duty%)
3. Difference (INR) = landed price minus MCX price.
4. Difference % = difference / MCX price x 100.
Import duty is an input (default 15%).
Symbols used: MCX:SILVER1!, MCX:GOLD1!, COMEX:SI1!, COMEX:GC1!, VANTAGE:USDINR, TVC:GOLD/TVC:SILVER, TVC:GOLD/TVC:PLATINUM, TVC:PLATINUM/TVC:SILVER.
ALERTS
1. Timer-lock alerts (the main feature). The daily divergence % is split into bands at every 0.5 level from +5.0 to -5.0, each band 0.2 wide (level +/- 0.1). The landed-price difference % is split into bands at every 0.5 level from -1.5 to -15.0, also 0.2 wide. Instead of alerting every time a value touches a band, the script alerts once, only after the value has stayed continuously inside the same band for a set number of seconds (3 to 300, default 30). Leaving the band resets the timer. This gives one alert per sustained stay instead of repeated alerts when the value flickers around a band edge. It runs separately for Silver and Gold, and for both measures. The alert conditions are "Silver / Gold Deviation Timer Locked" and "COMEX-MCX Deviation Timer Locked".
2. Touch alerts on the INR difference. Set your own Entry Upside, Exit and Entry Downside levels for Silver and Gold. These trigger immediately on a cross.
3. Ratio alerts. Set your own Buy, Sell and Free levels for Gold/Silver, Gold/Platinum and Platinum/Silver. Buy triggers when the ratio crosses down through the level, Sell when it crosses up, and Free on a cross in either direction.
HOW TO USE
1. Add the indicator to any chart. The dashboard is drawn in the centre of the chart.
2. Set Import Duty % to match your own landed-cost assumption.
3. Set "Target seconds to lock" for each timer-lock alert in the Timer Settings groups.
4. Set your touch and ratio levels in the alert input groups (default 0 means unused).
5. Create an alert on this indicator and pick the condition you want.
LIMITATIONS
- Continuous front-month contracts (1!) can be in different contract months on MCX and COMEX, and can show gaps at roll time.
- Import duty is a manual input. GST, freight, premiums and dealer margins are not included, so real landed cost will differ.
- COMEX symbols need the appropriate CME market data on your TradingView plan.
- Timer-lock logic runs only on realtime updates, not on historical bars. Its timers reset when the script reloads.
- Timer-lock bands cover -5 to +5 for the daily divergence and only -1.5 to -15 for the landed-price difference. Positive landed-price premiums are not covered by timer-lock alerts.
- Alert messages are fixed text and do not include the live value.
- For monitoring only. Not financial advice.
SOURCE CODE
This script is open-source, so you can check the calculations and reuse them with credit. Indicatore

Planting & Harvesting Seasons V1.1Overview
As a commodity trader, seasonal patterns play a big role in my analysis. This script visually overlays the typical planting and harvesting periods for key agricultural futures directly on the chart. It automatically detects the underlying commodity based on the symbol (e.g. ZC, ZW, ZS, CT) and displays color-coded zones for each seasonal window.
These zones are based on historical crop calendars and help identify when planting or harvesting typically takes place, so technical setups can be better aligned with fundamental seasonal factors.
How It Works
The script reads the chart's symbol root and matches it against a built-in table of crop development and harvest windows (month ranges) for supported futures. Two background zones are drawn:
Development (green) — the typical crop development/growing period
Harvest (red) — the typical harvest period
Labels mark the start and end of each zone as the chart crosses into or out of it. Month ranges that cross the calendar year boundary (e.g. harvest starting in one year and ending in the next) are handled correctly.
Supported Markets
Chicago Wheat (ZW), Corn (ZC), Soybeans (ZS), Rough Rice (ZR), Cotton (CT), Oats (ZO), Cocoa (CC), Coffee (KC), Sugar (SB), Orange Juice (OJ).
What This Script Does Not Do
This is a visual aid only — it does not generate buy or sell signals, does not predict price direction, and is not a standalone trading system. Crop calendars are based on typical/historical timing and can vary by growing region and year.
Limitations
Actual planting and harvest timing can shift from year to year due to weather, regional differences, and other agronomic factors. The zones shown are typical historical windows, not a forecast for the current season.
Changelog (V1.1)
Improved terminology inside the script (crop development and harvest phases)
Improved month-range handling for seasons that cross the calendar year boundary
Updated futures-relevant windows for ZC, CC, KC, SB and OJ
Feedback is always appreciated! Indicatore

Libreria

Libreria

Libreria

Libreria

Libreria

Azrael Dealer Map (SPX Pattern)This TradingView indicator plots a pre-market dealer map for SPX based on the levels described by @azrael_options.
It draws the daily expected-move envelope from a reference close and the ATM straddle (1σ budget), the halfway shelves, the reference/magnet level, and two user-defined gamma walls (typically the nearest heavy-OI round strikes). A light box highlights the session range so you can see at a glance whether price is trading inside dealer parameters or outside them.
Each morning you update four numbers: previous close (or cash-converted overnight ES reference), ATM straddle points, lower gamma wall, and upper gamma wall. The script then draws the ±1σ walls, ±0.5σ shelves, and gamma levels automatically. A close beyond the outer walls is treated as the session invalidation.
The overlay is meant to replace discretionary chart lines with the same coordinates used in the five-minute open routine: mark the gap, price the straddle as the day’s budget, plot the boundaries, and size to 1R against those fixed levels. Indicatore

RSI Signals EntriesRSI Signals Entries — Publish Description
What This Indicator Is
RSI Signals Entries is a four-level Relative Strength Index (RSI) tool built to turn the classic overbought/oversold RSI reading into a clear, actionable signal system. Instead of a plain single-line RSI, it plots a colour-coded RSI with four defined levels — Over Buy, Resistance, Support, and Over Sold — and automatically marks potential Sell and Buy opportunities both on the RSI pane itself and directly on the price candles, together with a fixed confidence "Strength %" label for every signal.
Why It Was Built
Reading raw RSI values and deciding when a reading is "extreme enough" to act on is subjective and inconsistent from one trader to another. This script removes that guesswork by defining four fixed levels up front and applying two distinct, repeatable rules on top of them: a pure RSI-extreme rule for the strongest, highest-confidence reversals, and a level-plus-candle-confirmation rule for slightly less extreme readings that still show real rejection at a key zone. Every signal is labelled with the same fixed strength value every time it appears, so the trader always knows which of the two rules produced it.
How It Works
The four RSI levels
Over Buy: 79.90
Resistance: 67.90
Support: 34.90
Over Sold: 19.90
The RSI line itself changes colour depending on which zone it is currently in (Over Buy, Resistance, neutral, Support, or Over Sold), so the current market condition is visible at a glance without reading the exact number.
The strong-candle filter
A candle only counts as "strong" when its body (the distance between open and close, not counting wicks) is at least a chosen multiple of the average candle body size over a recent lookback period. This stops the indicator from reacting to small, indecisive candles.
The two signal rules
Extreme rule (Over Buy / Over Sold): whenever RSI reaches the Over Buy or Over Sold level, a signal fires immediately with a fixed Strength of 80%. No candle confirmation is required, because the RSI reading itself is already at its most extreme.
Zone-confirmation rule (Resistance / Support): whenever RSI is sitting inside the Resistance zone (between Resistance and Over Buy) or the Support zone (between Over Sold and Support) and a strong candle closes in the reversal direction, a signal fires with a fixed Strength of 70%. This rule needs the extra candle confirmation because the RSI reading on its own is not yet at a true extreme.
Every signal is plotted twice: once on the RSI pane at the exact RSI value where it fired, and once on the price chart directly above or below the triggering candle, so the same event can be read from either view. Each chart-side signal also draws an Entry line, a Stop-Loss line, and a Take-Profit line at a configurable pip distance, so the trade plan is visible the moment the signal appears.
Step-by-Step: How to Take Each Entry
1. Over Buy entry (Sell, 80% strength)
Watch the RSI line rise into the Over Buy zone (79.90 and above).
The moment RSI reaches this level, a red downward triangle appears both on the RSI pane and above the corresponding candle on the price chart, labelled "80% Sell".
Enter a Sell position at or near the close of that candle.
Use the auto-plotted Entry / Stop-Loss / Take-Profit lines as your reference levels, or set your own stop just above the recent swing high and your target using your own risk-reward preference.
2. Resistance entry (Sell, 70% strength)
Watch the RSI line move up into the Resistance zone (between 67.90 and 79.90), without yet reaching Over Buy.
Wait for a strong bearish candle to close while RSI is still inside this zone — this is the rejection confirmation the rule requires.
Once that candle closes, a red downward triangle appears on both the RSI pane and the price chart, labelled "70% Sell".
Enter a Sell position at or near the close of that confirming candle, using the plotted Entry / Stop-Loss / Take-Profit lines as your reference.
3. Over Sold entry (Buy, 80% strength)
Watch the RSI line fall into the Over Sold zone (19.90 and below).
The moment RSI reaches this level, a green upward triangle appears both on the RSI pane and below the corresponding candle on the price chart, labelled "80% Buy".
Enter a Buy position at or near the close of that candle, using the plotted Entry / Stop-Loss / Take-Profit lines as your reference.
4. Support entry (Buy, 70% strength)
Watch the RSI line move down into the Support zone (between 19.90 and 34.90), without yet reaching Over Sold.
Wait for a strong bullish candle to close while RSI is still inside this zone — this is the rejection confirmation the rule requires.
Once that candle closes, a green upward triangle appears on both the RSI pane and the price chart, labelled "70% Buy".
Enter a Buy position at or near the close of that confirming candle, using the plotted Entry / Stop-Loss / Take-Profit lines as your reference.
Settings Worth Knowing Before Use
All four RSI levels, the RSI length and source, the strong-candle lookback and multiplier, the two fixed strength percentages, the pip size, and the Stop-Loss/Take-Profit pip distances are all adjustable from the indicator's settings panel to suit different instruments and trading styles.
The indicator calculates on any timeframe, but the default settings are tuned for fast, short-term signals on 1-minute and 5-minute charts. On higher timeframes, the pip-based Stop-Loss/Take-Profit distances should be widened accordingly.
"Wait for Candle Close" is enabled by default so that every signal shown is fully confirmed and will not repaint; disabling it produces faster but less reliable real-time signals.
Disclaimer
This indicator is a technical analysis tool and does not constitute financial advice. The Strength % values are fixed confidence labels describing which internal rule produced a given signal, not a statistical win-rate or a guarantee of outcome. All trading involves risk, and past performance of any signal or pattern does not guarantee future results. Always use proper risk management and combine this tool with your own analysis before entering any trade.
Original Script Declaration
Script Name: RSI Signals Entries
Author: Michael_Fx_Trader
Publisher: Michael_Fx_Trader
Rights: © Michael_Fx_Trader. All rights reserved.
Originality Statement: This is an original work, designed and coded from scratch by Michael_Fx_Trader. The 4-level colored RSI zone engine, the zone-entry armed/fired signal state machine, the fixed-confidence Strength % labeling system, the dual chart + RSI-pane signal display, and the pip-based Entry / Stop-Loss / Take-Profit level drawing engine were all independently conceived and implemented for this publication. No proprietary source code, private scripts, or copyrighted material belonging to any other author has been copied, mashed-up, or reused in any part of this script.
Author Verification / Declaration: I, Michael_Fx_Trader, am the sole author and publisher of this script. I hold full authorship rights over its source code, its underlying logic, and its visual presentation. The Relative Strength Index (RSI) itself is a well-known, generic public-domain technical indicator (J. Welles Wilder) and is not owned by any individual author; only the zone/signal/labeling logic built around it here is original to this script. Indicatore

Historical Context LevelsHistorical Context Levels displays supplied distributions of high, low and finishing moves as reference levels on a compatible chart. It separates the research sample from chart placement: change the anchor to translate the levels, while keeping their sample counts unchanged.
The indicator does not discover patterns or calculate conditional history from TradingView bars. It reads an explicitly supplied data snapshot. The default demonstration uses ten invented observations and is marked SYNTHETIC DEMO; it is provided so anyone can explore the controls without an account or external data purchase.
Inputs and use
Choose Synthetic demo to explore the example. For your own research, choose Imported data and paste compatible MLV4 or MLV5 text into Research data. Set the chart anchor and check the product and source information. US500 data requires a chart quoted in compatible index points; an ETF price is not interchangeable. The recognised product families are US500, AUS200, UK100, BTC and VIX. Recognition does not eliminate provider basis differences.
The three layers measure different things:
- HIGH: proportion of supplied observations whose high was at or above the offset.
- LOW: proportion whose low was at or below the offset.
- EDGE: proportion whose finish was at or above a nonnegative offset, or at or below a negative offset. At zero both inclusive counts are displayed.
These are frequencies from the supplied sample, not estimated future touch probabilities. A finish is different from an intraday excursion. Source window, anchor and filter definitions must be read alongside any percentage.
Select Levels to see each observation or five supplied percentile placements. Compact labels combine nearby text while retaining the individual lines. Hover to inspect individual values and counts. MLV5 adds Profile and Levels + Profile: these show sample frequencies in bands, not volume or cumulative reach.
Worked synthetic example
The ten demonstration offsets are -20, -10, 0, 10, 20, 30, 40, 50, 60 and 70 points. Seven finish at or above +10, so the +10 level displays 70%. Two finish at or below -10, so the -10 level displays 20%. The demo reference is 7,633; changing it does not change the observations or these fractions.
Distinct functionality
The renderer carries separate sample sizes and inclusive counts for high, low and finishing distributions, explicit source references, product-scale checks and frequency profiles. It supports re-anchoring and dense-label grouping without changing supplied statistics. Its role is transparent display of externally prepared research, not a conventional price-derived indicator.
Limitations
Inputs are author-supplied and not independently authenticated. Structural validation cannot prove that research conditions, sample counts or outcomes are correct. Data does not refresh automatically. Replacing the data does not replace the chart anchor or display settings. Displayed chart prices are tick-rounded; counts refer to original offsets. Lines extend from the latest bar, and optional backward extension does not mean the information was available on earlier bars. There is no strategy backtest or automated trading functionality. Profiles require MLV5. Range-width payloads are unsupported.
Before using real research, specify its instrument, sample window, outcome period, reference and conditions. Historical observations do not guarantee future outcomes.
Indicatore

Day/Session Separator for TTWTTW — Session Ranges, Opens & Border Suite
Overview
Introducing TTW, an all-in-one session and range-mapping toolkit built on ICT-style concepts such as Killzones, CBDR, the Asian Range, and Flout, alongside key opening price references. Rather than stacking several separate scripts on your chart, TTW consolidates the session structure most day-to-day price action traders reference into a single, configurable indicator.
Features
Session Highlighting — Toggle background highlighting and vertical session boundary lines for London, New York, London Close, PM, Asia, and a fully custom "Free Session," each with independently adjustable start/end times and colors.
Session High/Low Border Lines (Asia, London, NY) — Draws a running high line, low line, and optional range fill for the Asia, London, and New York sessions using a robust hour-based session engine, so each session's range is fully self-contained and never bleeds into the next day's session across the midnight boundary. Colors, line width, and fill are shared across all three sessions so they read as one congruent system.
CBDR, Asia & Flout Range Boxes — Auto-plots the high/low box for the Central Bank Dealer's Range, Asian Range, and Flout, each with optional text labels and up to 4 standard deviation projection lines (upside only, downside only, or both directions).
Auto Standard Deviation Table — An optional table compares the CBDR and Asian Range pip counts on forex pairs and recommends which range's standard deviation projections are best suited for the session, based on typical range-size thresholds.
Opening Price Lines — Plots Midnight, New York, Equities, and Afternoon opening price levels, each with an optional label showing the time or a custom description, with price values shown or hidden.
HTF Weekly & Monthly Opens — Displays the current week's and month's opening price as a horizontal reference line with an optional label.
Historical Session Control — Choose to display only today's sessions, the current week's sessions, or the last four weeks of sessions, with automatic cleanup of older drawing objects to keep the chart light.
Day-of-Week Labels — Optional labels marking each day of the week at a chosen hour and chart location.
Bias & Notes Tables — Optional, fully customizable tables for logging directional bias on key correlated markets and freeform session notes, positionable anywhere on the chart.
Global Timezone Selection — All sessions, opens, and labels shift together based on a single timezone input covering all standard UTC offsets, so the whole indicator stays aligned regardless of your exchange's default timezone.
Auto-Interval Guard — Automatically hides session/box drawing above a configurable timeframe so the chart doesn't become cluttered on higher timeframes. Indicatore

MSX Harmonic ProMSX HARMONIC PRO — XABCD Pattern Detection with Scored Entries and 3 Targets
OVERVIEW
MSX Harmonic Pro detects five-point XABCD harmonic patterns, scores each one on how closely its legs match the ideal Fibonacci proportions, and projects a complete trade plan from the completion point: entry, stop loss, and three take-profit levels drawn as horizontal price lines.
Every pattern is then tracked to resolution. The stats table reports the measured hit rate for each target on your symbol and timeframe — not a claimed rate, but what actually happened on the chart in front of you.
Nothing else is plotted. No moving averages, no oscillators, no bands, no fills.
HOW IT WORKS
PIVOT LADDER Swing highs and lows are detected with a configurable pivot length and pushed into an alternating ladder. When two consecutive pivots are the same type, only the more extreme one is retained, so the X-A-B-C-D sequence always alternates direction and never collapses into noise.
PATTERN MATCHING Each new five-pivot sequence is measured against six harmonic types:
Gartley AB/XA 0.618 · BC/AB 0.382-0.886 · CD/BC 1.13-1.618 · AD/XA 0.786 Bat AB/XA 0.382-0.5 · BC/AB 0.382-0.886 · CD/BC 1.618-2.618 · AD/XA 0.886 Butterfly AB/XA 0.786 · BC/AB 0.382-0.886 · CD/BC 1.618-2.24 · AD/XA 1.27-1.618 Crab AB/XA 0.382-0.618 · BC/AB 0.382-0.886 · CD/BC 2.618-3.618 · AD/XA 1.618 Shark AB/XA 0.382-0.618 · BC/AB 1.13-1.618 · CD/XC 0.886 Cypher AB/XA 0.382-0.618 · BC/AB 1.13-1.414 · CD/XC 0.786
Ratios defined as a single value are scored by proportional distance from that value. Ratios defined as a range score zero error anywhere inside the range and are penalised only for how far outside it they fall. The four leg errors are averaged and converted to a 0-100 score, where 100 is a geometrically perfect pattern. The best-scoring type wins the sequence; patterns below your minimum score are discarded and never drawn.
TRADE LEVELS Entry the D point, drawn as a grey dotted line Stop a percentage of the D-to-T1 distance placed beyond D, drawn as a thick red line Target 1 0.382 of the AD leg, measured back from D Target 2 0.618 of the AD leg Target 3 1.000 of the AD leg — a full retracement, which lands at point A
All four extend to the right of D and carry a price-tagged label.
PROJECTION ARROW A drawn arrow runs from the D point to your chosen target, showing the measured move the pattern's geometry implies. Select T1, T2 or T3 as the destination.
OUTCOME TRACKING Targets must be reached in order — T2 only registers after T1, T3 only after T2 — so a candle that spans several levels at once does not inflate the record. The score label at D builds up as the trade resolves:
82.4 still open 82.4 T1 reached target 1 82.4 T1 T2 T3 reached all three 82.4 X stopped out
Patterns that neither hit T1 nor stop within the timeout period are recorded separately as timed out and excluded from the hit rate.
STATS TABLE Patterns resolved completed trades with a definite outcome Target 1 hit count and percentage of resolved patterns Target 2 hit count and percentage of patterns that reached T1 Target 3 hit count and percentage of patterns that reached T2 Stopped count of losses Timed out expired without resolution
SETTINGS
PATTERNS Pivot length swing sensitivity. Lower finds more, smaller patterns. Allowed fib error % how far a ratio may deviate and still qualify. Minimum pattern score the main quality filter. Raise it for fewer, cleaner setups. Pattern toggles enable or disable each of the six types, and each direction.
ENTRY / STOP / TARGETS Target 1 / 2 / 3 Fibonacci multiples of the AD leg. Stop percentage of the D-to-T1 distance, placed beyond D. Level length how far the price lines extend right of D. Pattern timeout bars before an unresolved pattern expires. Patterns tracked how many run concurrently.
PROJECTION ARROW Arrow points to T1, T2 or T3. Arrow length horizontal reach in bars.
SIGNALS Buy / Sell labels at D, with the completion price shown on the label.
HOW TO USE IT
Start with the defaults and let the stats table fill on your symbol and timeframe. The three rates read together tell you where patterns stop working: if T1 converts well but T2-to-T3 conversion is weak, close the remainder at T2 rather than holding for a target the market is not reaching.
Minimum pattern score is the dial that matters. Raising it reduces signal count and raises average quality. Lower pivot length for intraday charts, higher for swing.
Harmonic completion points are reversal zones, not guarantees. The script is a structure and level tool — it identifies where a reversal is geometrically expected and what the measured move would be if it happens. Combine it with your own read of trend, session and higher-timeframe context.
ON THE SCORE
The number at the D point is Fibonacci ratio accuracy — how closely that pattern's legs match the textbook proportions of its type. It is a measure of geometric quality, not a probability of success. A 95-scoring pattern is a well-formed pattern; it can still fail. The stats table is the separate and more useful number, because it reports what actually happened rather than how good the shape looked.
NOTES
Original implementation. Pattern detection, scoring, level projection and outcome tracking are written from scratch — no external libraries, no reused code.
Harmonic pattern theory itself is public domain, developed through the work of H.M. Gartley, Larry Pesavento and Scott Carney.
This indicator is a technical analysis tool for study and planning. It is not financial advice and does not predict future price movement. Trading carries substantial risk of loss. Test any approach thoroughly before committing capital. Indicatore

Quad Stochastic Divergence Toolkit# Quad Stochastic Divergence Toolkit
## Short Description
A four-stochastic divergence toolkit designed to streamline the identification of bullish and bearish stochastic divergences across multiple stochastic speeds.
Inspired by concepts taught in Day Trading Rock Star's Quad Rotation Stochastic Divergence methodology.
---
# Full Description
## Quad Stochastic Divergence Toolkit
The **Quad Stochastic Divergence Toolkit** is a visual trading indicator designed to make it easier to monitor divergence across four stochastic oscillators simultaneously.
The indicator was created to streamline the process of identifying potential bullish and bearish stochastic divergences when using a multi-stochastic approach.
It is inspired by concepts I learned from **Day Trading Rock Star and the Quad Rotation Stochastic Divergence methodology**.
This is an independently developed TradingView tool and is **not an official Day Trading Rock Star indicator, product, or publication**.
### What the Indicator Shows
The indicator displays four independently configured stochastic oscillators in one pane.
Each stochastic can identify two types of regular divergence:
**Bullish / Long Divergence**
Price makes a **lower low** while the corresponding stochastic makes a **higher low**.
This can indicate that downside momentum is weakening even though price has continued lower.
**Bearish / Short Divergence**
Price makes a **higher high** while the corresponding stochastic makes a **lower high**.
This can indicate that upside momentum is weakening even though price has continued higher.
The indicator is intended as a visual analysis tool. A divergence is not, by itself, a trade entry or exit signal.
---
## Four Stochastic Speeds
The toolkit contains four stochastic oscillators with separate settings.
The default configuration uses:
**Stochastic 1**
Length: 9
K Smoothing: 1
D Smoothing: 3
**Stochastic 2**
Length: 14
K Smoothing: 1
D Smoothing: 3
**Stochastic 3**
Length: 40
K Smoothing: 1
D Smoothing: 4
**Stochastic 4**
Length: 60
K Smoothing: 1
D Smoothing: 10
Each oscillator is vertically offset so all four can be viewed clearly within the same indicator pane.
Users can modify the stochastic settings if they prefer a different configuration.
---
## Independent Long and Short Divergence Settings
One of the main purposes of this toolkit is to allow bullish and bearish divergence detection to be tuned independently.
Each stochastic contains two divergence detection groups:
**Div A** — shorter/smaller pivot structure
**Div B** — longer/larger pivot structure
For both Div A and Div B, bullish and bearish divergences have separate pivot settings.
For example:
Long Left A
Long Right A
Short Left A
Short Right A
This allows the user to use different pivot sensitivity for long and short divergences rather than forcing both directions to use identical settings.
The same independent controls are available for all four stochastic oscillators.
---
## Divergence Display
Bullish divergence lines are displayed in green/lime by default.
Bearish divergence lines are displayed in red/maroon by default.
Both the price divergence and the corresponding stochastic divergence are drawn so the relationship between price and momentum can be visually compared.
Div A and Div B can also use different:
* Colors
* Line widths
* Line styles
* Pivot sensitivities
This helps distinguish shorter-term divergence structures from larger ones.
---
## Value Labels
Each stochastic has a current-value label displayed near the right side of the oscillator.
The user can independently control:
* Whether the label is shown
* How many bars to the right of the current bar it appears
* The number/text color of the label
This helps keep the current stochastic readings visible without requiring the labels to sit directly on the most recent candle.
---
## Important: Pivot Confirmation
Divergences in this indicator are based on **confirmed pivot highs and pivot lows**.
A pivot cannot be confirmed until the selected number of **Right** bars has occurred.
For example, if a divergence uses a Right setting of 3, the pivot is not known until three bars after the actual pivot bar.
Once confirmed, the divergence line is drawn back to the originating pivot.
Therefore, a historical divergence line appearing on an earlier candle **does not mean the divergence was known on that candle in real time**.
The actual confirmation occurs only after the required right-side bars have completed.
Increasing the Right setting generally produces more selective pivot structures but also increases the amount of time required before a divergence can be confirmed.
---
## How I Use the Toolkit
The purpose of the indicator is to quickly see whether momentum across multiple stochastic speeds is diverging from price.
Rather than treating every divergence as a trade signal, I use the toolkit as a way of identifying areas that may deserve additional attention.
Possible additional considerations include:
* Market structure
* Support and resistance
* Trend direction
* Higher-timeframe context
* Price action
* Volume
* Session timing
* Risk/reward
* Other confirmation methods used in the trader's own process
Different traders may interpret stochastic divergence differently, so the indicator intentionally provides extensive configuration options rather than prescribing a single trading method.
---
## Customization
Each stochastic can be independently configured, including:
* Enable/disable oscillator
* Stochastic length
* K smoothing
* D smoothing
* Vertical offset
* Stochastic line color
* Value label visibility
* Value label horizontal offset
* Value label number color
* Bullish divergence enable/disable
* Bearish divergence enable/disable
* Independent Long Left/Right pivot settings
* Independent Short Left/Right pivot settings
* Div A settings
* Div B settings
* Divergence line colors
* Divergence line widths
* Divergence line styles
This makes it possible to use the indicator as a starting framework and then adapt it to a trader's own divergence methodology.
---
## Attribution
This indicator was independently developed as a tool to help streamline concepts I learned from **Day Trading Rock Star**, particularly the **Quad Rotation Stochastic Divergence** approach.
Credit for those educational concepts belongs to Day Trading Rock Star.
This TradingView implementation is my own tool for visualizing and organizing stochastic divergence and is not presented as an official Day Trading Rock Star product, indicator, endorsement, or publication.
Users interested in the original trading methodology should refer to Day Trading Rock Star's own educational material for his explanation and application of the strategy.
---
## Disclaimer
This indicator is provided for educational and analytical purposes only.
Divergence does not guarantee a market reversal and should not be interpreted as a prediction of future price movement.
Historical examples are not evidence of future performance.
The indicator does not provide investment advice, financial advice, or individualized trading recommendations.
Trading involves risk. Users are responsible for their own trading decisions, position sizing, risk management, and evaluation of any trading methodology.
# Release Notes — Version 1.0
**Quad Stochastic Divergence Toolkit — Initial Release**
Version 1.0 includes:
* Four independently configurable stochastic oscillators
* Vertically stacked stochastic display
* Bullish regular divergence detection
* Bearish regular divergence detection
* Separate Div A and Div B pivot structures
* Independent Long Left/Right pivot settings
* Independent Short Left/Right pivot settings
* Separate bullish and bearish divergence styling
* Price-chart divergence lines
* Stochastic-pane divergence lines
* Adjustable stochastic value-label positioning
* Selectable hover-label number colors
* Independent controls for all four stochastic oscillators Indicatore
