Previous Day High Low (PDH PDL) DatedHere's a description you can paste into TradingView's publish form. I've kept it to what moderators look for: what it does, how it works, and how to use it, with no performance claims.
---
**Title:** Previous Day High / Low (PDH / PDL) — Dated
**Short title:** PDH / PDL
---
**Description:**
Marks the high and low of the previous trading day as two horizontal lines across the current session, with the source date printed on each line.
The previous day's range is one of the most widely watched reference levels in intraday trading. Price tends to react at yesterday's extremes — they act as obvious targets for continuation and as natural points for rejection. Most charts either leave you to eyeball those levels or clutter the screen with a week of stale lines. This one draws a single pair and tells you exactly which date they came from.
**How it works**
Yesterday's high and low are pulled from the daily timeframe using a security call with a one-bar offset and lookahead enabled. That combination returns only the last *closed* daily bar, so the values lock in the moment a new day opens and never shift afterwards. The levels do not repaint.
New days are detected from the daily timestamp rather than from bar counts, and the lines are anchored to time coordinates instead of bar indices. Both choices mean the script behaves the same on a 1-minute chart as on a 1-hour or daily chart, including on symbols with irregular sessions or gaps in data.
When a new session begins, the previous day's drawings are deleted and one fresh pair is created. Only ever one high line, one low line, and their labels exist on the chart.
**How to use it**
Add it to any intraday chart. The lines run from the session open to the live bar. Watch for:
- Breaks above PDH or below PDL as range expansion
- Failure and rejection at either level as a reversal signal
- The gap between the two as the prior day's value area, useful for gauging whether today is trending or rotating
Two alert conditions are included: *Cross above PDH* and *Cross below PDL*.
**Settings**
- **Regular trading hours only** — builds the daily range from the regular session, ignoring pre- and post-market. Useful for stocks; leave off for futures and crypto.
- **Line style** — colour, width (1–5), and dotted / dashed / solid. Defaults to yellow, width 2, dotted.
- **Extend right** — push the lines past the live bar by a set number of bars.
- **Label** — toggle on or off, choose the date format (MMM dd, dd/MM, yyyy-MM-dd, and others), optionally prefix with PDH/PDL or append the price, position left or right, set size and colour, and switch between plain text and a bubble.
**Note**
On weekly and monthly charts a "previous day" doesn't correspond to a bar, so the levels there are informational only. The indicator is intended for intraday and daily use.
---
Two things worth deciding before you hit publish: whether to release it as **open-source** (recommended — TradingView's house rules favour it, and a script this simple gains nothing from being protected), and whether to add a chart screenshot on a liquid symbol like ES or SPY with the lines clearly visible. The published snapshot is the first thing people judge, so set the chart up cleanly before you publish. Wskaźnik

Bolly Breakout AlertsBolly Breakout Alerts is a simple session-based Bollinger Band breakout indicator designed for 5-minute trading setups.
It monitors for a confirmed candle close above the upper Bollinger Band or below the lower Bollinger Band, then allows alerts to trigger only during the selected trading window. This helps filter out unnecessary notifications outside the periods you actually trade. 📈
The script uses standard Bollinger Band settings:
20-period SMA
2.0 standard deviations
Close price as the source
Included features:
5-minute candle close confirmation
Long breakout alerts above the upper band
Short breakout alerts below the lower band
Combined “Either Direction” breakout alert
Separate DAX and Dow trading windows
UK time handling using Europe/London
Visual breakout markers on the chart
Session filtering to reduce unwanted alerts
Default session windows:
DAX: 06:00–08:20 UK time
Dow: 12:30–14:50 UK time
⚙️ Important setup
After adding the indicator to your chart, open the indicator settings and select the correct market for the chart you are using:
If the indicator is on a DAX chart, select DAX
If the indicator is on a Dow chart, select DOW
This is important because the selected market determines which alert time window is used.
Adding the indicator to the chart does not automatically create a TradingView alert. An alert still needs to be created manually.
Open TradingView’s alert setup and select Bolly Breakout Alerts as the condition, then select Bolly Breakout - Either Direction if you want to be notified when a candle closes outside either the upper or lower Bollinger Band.
For best results, set the alert frequency to Once Per Bar Close. 🔔
If you change the selected market, session times, or other indicator settings after creating an alert, it is advisable to recreate the alert so TradingView uses the updated settings.
The indicator is intended as an alerting and monitoring tool rather than a complete trading system. It does not provide stop losses, profit targets, or trade management rules.
Best used on a 5-minute chart.
⚠️ Always test alerts and session behaviour before relying on them in live trading. Wskaźnik

Weekday Return Distribution [Pineify]Weekday Return Distribution
Overview
This day-of-week seasonality indicator keeps bounded samples for all seven days on 1D-1W charts. It reports median return, interquartile range (IQR), positive-return rate, and sample count.
Problem Definition
A weekday mean can be raised by one extreme gap even when most observations are negative. The same mean can describe a tight cluster or a wide distribution, and it does not reveal whether the sample has six cases or sixty. This creates false precision. This script separates robust location, middle spread, sign balance, and evidence quantity. It describes historical conditioning, not the next return.
Design Rationale
Median replaces the mean because rank location is less sensitive to outliers. Q1 and Q3 describe the middle half without assuming a Gaussian sample. Positive-return rate tests whether direction is broadly shared, while N stops thin samples from receiving full authority. A lifetime sample can preserve obsolete regimes, while a short one makes quantiles jump. Bounded memory trades stability for adaptation. A requested daily context lets weekly charts inherit weekday statistics instead of calling a weekly return Monday data.
Key Features
Seven bounded weekday buckets with optional weekend exclusion.
Median, interpolated Q1/Q3, positive-return rate, and N.
Rotating IQR band, median track, reliability opacity, and table.
Joint bias gates, three alerts, and switchable layers.
How It Works
The engine runs in a requested 1D context. At a new daily bar, it calculates the previous completed log return as 100 x ln(previous close / earlier close) and assigns it to the weekday where that return ended. The live return is excluded; weekends are optional.
Each bucket keeps at most the chosen limit, removing its oldest excess value. A copied bucket is sorted. Q1, median, and Q3 are linearly interpolated at 25%, 50%, and 75%. Positive rate is the share strictly above zero, and N is the actual count.
The latest daily weekday selects the pane row. Gold bounds show Q1-Q3 and the thick line shows median percent return. Interpretation begins when N reaches the minimum. Positive bias requires median and positive rate to pass both positive thresholds; negative bias applies symmetric gates. Disagreement is Mixed; insufficient evidence is Wait. Teal, coral, and gray encode state, and opacity shows maturity.
How Multiple Indicators Work Together
All components measure one distribution. Median supplies location, Q1/Q3 supplies spread, positive rate checks sign participation, and N governs eligibility. The state is conjunctive: without spread uncertainty is hidden; without sign balance a few large returns can dominate; without N a sparse day looks mature. Band, line, color, and table share the same samples.
Trading Ideas and Insights
Use this as scheduling context, not an entry command. A positive median inside a narrow IQR with a high positive rate is more consistent than the same median inside a wide band. Compare days within one symbol and sample policy because assets have different scales. No state estimates profit or next-bar probability.
Unique Aspects
Common weekday tools show one mean or static rank. Here each day owns a bounded queue, the pane rotates through robust location and IQR, and sign participation plus N controls a separate state. Returns stay in percentage units. Only a previous completed daily return is inserted. Weekly charts reuse the daily engine, preserving the definition across 1D-1W.
How to Use
Start on a standard 1D chart and load enough history for each active day to reach minimum N. Read the thick line as median and the gold band as the middle 50% for the highlighted weekday. In the table, Pos or Neg means both gates pass; Mix means mature disagreement; Wait means insufficient evidence. Alerts report state entry or lost reliability, not orders.
Customization
Maximum samples sets memory from 12 to 104 observations per day. Larger values are smoother but slower; smaller values adapt faster. Minimum samples controls readiness. Median magnitude filters effects near zero, and Positive-return threshold sets sign participation with a symmetric negative rule. IQR, halo, background, marker, and table can be hidden without changing calculations. Defaults are not universal optima.
Assumptions and Limitations
This is descriptive seasonality, not causal evidence. Returns include sessions, gaps, feed adjustments, and chart construction. Holidays, missing bars, and calendar changes make buckets unequal; revisions can alter history. Quantiles lag regimes and depend on window settings. Positive rate ignores magnitude; IQR omits tails. On weekly charts, TradingView maps the latest daily context into each bar, so coverage and live timing depend on loaded history and access. Weekday and alerts advance with daily context. Use standard 1D-1W charts; other timeframes are invalid. No future access, backtest, costs, or execution model is included.
Conclusion
Weekday Return Distribution replaces a fragile average with a bounded distribution view. Median shows location, IQR shows middle spread, positive rate shows participation, and N controls readiness, keeping uncertainty and data boundaries visible.
Wskaźnik

ATR Percentile Bands [TradingFinder] Dynamic Extremes🔵 Introduction
Financial markets constantly move between calm conditions and periods of rapid price expansion. A market may trade close to its average for several sessions and then suddenly move into an extreme price zone as volatility increases. In these moments, traders need more than a fixed channel or a standard volatility indicator.
The ATR Percentile Bands indicator combines Average True Range (ATR), historical price deviation, and percentile analysis to identify dynamic upper and lower bands directly on the price chart. By adapting to both current volatility and historical market behavior, the ATR Percentile Bands indicator helps traders recognize normal price movement, unusual price extensions, and potential reversal zones more clearly.
Unlike traditional ATR bands that calculate band width using only current volatility, this dynamic volatility indicator compares the smoothed ATR distance with the 95th percentile of price deviations from a selected moving average. The indicator then uses the larger value to create adaptive price bands that respond to changing market conditions. A customizable EMA, SMA, RMA, WMA, or HMA forms the central moving average, while multi-layer upper and lower ribbons highlight bullish and bearish extreme zones.
When price approaches the upper percentile band, the market may be experiencing unusually strong buying pressure; when price reaches the lower percentile band, selling pressure may have pushed the market into a historically extended area. These volatility bands do not define guaranteed overbought or oversold levels, but they provide a structured framework for analyzing price extremes, mean-reversion opportunities, trend continuation, and volatility expansion.
Imagine price falling sharply toward the lower ATR Percentile Band. The first touch may attract attention, but the indicator does not immediately display a Buy Signal. Instead, its three-stage confirmation engine waits for a bullish candle to reject the lower inner band and then monitors the following candles for continued bullish confirmation. The same process works in reverse for a potential Sell Signal near the upper band. This confirmation-based logic helps filter weak reactions and reduces signals created by simple band contact.
A live information dashboard also displays the current Signal, Price Zone, Trend, Nearest Band, Volatility, and Next Action, allowing traders to understand the complete market context at a glance. As a result, ATR Percentile Bands can support forex trading, cryptocurrency analysis, stock trading, indices, commodities, scalping, day trading, and swing trading across different markets and timeframes.
🔵 How to Use
This volatility-based trading indicator helps traders understand where price is positioned relative to its moving average, current market volatility, and historical price deviations. After adding the indicator to the chart, traders should first examine the central moving average and the upper and lower percentile bands. Price movement between the two inner bands represents a relatively normal market condition, while movement inside the upper or lower ribbon indicates that price is entering an extended zone.
A close above the outer upper band is displayed as Above Upper Band, while a close below the outer lower band is classified as Below Lower Band. These extreme price zones can highlight increased buying or selling pressure, but touching an ATR Percentile Band does not automatically create a Buy Signal or Sell Signal.
Before evaluating a trading signal, traders should review the live dashboard and combine Price Zone, Trend, Nearest Band, and Volatility information. The Trend column shows whether price and the moving average currently support a Bullish, Bearish, or Sideways condition. Nearest Band indicates which inner ATR band is closer to price, while Volatility compares the current ATR with its historical range.
After price reaches an extreme band, the Signal and Next Action columns can be used to follow the confirmation process. The indicator requires a three-stage candle sequence before publishing a Long or Short Signal, helping separate a simple band touch from a confirmed price reaction. All signal decisions are registered after candle closure, so traders should wait for the active candle to close before interpreting the final signal.
🟣 Buy Signal
A potential Buy Setup begins when price moves down to the Lower Inner Band and then shows a valid bullish rejection. The first candle must satisfy three conditions simultaneously: its low must touch or move below the Lower Inner Band, its closing price must return above the Lower Inner Band, and it must close as a bullish candle with the Close above the Open.
The initial Buy Setup conditions are : A valid Buy Setup requires the candle’s low to touch or move below the Lower Inner Band. The price must then recover and close above the Lower Inner Band, while the closing price must also remain above the opening price to confirm that the candle is bullish.
When these conditions are confirmed at candle close, the ATR Percentile Bands indicator does not immediately display a Long Signal. Instead, it saves the bullish setup and sets the confirmation counter to one. At this stage, the dashboard displays Buy Setup, while the Next Action column changes to Wait for Buy. This tells the trader that a bullish reaction has been detected near the lower percentile band, but the complete three-candle confirmation sequence has not yet formed.
The second confirmation candle does not need to touch the Lower Inner Band again. It only needs to remain bullish and close above the Lower Inner Band. If these conditions are satisfied, the confirmation counter advances from one to two. The third candle must repeat the same continuation conditions: it must close above its opening price and remain above the Lower Inner Band. Once the third bullish confirmation is completed, the indicator publishes the Long Signal on the third candle.
After confirmation, the Signal column displays Buy Signal, and Next Action changes to Buy Confirmed. The final Long marker may appear several candles away from the original contact with the lower band because only the first candle must directly reject the extreme zone. The second and third candles are continuation confirmations and are not required to interact with the band again.
A pending Buy Setup is cancelled if a following candle is not bullish and does not remain above the Lower Inner Band. If a valid bearish setup forms while the indicator is waiting for bullish confirmation, the signal engine switches direction, cancels the previous Buy Setup, and begins counting the new Sell Setup from one. After a Long or Short Signal is published, the Signal Gap setting prevents another setup from beginning until the selected number of candles has passed. The default Signal Gap is 10 candles.
For a more structured bullish analysis, traders can combine the Buy Signal with the following conditions :
Price has reacted from the Lower Inner Band or Lower Outer Band;
Price Zone shows Lower Band or Below Lower Band;
Trend is Bullish or begins shifting from Bearish toward Sideways or Bullish;
Volatility is suitable for the trader’s strategy and risk tolerance;
The bullish reaction occurs near support, demand, liquidity, or a significant market structure level;
The completed Long Signal provides an acceptable stop-loss distance and risk-to-reward ratio.
A Buy Signal represents a confirmed bullish reaction within the indicator’s internal logic. It does not guarantee that the market has reached its final low or that an upward trend will continue. In a strong bearish market, price can repeatedly interact with the lower ATR bands. Traders should therefore evaluate the Long Signal together with market structure, volume, trend direction, higher-timeframe context, and risk management.
🟣 Sell Signal
A potential Sell Setup begins when price moves up to the Upper Inner Band and then produces a valid bearish rejection. The first candle must meet three conditions at the same time: its high must touch or move above the Upper Inner Band, its closing price must return below the Upper Inner Band, and it must close as a bearish candle with the Close below the Open.
The initial Sell Setup conditions are : The bearish sequence starts when price pushes into or beyond the Upper Inner Band but fails to hold at that level. If sellers regain control before the candle closes, price returns below the band and finishes beneath its opening value. This rejection activates the initial Sell Setup and starts the confirmation process.
Once these conditions are confirmed after candle closure, the indicator saves the bearish setup and sets the confirmation counter to one. It does not publish a Short Signal on the first rejection candle. During this stage, the dashboard displays Sell Setup, while the Next Action column shows Wait for Sell. The first rejection identifies a possible bearish response from the upper extreme zone, but two additional confirmations are still required.
The second confirmation candle must be bearish and must close below the Upper Inner Band. It does not need to touch the upper band again. When both continuation conditions are satisfied, the bearish counter increases from one to two. The third candle must also close below its opening price and remain below the Upper Inner Band. After the third bearish confirmation closes, the indicator displays the final Short Signal.
At confirmation, the Signal column changes to Sell Signal, and Next Action displays Sell Confirmed. Because the final Short marker belongs to the third confirmation candle, it may not appear directly at the original upper-band rejection. This distance is a normal result of the three-stage confirmation model and does not indicate delayed calculation or repainting.
The Sell Setup is cancelled when the following candle fails to maintain the required bearish continuation and no valid opposite setup is created. If a valid bullish rejection develops while the indicator is waiting for bearish confirmation, the existing Sell Setup is cancelled, the signal direction changes to Buy, and the bullish confirmation counter begins from one. The configured Signal Gap is applied after every published signal to reduce clusters of nearby Long and Short signals.
For a more complete bearish analysis, traders can evaluate the Sell Signal alongside these conditions :
Price has rejected the Upper Inner Band or Upper Outer Band;
Price Zone displays Upper Band or Above Upper Band;
Trend is Bearish or begins changing from Bullish toward Sideways or Bearish;
The upper band overlaps resistance, supply, liquidity, or an important market structure level;
Market volatility is compatible with the selected stop loss and position size;
The confirmed Short Signal offers a reasonable risk-to-reward structure.
A Sell Signal confirms a bearish reaction according to the ATR Percentile Bands signal engine, but it should not be interpreted as proof that price has formed a permanent top. During powerful bullish trends, price may remain close to the upper volatility band or repeatedly move beyond it. Traders should use the Short Signal as analytical confirmation and assess the wider trend, market structure, volume, news conditions, stop loss, and capital management before making a trading decision.
🔵 Settings
Moving Average Type : Defines the calculation method used for the central moving average. Traders can select EMA, SMA, RMA, WMA, or HMA. EMA is selected by default and responds relatively quickly to recent price changes, while smoother average types can create a more stable band structure.
Moving Average Period : Determines how many candles are included in the central moving average calculation. The default value is 50. A shorter period makes the moving average and dynamic bands react faster to price movement, while a longer period creates a smoother structure with slower changes.
ATR Period : Sets the number of candles used to calculate the Average True Range. The default ATR Period is 14. Lower values respond more quickly to short-term volatility, whereas higher values provide a smoother measurement of market volatility.
ATR Multiplier : Controls the ATR-based distance between the central moving average and the outer volatility bands. Its default value is 2.8. Increasing the ATR Multiplier moves the bands farther from price and can reduce the number of band interactions. Decreasing it creates tighter bands and may produce more frequent setups in volatile or fast-moving markets.
Smooth Period : Specifies the smoothing period applied to the ATR and the final band distance. The default value is 5. A lower Smooth Period makes the ATR Percentile Bands more responsive, while a higher value reduces sudden changes and creates smoother upper and lower ribbons.
Signal Gap : Determines the minimum number of candles required between two published signals. The default Signal Gap is 10 bars. Increasing this value creates more separation between Long and Short Signals, while setting it to zero removes the mandatory waiting period.
Moving Average : Shows or hides the central moving average on the price chart. Disabling this option removes the line from view without changing the calculations of the upper and lower ATR Percentile Bands.
Signals : Controls the visibility of Long and Short markers on the chart. Turning this setting off only hides the signal symbols; the internal signal engine and configured TradingView alerts continue to operate normally.
Show Table : Displays or hides the live information dashboard. The table summarizes the current Signal, Price Zone, Trend, Nearest Band, Volatility, and Next Action.
Table Size : Changes the text size of the dashboard. Available options include Tiny, Small, Normal, and Large, allowing the table to fit different chart layouts and screen sizes.
Table Position : Selects the dashboard location on the chart. The table can be placed in any of the nine standard positions: Top Left, Top Center, Top Right, Middle Left, Center, Middle Right, Bottom Left, Bottom Center, or Bottom Right.
Alert : Enables or disables the dynamic alert messages generated by the indicator. When this option is active, traders can create TradingView alerts for confirmed Long and Short Signals.
Message Frequency : Determines how frequently the indicator is allowed to send an alert message. All sends every valid event, Once Per Bar limits notifications to one event per candle, and Once Per Bar Close sends the alert only after the candle has closed. Once Per Bar Close is the default option and is the most consistent choice for the confirmed-candle signal logic.
🔵 Conclusion
The ATR Percentile Bands indicator combines current market volatility with historical price deviation to create adaptive upper and lower bands around a customizable moving average. By comparing the smoothed ATR distance with the 95th percentile of recent price deviations, the indicator adjusts its band width as market conditions change. The multi-layer ribbons highlight normal price movement, extended price zones, and unusually strong deviations, while the live dashboard summarizes Signal, Price Zone, Trend, Nearest Band, Volatility, and Next Action in one view.
Its three-stage confirmation system separates a simple band interaction from a confirmed bullish or bearish reaction. Long and Short Signals are published only after the required candle sequence is completed, helping traders evaluate price rejection with greater context. These signals should be combined with market structure, trend direction, volume, support and resistance, higher-timeframe analysis, and risk management. As an adaptive volatility and price-extreme analysis tool, the indicator can support forex, cryptocurrency, stock, index, and commodity traders across scalping, intraday, and swing-trading strategies.
Wskaźnik

Wskaźnik

XGBoost Mini Strategy [The Quant Science]This strategy implements a predictive XGBoost machine learning system using our proprietary XGBoostMini library. It's a simple test to demonstrate how to use the library within a strategic framework. Notably, with just a few lines of Pine Script, it was possible to develop an algorithm that learns in real time from recent historical data to decide when to enter the market.
👉 XGBoostMini:
🔷 Key Features Extraction
Before making decisions, the system calculates six normalized features metrics to describe the current market state:
14-period RSI on a scale from zero to one
Percentage distance between the price and the 50-period Exponential Moving Average (EMA)
5-period Rate of Change (ROC)
Normalized ATR relative to the price to estimate volatility
Volume variation compared to its 20-period moving average
Current price position relative to the highs and lows of the last 14 bars
🔷 Dynamic Model Training
Starting from bar 300 onwards, every 50 bars the code collects a historical sample consisting of 50 past observations. For each observation, the system checks whether the price increased or decreased two bars later, generating a binary target variable. Based on this recent data, a mini decision tree is trained using the XGBoost model.
🔷 Real-Time Prediction
On every bar following the training, the model analyzes the 6 current indicators and calculates a numerical probability between 0 and 1, representing the estimated likelihood of a future bullish market movement.
🔷 Order and Risk Management
A Long position entry is triggered if the model's estimated probability exceeds the configured reference threshold, set by default to 51%. The position is closed as soon as the probability falls below the opposite threshold. Finally, for capital protection, a safety exit system based on a percentage-based dynamic trailing stop is activated.
🔷 Key Stats & Profitability
Total PnL: +2,010 USDT (+20.10%). A positive return, though it must be evaluated relative to the time horizon visible in the charts (2018 to 2026).
Profit Factor: 1.36. This is a solid value above 1, indicating that gross profits exceed gross losses.
Profitable Trades Percentage: Approximately 54.88%. Over half of the operations close in profit, a robust percentage for a medium-to-high frequency algorithmic trading system.
🔷 Risk Management and Drawdown
Max Drawdown: 361.87 USDT, equal to 3.34%.
This is an exceptionally positive metric. A drawdown of less than 3.50% over such an extensive historical dataset demonstrates outstanding capital protection and very tight risk management driven by the dynamic trailing stop.
🔷 Trades Analysis & Distribution
Expectancy: +0.20% per trade.
This means that, on average, each operation has a positive expected return of 0.20%.
🔷 Risk/Reward Ratio:
Average loss: -0.78%.
Average profit: +1.21%.
Positive Note: The average profit exceeds the average loss, which helps keep the strategy profitable even with a win rate of around 55%.
🔷 Outliers and Extremes
Largest loss: 94.60 USDT.
Largest profit: 169.25 USDT.
It's worth noting that the maximum single loss exceeds the maximum single profit, which means that the strategy's profitability does not rely on isolated "lucky shots," but rather on the consistency of many small profits.
🔷 Equity Curve Analysis
Cumulative PnL Curve: Observing the cumulative PnL chart, a steady and gradual growth phase is visible, especially from 2020 onwards, accompanied by strong stability during sideways or bear market phases (such as in 2022).
Commission Load: The commission load is very low at 0.08%, indicating that transaction costs have a minimal impact on the final result.
🔷 Overall Assessment
The strategy demonstrates solid quantitative metrics: a low drawdown, a good profit factor and a favorable risk/reward ratio. However, as this strategy was developed to test the features of the XGBoost library, it should be considered exclusively for research purposes. Do not treat this strategy as ready for live deployment, but rather as a starting point for your experiments. Strategia

Order Block Intelligence - Mitigation Probability AI [Dots3Red]🧱 ORDER BLOCK INTELLIGENCE - MITIGATION PROBABILITY AI
This script tracks every order block to its first test and grades the outcome — respected or violated — then reports the measured probability the moment a new zone forms.
✨ WHY THIS MATTERS
An order block is a bet: the market left an imbalance here, and price might react when it returns. That bet is treated as equally good everywhere, regardless of how the zone actually formed. This script checks that assumption directly, on your own chart:
📊 Respect 68% | N=27
That means the 27 most similar order blocks this chart has produced — matched by size, the strength of the move that created them, and volume — were respected 68% of the time when price returned. Measured, not assumed, and specific to this instrument and timeframe.
⚙️ HOW IT WORKS
🧱 Detection — an order block is the last opposite-colored candle before a genuine displacement move: the next candle's body must exceed a configurable multiple of ATR, and by default must also close beyond the base candle's high or low, confirming a real structural break rather than just one large candle.
🎯 Displacement candle highlight — the exact candle that creates the zone is recolored and given a background highlight the moment it qualifies, so you can see precisely which move triggered the block without hunting for it.
📊 The KNN engine — every order block is stored as five measurements at the moment it forms: zone size relative to ATR, the strength of the displacement that created it, volume behavior, volatility context, and trend position. When the zone resolves — respected or violated on its first test — that outcome trains the engine. Every new zone is immediately compared against the K most similar historical zones on this chart, and their measured outcome becomes the probability shown on the label.
🔒 First-touch grading — only the first test of each zone is graded, matching how order blocks are actually used in practice. Respected means price moved away by a meaningful distance (or never closed back through); violated means price closed through the far edge.
🔒 Non-repainting — detection and grading both happen strictly on confirmed bars.
🧭 HOW TO USE
1️⃣ Check the sample size before trusting the percentage. "Respect 68% | N=27" reflects real history; a fresh chart will show "Training…" until enough zones have resolved to say anything meaningful.
2️⃣ Use the displacement highlight to understand why a zone exists. If the highlighted candle was a modest, unconvincing move, that context is worth factoring in even before checking the probability label.
3️⃣ Watch the near edge vs. the far edge differently. The near edge (solid, thinner) is where price is expected to react first; the far edge (dashed, thicker by default) is the zone's origin — a close beyond that line is what defines a violation.
4️⃣ Check the global Respect Rate for chart-level context. Beyond any single zone, the dashboard tracks what percentage of every order block on this chart has been respected overall — useful for judging whether this instrument tends to honor these zones or run through them.
5️⃣ Use "Keep Tested Zones Visible" if you want a visual history of what held and what didn't, rather than a clean chart showing only what's currently active.
⏱️ WHICH TIMEFRAMES WORK BEST
Order blocks require a genuine displacement move to qualify, which makes 15-minute through 4-hour the most effective range — the same window that tends to work best across structure-based tools in general. Fast enough that zones form regularly and the KNN engine builds a real sample; slow enough that the displacement candles represent meaningful moves rather than noise.
On very short timeframes (1-3 minute), lower the Displacement Strength setting somewhat, since ATR-relative moves are naturally smaller and more frequent there — otherwise very few candles will qualify. On daily or higher timeframes, genuine order blocks are rarer by nature, so expect longer waits between zones and a slower-growing sample size; this is expected, not a malfunction.
🛠️ SETTINGS
🧱 Order Block Detection
• Displacement Strength (×ATR) — how large the impulse candle's body must be to qualify. Lower this on fast timeframes, raise it on slow ones or if too many weak zones are forming.
• Require Structure Break — toggle whether the displacement candle must also close beyond the base candle's range
• Max Order Blocks Shown, Zone Extension — chart management
📊 KNN Engine
• ATR Baseline Period, Trend MA Length — context windows used in matching
• K Neighbors, Max/Min Training Samples — how the probability engine is tuned
🎯 Mitigation Grading
• Respect Distance, Outcome Window — define what counts as a genuine respect versus a violation
🎨 Visualization
• Independent bullish/bearish zone line and fill colors, plus a separate Tested Zone color
• Independent near-edge and far-edge (base) line widths — the base edge is thicker by default to visually anchor the zone
• Displacement candle highlight with independent bullish/bearish colors, plus an optional plain-bar mode for the rest of the chart that never overrides the highlight
🖥️ Dashboard — show/hide, position — untested zone count by direction, global respect rate, KNN training progress, and the active outcome window
📝 NOTES
Only one active zone per direction accumulates statistics from the moment it's created; a fresh, stricter, or looser Displacement Strength setting will naturally change how many zones qualify and therefore how quickly the sample size builds. Zone size and displacement strength are measured relative to ATR, so the same settings adapt reasonably across different instruments without manual retuning.
⚠️ DISCLAIMER
This is an analytical and visualization tool. It does not generate trade signals and does not constitute financial advice. Historical mitigation rates do not guarantee how any specific future order block will resolve. Wskaźnik

VantaGate Reversal Map v1.0VantaGate Reversal Map
VantaGate is a reversal indicator designed to find areas where price may be stretched and ready to turn. It brings together price location, volatility, momentum, candle rejection, volume, and recent liquidity behavior to produce clear LONG and SHORT signals directly on the chart.
How it works
The silver line represents the current center of price movement. Think of it as an estimate of where price would be considered balanced.
The aqua area below price is the discount reversal zone. This is where VantaGate starts watching for a possible bottom and long opportunity.
The red area above price is the premium reversal zone. This is where VantaGate starts watching for a possible top and short opportunity.
The faint stepped lines show recent highs and lows where orders may be resting. Price often reacts around these areas because traders place entries, stops, and profit targets near previous turning points.
What the diamonds mean
An aqua diamond appears when price enters the lower reversal area and shows evidence that buyers may be responding. This can happen when price briefly moves below a recent low and recovers, or when a candle closes strongly after rejecting lower prices.
A pink diamond appears when price enters the upper reversal area and shows evidence that sellers may be responding. This can happen when price briefly moves above a recent high and falls back, or when a candle closes weakly after rejecting higher prices.
A diamond does not mean enter immediately. It means that side of the market has become active and VantaGate is watching for confirmation.
What creates a LONG or SHORT signal
A LONG signal appears when the lower reversal zone has recently been activated and the internal VantaSpring calculation confirms that downward pressure is beginning to turn upward.
A SHORT signal appears when the upper reversal zone has recently been activated and the internal VantaSpring calculation confirms that upward pressure is beginning to turn downward.
The zone remains active for a limited number of candles after the diamond appears. This gives price enough time to form a proper reversal instead of requiring every condition to happen on the same candle.
Signals are confirmed only after the candle closes. A signal will not appear during the candle and then disappear before the candle finishes.
What makes VantaGate different
VantaGate does not treat every overbought or oversold reading as a trade.
It first asks whether price has moved far enough away from its normal center to matter. It then looks for a real response from buyers or sellers. Finally, it checks whether momentum is beginning to turn.
This creates a simple progression.
Price becomes stretched.
A reversal zone becomes active.
The market shows rejection or a liquidity recovery.
Momentum begins turning.
VantaGate prints a confirmed LONG or SHORT signal.
Understanding the settings
Regression Center Length controls how quickly the silver center line adjusts to price. Lower values react faster. Higher values create a slower and broader view of the market.
Zone ATR Length controls how volatility is measured. The default value is 34. If you use a separate ATR indicator for stop calculations, set it to length 34 with RMA smoothing so it matches VantaGate.
Zone Entry Distance controls how far price must move from the center before entering a reversal area.
Zone Outer Distance controls the outside boundary of each reversal area.
Liquidity Lookback controls how far back VantaGate searches for recent highs and lows.
Zone Permission Memory controls how many candles a reversal zone remains active after qualifying evidence appears.
Rejection Close Threshold controls how strongly a candle must recover from its high or low to count as rejection.
Show Prior Liquidity Levels displays or hides the faint stepped levels.
Color Confirmed Bars changes the color of candles that receive a confirmed LONG or SHORT signal.
Alerts
VantaGate includes separate alerts for LONG and SHORT signals along with one combined alert named VantaGate Any Green Light. The combined alert is the easiest choice when both directions should be monitored with a single TradingView alert.
Suggested use
VantaGate is designed as a decision tool rather than a complete trading system. A LONG or SHORT label identifies a qualified reversal opportunity, but traders should still consider market conditions, available room to the next obstacle, position size, and risk.
The default settings use a 34 period ATR. One possible risk method is placing the stop approximately 2.05 ATR from the reference point and using a reward target equal to twice the amount being risked.
Always test the indicator on the market and timeframe you intend to trade before using real funds. No indicator can predict every reversal, and strong trends can continue farther than expected.
This indicator is provided for educational and informational purposes only. It is not financial advice or a guarantee of future results. Wskaźnik

Mizan Thrust Oscillator (P-RMA vs P-VWMA)Title: Mizan Thrust Oscillator: Adaptive Momentum & Volume Dynamics
Description:
Classic moving averages and traditional oscillators often fall short because they treat the market as a static entity, relying purely on fixed lookback periods. However, the market is never truly static; it is a continuous flow shifting from one probability space to another.
Developed by Mizan Lab, the Mizan Thrust Oscillator is built on the philosophy of dynamic adaptation. It abandons rigid time-based calculations to measure the true "thrust" of the market by calculating the divergence between a momentum-backed volume average and an adaptive rolling moving average.
⚙️ Core Logic & Mathematics
This indicator does not rely on standard price data alone. Instead, it introduces PSI (Scaled RSI Momentum) as the core gravitational pull for its calculations.
It is powered by two distinct hybrid averages (calculated under the hood):
P-VWMA (PSI-Volume Weighted Moving Average): Unlike a standard VWMA that only weights price by volume, the P-VWMA requires both high volume and high momentum (PSI) to move the needle. It tracks the true footprint of institutional flow.
P-RMA (PSI-Adaptive RMA): This moving average dynamically changes its length based on the deviation of current momentum from the "Equilibrium Center". When the trend is explosive, the length decreases to hug the price (reducing lag). When the market is flat, the length expands to filter out the noise.
The lower-panel histogram visualizes the mathematical difference (the Thrust) between the fast-adapting P-RMA and the volume-anchored P-VWMA.
📊 How to Read the Oscillator
The histogram is color-coded to instantly communicate shifts in momentum entropy and trend exhaustion:
Zero Line (Equilibrium) Crossovers: When the histogram crosses above the zero line, it signals a bullish structural shift. Crossing below indicates bearish control.
Dark Blue (Growing Bull): Strong, expanding upward momentum. The adaptive average is pulling away from the volume baseline.
Light Blue (Fading Bull): Bullish momentum is losing entropy. The thrust is weakening, serving as an early warning for potential pullbacks or profit-taking.
Dark Red (Growing Bear): Strong, expanding downward momentum. Sellers are aggressively in control.
Orange (Fading Bear): Bearish momentum is exhausted. The downward thrust is shrinking, indicating a potential bottom or reversal.
Yellow Signal Line: A 5-period WMA applied directly to the histogram to smooth out micro-fluctuations. Crossovers between the histogram bars and this yellow line can be used as secondary confirmation for localized entries/exits.
💡 Why Use the Mizan Thrust Oscillator?
Zero-Lag Responsiveness: By dynamically shortening its internal lookback periods during volatile moves, it catches sharp reversals much faster than traditional MACD or fixed oscillators.
Fakeout Filtration: A move requires both volume and momentum validation to register as a strong thrust, naturally filtering out low-volume traps.
No Repainting: The script is strictly calculated on confirmed bars and historical data without utilizing forward-looking functions.
This script is for educational and analytical purposes only. It is designed to be a supplementary tool for market structure and volume-momentum analysis. Wskaźnik

Liquidity Dynamics Structure EngineOVERVIEW
Liquidity Dynamics Structure Engine is a market-structure visualization tool designed to organize liquidity references, Fair Value Gaps (FVGs), sweep events, structural reactions, and directional context into one coherent chart framework.
Instead of treating an isolated liquidity sweep or imbalance as a standalone signal, the engine evaluates how these elements interact within the current price structure.
The primary workflow is:
Liquidity Structure → Sweep Event → FVG Context → Structural Reaction → Liquidity Objective Context
The purpose is analytical visualization and market-structure study, not trade prediction.
CORE METHODOLOGY
The engine builds its framework from confirmed price information and organizes several related structural components.
1. Liquidity Structure
Confirmed structural highs and lows are used to maintain relevant buy-side and sell-side liquidity references.
These areas represent price-based structural liquidity proxies. They do not represent actual exchange order-book liquidity.
2. Liquidity Sweeps
The engine monitors price interaction with established structural liquidity references.
When price trades through a relevant level and subsequently demonstrates rejection behavior, the event can be classified within the current liquidity context.
Historical event clutter is intentionally controlled so that the chart remains focused on the most relevant information.
3. Fair Value Gap Context
Detected price imbalances are evaluated relative to current structure.
The nearest relevant FVG can be presented as contextual support or resistance depending on its orientation and relationship with price.
Secondary imbalances are visually suppressed in the premium chart view to preserve hierarchy.
4. Structural Reaction Context
The engine maps a reaction region between the current structural environment and the active liquidity objective.
This provides an intermediate reference for studying how price behaves as the developing scenario evolves.
5. Liquidity Objective Gate
A liquidity objective is displayed only when the internal structural conditions produce a valid directional reference.
When no appropriate objective is available, the engine does not force one onto the chart.
An objective is a structural reference—not a price target or forecast.
CONTEXT PATH
When sufficient structural information is available, the engine can display a dashed contextual path connecting the current market area, relevant FVG, reaction context, and liquidity objective.
The path is a visual representation of the currently detected structural scenario.
It should not be interpreted as a prediction of the exact route price will follow.
VISUAL SYSTEM
The chart is intentionally organized around a small number of high-priority objects:
Buy-side and sell-side liquidity references
Relevant liquidity sweep context
Primary FVG support/resistance region
Structural reaction context
Qualified liquidity objective
Contextual scenario path
Compact market-state dashboard
Lower-priority objects are suppressed or reduced to avoid excessive chart clutter.
DASHBOARD
The dashboard summarizes the current analytical state through:
BIAS — current directional structural context.
EVENT — relevant liquidity event recognized by the engine.
FVG — active imbalance orientation and context.
OBJECTIVE — qualified structural liquidity reference when one is available.
These fields describe the engine's current interpretation of market structure. They are not trading signals or probabilities.
HOW TO USE
The indicator is best used as a contextual framework rather than as an isolated entry system.
Users can study whether price is interacting with a relevant liquidity reference, whether a sweep has occurred, how the nearest FVG relates to the developing structure, and whether a valid opposing liquidity reference remains active.
Additional confirmation from the user's own market-structure, risk-management, and execution framework should be considered independently.
CONFIRMATION AND LIMITATIONS
The engine works from chart-based price information and confirmed structural conditions.
Liquidity references are inferred from price structure and should not be confused with actual resting orders or exchange-level order-book data.
Fair Value Gaps identify price imbalances according to the script's defined rules; they do not guarantee future support, resistance, or reaction.
The contextual path represents a structural scenario rather than a forecast.
Market conditions can change, structural references can become invalid, and no displayed zone or event guarantees a particular market outcome.
ORIGINALITY
Liquidity Dynamics Structure Engine was independently developed as a unified structural-context framework.
Its design combines confirmed liquidity references, sweep interpretation, imbalance context, structural reaction mapping, objective qualification, and controlled visual storytelling into a single analytical workflow.
The emphasis is not on generating conventional buy/sell signals, but on organizing related structural evidence into a readable market-state representation.
Release Notes — v1.7
Initial public release
Confirmed structural liquidity mapping
Buy-side and sell-side liquidity context
Liquidity sweep classification
Fair Value Gap detection and contextual classification
Relevant FVG support/resistance visualization
Structural reaction context
Directionally qualified liquidity objective
Three-stage contextual path visualization
Controlled historical-event presentation
Compact market-state dashboard
Chart-object hierarchy designed to reduce visual clutter
Pine Script v6 architecture Wskaźnik

CBC Flip - Volume Profile ContextCBC Flip - Volume Profile Context answers two questions at once: who is in control of the tape right now, and where did that control change hands relative to value.
The control engine is the Candle-By-Candle (CBC) method popularized by maplestax. When a candle closes above the previous candle's high, bulls take control. When a candle closes below the previous candle's low, bears take control. When neither happens, whoever held control keeps it. That hysteresis is the point: it ignores the noisy up-down flicker of individual candles and only acknowledges confirmed closes beyond the prior candle's range.
What this script adds is location. It builds a rolling master volume profile of the trailing window (point of control and value area, calculated as described below), and then keeps only the two control changes that interact with that profile:
BRK - value-area breakout. A bull flip that closes above mVAH, or a bear flip that closes below mVAL: control changed hands where price is being accepted beyond value. The initiative read. A breakout whose flip close is already extended more than 10 percent of the edge-to-POC distance past the edge is hidden as too-late chase noise (the "BRK: max extension past the edge" setting tunes or disables this).
REV - mean reversion. A bull flip from the mVAL side of value, or a bear flip from the mVAH side: responsive activity turning price back toward the master POC. A short dotted guide from the flip price to the current mPOC shows the level the reversion leg is rotating toward. It is a structural readout, not a target.
Everything else - a flip in the dead zone between the POC and the value edge on its own side - is balanced-market noise and is hidden by default ("Show in-value (VA) flips" in the settings brings those back), so every marker you see is structurally tied to the profile.
The same signal never prints twice in a row. A second BRK-long straight after a BRK-long is the same information repeated, so it is suppressed; a signal of the other class or direction re-arms it.
A tilde suffix (~) means the flip fired into an absorbed, two-sided volume node - a price zone where heavy trade has already gone both ways and the flow that would power a follow-through has largely exhausted itself.
What It Draws
Flip labels - a triangle at each control change that matters, tagged BRK or REV. Bright green or red marks a value-area breakout; softer tones mark the reversion case.
REV guide - on a reversion flip, a dotted line from the flip price to the master POC. The target end tracks the POC live as it moves, and the guide disappears on its own when the rotation is finished (price reaches the POC) or has failed (price breaks the flip candle's high or low, or the opposite signal fires). A structural readout, not a target line.
Invalidation dash - while bulls hold control, a dashed line sits at the low of the candle that flipped them in; while bears hold, at the flip candle's high. That is the price a confirmed close beyond would break the structure that armed the current state.
Master profile levels - mPOC (the price the window traded the most volume at), mVAH and mVAL (the edges of the 70 percent value area), each tagged with its live node state: an up or down arrow while one side's flow dominates the node, a tilde when the node has gone balanced and heavily traded (absorbed), flat otherwise.
Optional bar tint - bars can be tinted by the current control state. Off by default.
How the Profile Is Calculated
Over a trailing window (default 100 bars x a 3x master multiplier), every confirmed bar contributes its hlc3 as the price sample and its volume as the weight. The window's high-low range is split into equal bins (default 40), each sample drops into its bin, and the fullest bin is the POC. The value area grows outward from the POC, always taking the heavier adjacent bin, until it encloses the configured share of total volume (default 70 percent, the market-profile convention).
This is a bar-resolution profile, not a tick-resolution one. On most forex and CFD feeds the volume figure is tick volume - a count of price updates, not executed contracts - so read it as a map of activity rather than a ledger of size. That is a property of the data feed, not a setting.
Repaint Policy
Flips register only on confirmed bar closes, strictly beyond the prior candle's high or low (equal closes do not flip), and only when control actually changes hands - continuation breaks in the direction already in control print nothing, which is what keeps the chart readable. By default a flip candle must also close in the flip direction (green for a bull flip, red for a bear flip); switch that off for the bare canonical engine. An optional ATR filter can additionally require the flip candle to have a minimum range. Node states update on confirmed bars only. Labels, once printed, are never moved or removed by later price action.
Settings (defaults as published)
CBC engine - strict breaks (on), minimum flip-candle range in ATR (0 = off), flip candle must close in the flip direction (on), invalidation dash (on), show in-value VA flips (off), BRK maximum extension past the edge (10 percent of the edge-to-POC distance, 0 = off), REV guide to mPOC (on).
Volume profile context - local window 100 bars, master window 3x local (300 bars), 40 price bins, value area 70 percent.
Visuals - master profile levels (on), flip labels (on), bar tint by control state (off).
Alerts - two alert conditions, CBC bull flip and CBC bear flip. They fire on bar close, only for the flips that are displayed.
Limitations
- Bar-resolution profile: each bar contributes one hlc3 sample, so the levels are coarser than a tick-built profile.
- Tick volume on most forex and CFD feeds; two brokers' feeds can disagree.
- The master levels describe the trailing window only and move as the window rolls forward.
- A flip is only known when its candle closes, so it always prints after the move that caused it has started.
- Node states (arrow / tilde / flat) are a synthetic estimate from bar shape, not order flow.
What It Is Not
This indicator does not trade, does not place or suggest orders, and does not draw entries, stops, or targets. It is a passive readout of control and location for your own study. Nothing here is financial advice, and a flip label is not a recommendation to buy or sell.
Disclaimer
This script is a technical indicator and charting tool. It is NOT financial advice, NOT investment advice and NOT a recommendation to enter or exit any position. Trading leveraged products such as CFDs and forex carries a high level of risk and you may lose more than your initial deposit. You are solely responsible for your own trading decisions and their outcomes.
Wskaźnik

XGBoostMiniThis advanced library implements a fully functional, optimized, and native XGBoost (Extreme Gradient Boosting) binary classification model, allowing you to train an ensemble of decision trees and perform real-time inference directly on price data and technical indicators.
🔷 XGBoost Extreme Gradient Boosting
XGBoost is one of the most famous, powerful, and widely used machine learning libraries in the world. Is an ensemble learning model. It works by sequentially combining many weak decision trees (weak learners), where each new tree is specifically trained to correct the errors (residuals) made by the preceding trees. It has become the gold standard for solving tabular data problems and is renowned for dominating competitions on the Kaggle platform for years thanks to its extraordinary combination of speed and precision.
🔹 Key Features That Make It Unique
Speed and Efficiency (Parallelization): Unlike traditional Gradient Boosting, which builds trees in a strictly sequential manner, XGBoost leverages multithreading to parallelize tree construction, drastically reducing computation time.
Built-in Regularization (L1 and L2): It includes penalties for model complexity, which helps prevent overfitting (the phenomenon where the model memorizes training data but fails on unseen data).
Missing Values Handling: It features built-in internal logic to automatically determine how to handle missing or NaN data during the splitting phase, without requiring mandatory upfront preprocessing.
Approximate Split Algorithms: For massive datasets, it uses intelligent techniques to find optimal split points without having to evaluate every single value, further accelerating the process.
🔹 What is XGBoost and Where Did It Come From?
XGBoost (eXtreme Gradient Boosting) is one of the most powerful and widely used machine learning algorithms in the world, particularly for structured and tabular data.
It was created in 2014 by Tianqi Chen (then a researcher at the University of Washington) as an open-source research project, and it became a global phenomenon in 2016 following the publication of its landmark paper presented at the SIGKDD conference. Chen aimed to push the concept of Gradient Boosting (sequentially combining weak decision trees, where each new tree corrects the errors of previous ones) beyond the limitations of traditional software at the time. The goal was to build a system that combined extreme computational speed (leveraging parallel hardware) with extraordinary predictive accuracy, introducing advanced techniques such as mathematical regularization to prevent overfitting.
🔹 Why XGBoost is a Brilliant Choice for Financial Time Series Trading
In quantitative trading, financial market data (prices, volumes, and technical indicators like RSI, MACD, and moving averages) almost always comes in a tabular format. Here is why XGBoost frequently outperforms more complex models (such as Neural Networks or Transformers) when analyzing financial time series:
Tabular Data Dominance : Unlike images or text, historical time series structured as indicators and extracted features benefit immensely from decision trees. XGBoost excels at discovering complex threshold rules (e.g., "if the RSI is below 30 and volatility exceeds X, then...").
Noise Management and Regularization: Financial markets are notoriously noisy. XGBoost’s regularization parameters penalize tree complexity, preventing the model from memorizing past data and forcing it to uncover generalizable patterns.
Robustness to Outliers: Flash crashes, sudden volume spikes, or data anomalies do not throw decision trees off balance—unlike linear models or neural networks, which are often sensitive to extreme values.
Interpretability via Feature Importance: In trading, guessing direction is not enough; you must understand why. XGBoost natively computes the importance of each variable (via structural gain), allowing you to discover which technical indicators are genuinely driving strategy performance versus those that are just noise.
Real-Time Inference Speed: Because it relies on simple sequential logical comparisons (inference across shallow decision trees), it is ideal for real-time execution directly on platforms like TradingView without excessive latency.
🔷 1. User-Defined Types (UDTs)
The code leverages Pine Script v6 data structures to define the model architecture:
XGBTreeDepth3: Represents a single weak learner with a fixed depth of 3 levels. It stores feature indices, split thresholds, information gains for each node, and the terminal leaf weights (w0 through w7) for all 8 possible leaf regions.
XGBModel: Encapsulates the entire trained tree ensemble, the best recorded validation loss (best_val_loss), and the optimal number of trees to retain (best_tree_count).
SplitCandidate: An internal helper structure used to evaluate optimal split points during tree growth.
🔷 2. Inference & Analysis Methods
predict_tree: Traverses the depth-3 decision tree by sequentially evaluating feature values against stored thresholds until a terminal leaf node is reached.
predict_probability: Aggregates the raw scores (logits) across all trees in the ensemble, applies the learning rate, and maps the final output to a logistic probability ranging from 0.0 to 1.0 via the Sigmoid function (including numerical protection against overflow/underflow).
calculate_feature_importance: Computes relative feature importance (0.0 to 1.0) by aggregating the structural gain accumulated by each variable across the entire ensemble.
🔷 3. Static Quantile Pre-Binning
The find_split_subset_fast function and the initial training phase implement Static Quantile Pre-Binning: prior to boosting, historical feature values are sorted and binned into quantitative buckets. This dramatically accelerates the search for optimal split points during tree construction, significantly reducing computational overhead.
🔷 4. The Training Pipeline
This is the core of the library, executing an iterative boosting loop that includes:
1. Row and Column Subsampling: Supports random sampling of instances and features to mitigate overfitting.
2. Gradient Computation: Computes first-order gradients and second-order Hessians based on binary cross-entropy loss.
3. Depth-3 Tree Construction: Progressively identifies optimal splits level by level using XGBoost regularization criteria.
4. Early Stopping & Validation: Automatically carves out a validation subset and halts training if the validation loss fails to improve over a specified number of rounds, subsequently rolling back to the optimal tree count.
🔷 Constraints to Consider
🔹 Architectural & Complexity Limitations (Fixed Depth of 3)
The tree is hardcoded with a fixed depth of 3 (XGBTreeDepth3), meaning it can evaluate a maximum of 3 levels of decisions (up to 8 terminal leaves). This can result in an inability to capture complex interactions. In financial markets, complex patterns often require deeper trees to combine multiple simultaneous conditions. A depth of 3 severely limits the learning capacity for advanced non-linear relationships.
🔹 Computational & Execution Limitations
Training a Gradient Boosting model requires a high volume of computations (nested loops for scanning matrices, calculating quantiles, sorting arrays, and evaluating gradients). Increasing the number of trees, feature matrix size, or number of bins too much will cause the script to abort due to exceeding the maximum execution loop limit allowed per single script (typically a few tens of thousands of operations before timing out).
Validation splits data by simply taking a portion of the rows. In financial time series, this can cause Data Leakage if training and validation data mix without strictly respecting the chronological sequence (the model might "peek" into the future if a Walk-Forward or Time-Series Split approach is not used).
Without a rigorous Out-Of-Sample (OOS) test set, a model trained directly on past prices will easily tend to find spurious correlations (market "noise" rather than real signals), failing miserably when applied to future real-time data.
🔹 Technical Rationale for Design Choices
There are very specific technical reasons why advanced features like dynamic Walk-Forward or continuous Rolling Retraining have not been natively integrated into this library:
The Computational Bottleneck
A true Walk-Forward or Rolling Retraining (retraining the model bar-by-bar or across rolling time blocks) requires repeating the entire training process—quantile calculation, matrix scanning, iterative tree construction—hundreds or thousands of times on massive historical datasets. Continuous retraining would immediately trigger an Execution Timeout error.
Memory & Historical Data Architecture
Managing matrices and historical arrays carries strict performance constraints. Accessing past data from hundreds of bars while applying complex temporal slicing logic rapidly consumes the heap memory allocated for the script, slowing down or freezing the chart.
This is why a "static and lightweight" approach was chosen for this library. The script trains the model once (or on a fixed portion of data) and leverages the speed of pre-compiled trees to perform real-time inference without exceeding computational limits.
---------------------------------------------------------------
Library "XGBoostMini"
XGBoost Mini Library featuring Static Quantile Pre-Binning, Early Stopping, Subsampling, and Feature Importance.
method predict_tree(self, features)
Evaluates the raw score (logit sum contribution) of a single depth-3 tree on a feature vector.
Traverses the binary decision tree hardcoded for 3 levels (up to 8 terminal leaves).
Namespace types: XGBTreeDepth3
Parameters:
self (XGBTreeDepth3)
features (array)
predict_probability(model, features, learning_rate)
Computes the final Sigmoid probability (0.0 to 1.0) by aggregating the boosted ensemble.
Applies learning rate scaling and numerical overflow/underflow clamping to the raw accumulated score.
Parameters:
model (XGBModel)
features (array)
learning_rate (float)
calculate_feature_importance(model, n_features)
Calculates relative Feature Importance (0.0 - 1.0) based on accumulated structural gain across the ensemble.
Parameters:
model (XGBModel)
n_features (int)
train_model(X_matrix, y_target, num_trees, learning_rate, lambda_reg, quantile_bins, min_samples_split, subsample, colsample_bytree, val_ratio, patience)
Main entry point to train the XGBoost ensemble.
Implements Static Quantile Pre-Binning, Row/Column Subsampling, Binary Cross-Entropy Loss, and Early Stopping.
Parameters:
X_matrix (matrix)
y_target (array)
num_trees (int)
learning_rate (float)
lambda_reg (float)
quantile_bins (int)
min_samples_split (int)
subsample (float)
colsample_bytree (float)
val_ratio (float)
patience (int)
XGBTreeDepth3
XGBTreeDepth3
Fields:
f_r (series int)
t_r (series float)
g_r (series float)
f_l (series int)
t_l (series float)
g_l (series float)
f_right (series int)
t_right (series float)
g_right (series float)
f_ll (series int)
t_ll (series float)
g_ll (series float)
f_lr (series int)
t_lr (series float)
g_lr (series float)
f_rl (series int)
t_rl (series float)
g_rl (series float)
f_rr (series int)
t_rr (series float)
g_rr (series float)
w0 (series float) : to w7 Leaf node terminal weights (predictions) for all 8 possible regions of a depth-3 tree.
w1 (series float)
w2 (series float)
w3 (series float)
w4 (series float)
w5 (series float)
w6 (series float)
w7 (series float)
XGBModel
XGBModel
Fields:
ensemble (array) : Array storing all trained XGBTreeDepth3 weak learners.
best_val_loss (series float) : Lowest validation loss achieved (used for tracking convergence).
best_tree_count (series int) : Optimal number of trees retained after early stopping. Biblioteka

Daily Bias Intelligence [tradewsamet]🎯 DAILY BIAS INTELLIGENCE
Daily Bias Intelligence is a statistical daily-context, historical-bias, range-analysis, intraday-state, calibration, and visualization indicator designed to help traders study how the current trading day compares with completed historical trading days.
The script is built around one central idea:
Daily bias should not be reduced to one weekday percentage or one directional signal.
A trading day develops inside several overlapping historical contexts. Today's weekday, yesterday's direction, the preceding three-day regime, recent market behavior, directional move skew, current time-of-day state, prior-day high/low interaction, range development, and session timing can all describe different parts of the same day.
Daily Bias Intelligence organizes these observations into one transparent analytical framework.
The script can:
• maintain a rolling history of completed trading days
• measure historical weekday directional behavior
• compare today's context with similar previous-day and three-day regimes
• measure recent completed-day directional behavior and Move Skew
• apply sample-size and statistical requirements before historical checks influence the main model
• combine qualified checks into a sample-weighted Daily Bias Score
• classify Strong Bullish / Strong Bearish historical-bias states
• calculate weekday P10 / P25 / P50 / P75 / P90 return distributions
• adjust historical movement for changing volatility regimes
• compare the developing day with historical days at approximately the same point in time
• track prior-day high / low behavior
• study where daily highs and lows historically formed
• measure current daily-range usage and directional streak behavior
• measure Asia / London / New York contribution by weekday
• audit strong-call and expected-range calibration
• display radar, statistics, weekday charts, day boxes, levels, and oscillator views
• provide TradingView alert conditions for important daily-context events
Daily Bias Intelligence is intended as a transparent statistical research and historical-review framework.
It is not a broker execution system, TradingView Strategy Tester, probability-of-profit model, or guarantee of future market direction.
━━━━━━━━━━━━━━━━━━━━━━
📸 CHART SNAPSHOT
━━━━━━━━━━━━━━━━━━━━━━
━━━━━━━━━━━━━━━━━━━━━━
📌 OVERVIEW
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence maintains a rolling database of completed trading days and uses that history to describe the statistical environment surrounding the current trading day.
The indicator separates three different types of information:
Observed historical statistics
Examples include weekday up-day rates, prior-day break rates, session contribution, and range behavior.
Modeled context
Examples include the Daily Bias Score and statistical-significance classifications.
Developing current-day information
Examples include today's return versus the prior close, current range, today's high/low, and NOW-state comparison.
The primary interface can display:
• five-factor Bullish / Bearish Radar
• Daily Bias Score
• Strong Bullish / Strong Bearish state
• four-card Statistics Panel
• weekday directional chart and ALL-days baseline
• calibration scorecard
• P10–P90 and P25–P75 expected ranges
• weekday median and expected absolute movement
• prior-day highs and lows with break markers
• daily range boxes and result labels
• live current-day percentage
• contextual candle coloring
• Waveform, Heat Stripes, or Bar Columns
The indicator is designed to provide context before independent trading decisions rather than creating automatic trade instructions.
━━━━━━━━━━━━━━━━━━━━━━
🧠 CORE IDEA
━━━━━━━━━━━━━━━━━━━━━━
A simple daily-bias model might ask only:
How often did Monday close higher?
Daily Bias Intelligence asks several additional questions.
• What direction did the previous trading day close?
• What was the net direction of the preceding three completed days?
• What has recent completed-day behavior looked like?
• Has historical movement on this weekday been concentrated more on the upside or downside?
• Is the supporting sample large enough?
• Is the observed difference statistically separated from 50%?
• What movement distribution historically belongs to this weekday?
• What happened historically when price was in today's current state at approximately this point in the day?
• How often are prior-day highs and lows broken?
• When do the final daily high and low typically form?
• How much of a normal daily range has already been used?
The workflow is:
completed trading days
→ historical context classification
→ sample validation
→ statistical filtering
→ weighted Daily Bias Score
→ optional strong-bias classification
→ weekday movement distribution
→ live intraday context
→ historical calibration
The indicator is designed to answer:
What does the completed historical dataset say about the type of trading day currently developing?
━━━━━━━━━━━━━━━━━━━━━━
🧩 WHY THIS SCRIPT IS NOT A SIMPLE DAILY BIAS INDICATOR
━━━━━━━━━━━━━━━━━━━━━━
A basic daily-bias tool may calculate one historical percentage and convert it directly into a bullish or bearish label.
Daily Bias Intelligence uses a layered model instead.
Historical checks first require sufficient observations.
Directional rates are then evaluated relative to a neutral reference.
Eligible observations are combined through sample-aware weighting.
Strong classifications are separately gated.
Expected movement is calculated from a weekday-specific historical distribution.
Current intraday state is then studied independently from the opening historical-bias model.
Finally, previous strong classifications and range projections are evaluated after their corresponding trading days complete.
The structure is:
historical observations
→ sample quality
→ statistical evidence
→ modeled bias
→ live context
→ later calibration
A historical observation can exist without being statistically strong.
A Daily Bias Score can lean bullish or bearish without producing a Strong Bullish / Strong Bearish classification.
A strong historical bias can still fail.
A wide expected range says nothing by itself about direction.
The script keeps these concepts separate instead of forcing every statistic into one entry arrow.
━━━━━━━━━━━━━━━━━━━━━━
⚙️ HOW THE SCRIPT WORKS
━━━━━━━━━━━━━━━━━━━━━━
The engine stores completed trading-day information in aligned historical arrays.
A stored historical day can contain:
• raw daily return
• volatility-normalized return
• trading weekday
• previous-day direction known at that day's open
• prior three-day regime known at that day's open
• raw daily price change
• Asia / London / New York contribution
• prior-day high / low break state
• high / low break hold state
• session of the final high and low
• elapsed time until the final high and low
• intraday state relative to the prior close
• completed daily range
• directional streak entering the day
When the next trading day begins, the previous day is finalized and added to the historical dataset.
The model then rebuilds the current day's statistical context from completed observations.
This means the principal historical bias model does not require today's future closing result in order to calculate today's opening context.
━━━━━━━━━━━━━━━━━━━━━━
🔷 BULLISH / BEARISH RADAR
━━━━━━━━━━━━━━━━━━━━━━
The Bullish / Bearish Radar summarizes five historical checks.
WEEKDAY
The up-day rate of completed trading days sharing today's weekday.
PREV DAY
The up-day rate of historical days whose previous day moved in the same direction as yesterday.
3D REGIME
The up-day rate of historical days whose preceding three-day net move had the same directional sign as today's regime definition.
RECENT
The up-day rate across the most recent completed-day sample.
MOVE SKEW
The share of today's-weekday absolute historical movement that occurred in the positive direction.
Radar values represent historical observed shares, not probabilities.
The five checks also overlap, so they should not be interpreted as five independent forecasts.
━━━━━━━━━━━━━━━━━━━━━━
📐 SAMPLE DEPTH & STATISTICAL FILTERING
━━━━━━━━━━━━━━━━━━━━━━
Every historical percentage carries a sample size.
Minimum Sample controls how much historical depth is required before a check can influence the primary Daily Bias Score.
Directional-rate checks use a Wilson 95% interval.
A raw rate slightly above 50% is not automatically considered statistically bullish.
The check must:
• satisfy Minimum Sample
• have its Wilson interval fully above 50%
The equivalent bearish condition requires the interval to sit fully below 50%.
Move Skew uses a separate Student-t based test on the historical mean return.
These tests are historical evidence filters. They do not convert historical statistics into guaranteed future probabilities.
━━━━━━━━━━━━━━━━━━━━━━
📸 CODE EXAMPLE 1 — SAMPLE & WILSON FILTER
━━━━━━━━━━━━━━━━━━━━━━
setRateAxis(int i, float up, float n, float minN) =>
array.set(axShare, i, n > 0 ? up / n * 100.0 : na)
array.set(axN, i, n)
array.set(axMinN, i, minN)
= wilson(up, n)
int sig = 0
if n >= minN
sig := lo > 50.0 ? 1 : hi < 50.0 ? -1 : 0
array.set(axSig, i, sig)
The model keeps the observed percentage, supporting sample size, and statistical classification as separate pieces of information.
━━━━━━━━━━━━━━━━━━━━━━
🧠 DAILY BIAS SCORE
━━━━━━━━━━━━━━━━━━━━━━
Historical checks that satisfy their minimum sample requirement can contribute to the Daily Bias Score.
Each eligible check is measured relative to the neutral 50 level.
Its influence is weighted using the square root of its sample size.
This allows deeper samples to receive additional weight without allowing a very large sample to dominate the model linearly.
Conceptually:
validated historical share
→ distance from 50
→ √N sample weighting
→ weighted combination
→ Daily Bias Score
A score above 50 represents bullish historical context.
A score below 50 represents bearish historical context.
A score of 60 does not mean there is a 60% probability that price will close higher.
━━━━━━━━━━━━━━━━━━━━━━
📸 CODE EXAMPLE 2 — WEIGHTED BIAS MODEL
━━━━━━━━━━━━━━━━━━━━━━
float wSum = 0.0
float sSum = 0.0
for i = 0 to NAXES - 1
float sh = array.get(axShare, i)
float nn = array.get(axN, i)
if not na(sh) and nn >= array.get(axMinN, i)
wSum += math.sqrt(nn)
sSum += math.sqrt(nn) * (sh - 50.0)
biasScore := wSum > 0 ? 50.0 + sSum / wSum : na
━━━━━━━━━━━━━━━━━━━━━━
🔥 STRONG BULLISH / STRONG BEARISH DAYS
━━━━━━━━━━━━━━━━━━━━━━
A directional Daily Bias Score does not automatically become a strong classification.
Minimum Bias controls the required distance from the neutral 50 level.
When Require Significant Check is enabled, a Strong Bullish Day additionally requires:
• at least one statistically significant bullish check
• no statistically significant bearish checks
A Strong Bearish Day requires the opposite.
The engine also uses a warm-up requirement before strong classifications are allowed.
A strong classification should be interpreted as:
The historical conditions used by this model are unusually aligned in this direction.
It should not be interpreted as certainty about today's final close.
━━━━━━━━━━━━━━━━━━━━━━
📅 WEEKDAY INTELLIGENCE
━━━━━━━━━━━━━━━━━━━━━━
The weekday chart displays the directional history of available trading weekdays.
Each weekday can show:
• historical up-day rate
• completed sample size
• Wilson 95% interval
• average return
• average absolute move
Today's weekday is highlighted.
An optional ALL column displays the broader all-days directional baseline.
This comparison matters because an apparently strong weekday rate can be less meaningful when the instrument already has a similar unconditional directional drift.
Example:
Monday historical up-rate: 58%
All-days historical up-rate: 57%
The Monday number is above 50%, but its difference from the instrument's normal historical behavior is small.
━━━━━━━━━━━━━━━━━━━━━━
🎯 EXPECTED WEEKDAY RANGE
━━━━━━━━━━━━━━━━━━━━━━
When sufficient observations exist for today's weekday, the script builds a historical movement sample.
From this sample it calculates:
• P10
• P25
• P50
• P75
• P90
P10–P90 represents the broader historical distribution.
P25–P75 represents the central historical distribution.
P50 represents the historical median.
In Volatility-Adjusted mode, each historical return is normalized using the volatility available at that historical day's open and rescaled using today's volatility reference.
These ranges are empirical historical quantiles.
They are not guaranteed support/resistance boundaries or Take Profit levels.
━━━━━━━━━━━━━━━━━━━━━━
📸 CODE EXAMPLE 3 — WEEKDAY QUANTILES
━━━━━━━━━━━━━━━━━━━━━━
bool deep = array.size(samp) >= minSample
tP10 := deep ? array.percentile_linear_interpolation(samp, 10) : na
tP25 := deep ? array.percentile_linear_interpolation(samp, 25) : na
tP50 := deep ? array.percentile_linear_interpolation(samp, 50) : na
tP75 := deep ? array.percentile_linear_interpolation(samp, 75) : na
tP90 := deep ? array.percentile_linear_interpolation(samp, 90) : na
━━━━━━━━━━━━━━━━━━━━━━
🕒 NOW — SAME-TIME-OF-DAY CONTEXT
━━━━━━━━━━━━━━━━━━━━━━
The NOW card studies the developing trading day from a different perspective.
During completed historical days, the script stores whether price was above or below the prior close at different stages of the trading day.
During today's developing session, it finds historical observations that were:
• at approximately the same stage of the trading day
• on the same side of their prior close
The model then measures how often those historical days eventually closed on that same side.
This distinguishes:
Price is currently above yesterday's close
from:
Historically, when price was already above yesterday's close around this point of the trading day, how often did it remain above into the final close?
The NOW card also compares this conditional result with the broader all-days baseline.
━━━━━━━━━━━━━━━━━━━━━━
📸 CODE EXAMPLE 4 — SAME-TIME-OF-DAY MATCHING
━━━━━━━━━━━━━━━━━━━━━━
if hasNow and math.floor(array.get(hMSeen, i) / pwNow) % 2 == 1
bool wasUp = math.floor(array.get(hMUp, i) / pwNow) % 2 == 1
if wasUp == nowUp
lvN += 1.0
lvK += up == nowUp ? 1.0 : 0.0
Historical observations are completed days.
Today's live state remains provisional while the trading day develops.
━━━━━━━━━━━━━━━━━━━━━━
📍 PRIOR DAY HIGH / LOW
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence can extend completed prior-day highs and lows forward on the price chart.
Each level remains active until price trades through it on a confirmed chart bar.
When a break occurs:
• the level stops extending
• the line becomes visually muted
• the configured break marker is displayed
Historical statistics separately measure:
• prior-day high break rate
• prior-day low break rate
• both-side break rate
• neither-side / inside rate
• high-break hold rate
• low-break hold rate
A wick through the level counts as a break under the current model.
Prior-day highs and lows are analytical reference levels, not guaranteed support or resistance.
━━━━━━━━━━━━━━━━━━━━━━
⏱️ HIGH / LOW TIMING
━━━━━━━━━━━━━━━━━━━━━━
The indicator studies where and when completed trading days formed their final highs and lows.
For intraday charts, each completed high and low is associated with one of three fixed UTC windows:
• Asia — 21:00 to 08:00 UTC
• London — 08:00 to 13:00 UTC
• New York — 13:00 to 21:00 UTC
The HIGH / LOW TIMING card can display:
• the session that historically produced the most daily highs
• the session that historically produced the most daily lows
• how often the final high had already formed by the current point in the day
• how often the final low had already formed
• the session containing today's current high and low
Timing precision depends on the active chart timeframe.
━━━━━━━━━━━━━━━━━━━━━━
📏 STREAK & RANGE CONTEXT
━━━━━━━━━━━━━━━━━━━━━━
The STREAK & RANGE card combines two additional daily-context questions.
Directional streak
The script identifies consecutive positive or negative completed days entering the current trading day and studies historical days that followed a comparable streak.
Range development
The script calculates recent average daily high-low range and compares it with today's developing range.
The card can show:
• recent average range
• today's range so far
• percentage of normal range already used
• percentage of historical days that ultimately became wider than today's current range
This helps distinguish a relatively compressed day from one that has already consumed an unusually large share of its recent historical range.
━━━━━━━━━━━━━━━━━━━━━━
🌍 SESSION CONTRIBUTION
━━━━━━━━━━━━━━━━━━━━━━
Intraday price changes are attributed bar by bar to the fixed UTC session model.
For today's weekday, Daily Bias Intelligence calculates the historical average percentage contribution of:
• Asia
• London
• New York
Session contribution measures historical price movement.
It does not measure order flow or institutional activity.
The UTC windows do not dynamically adjust for daylight-saving changes.
━━━━━━━━━━━━━━━━━━━━━━
🧾 CALIBRATION SCORECARD
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence includes a calibration layer so important model outputs can be evaluated after the fact.
CALLS
Tracks completed Strong Bullish / Strong Bearish classifications and compares their directional hit rate with baseline drift.
RANGE HIT
Tracks how frequently completed trading days closed inside:
• P10–P90
• P25–P75
|MOVE|
Displays the historical average absolute movement for today's weekday and compares it with the all-days average.
SESSIONS
Displays historical average Asia, London, and New York contribution for today's weekday.
━━━━━━━━━━━━━━━━━━━━━━
📸 CODE EXAMPLE 5 — SEQUENTIAL CALIBRATION
━━━━━━━━━━━━━━━━━━━━━━
if todayStable and not na(tP10) and not na(tP90)
calN += 1.0
calIn80 += (r >= tP10 and r <= tP90) ? 1.0 : 0.0
calIn50 += (r >= tP25 and r <= tP75) ? 1.0 : 0.0
if callDir != 0 and allN > 0
callN += 1.0
callHit += ((r > 0) == (callDir > 0)) ? 1.0 : 0.0
callBase += callDir > 0 ? allUp / allN : 1.0 - allUp / allN
A projection is evaluated only after the corresponding trading day later completes.
The final result is not used to create the earlier projection being evaluated.
━━━━━━━━━━━━━━━━━━━━━━
📊 OSCILLATOR VIEWS
━━━━━━━━━━━━━━━━━━━━━━
The lower pane supports several presentation styles.
Off
Keeps the pane focused primarily on statistical panels.
Waveform
Displays the current day's running positive and negative excursion relative to the prior close.
Heat Stripes
Displays developing daily movement as a volatility-normalized background together with a rolling-return line.
Bar Columns
Displays the developing daily return as columns.
These views describe price behavior and do not independently determine the Daily Bias Score.
━━━━━━━━━━━━━━━━━━━━━━
📦 DAY BOXES & DAILY RESULTS
━━━━━━━━━━━━━━━━━━━━━━
The script can frame each trading day's high-low range with a Day Box.
A completed day's box receives its final contextual color after the day completes.
Today's live box remains dashed and updates as the high and low develop.
Completed daily-result labels can display the final daily percentage return.
Today's live percentage can also be displayed separately.
━━━━━━━━━━━━━━━━━━━━━━
🕯️ CANDLE COLORING
━━━━━━━━━━━━━━━━━━━━━━
Candle coloring can compare current price with the previous completed trading-day close.
Vs Prior Close
Price above the reference uses the bullish candle color.
Price below the reference uses the bearish candle color.
Because today's price is live, the contextual color can change throughout the session.
Off
Leaves the chart's native candle colors unchanged.
Candle coloring is visual context only.
━━━━━━━━━━━━━━━━━━━━━━
🚨 ALERT SYSTEM
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence includes TradingView alert conditions for:
• Strong Bullish Day
• Strong Bearish Day
• Day Above Weekday P90
• Day Below Weekday P10
• Any Daily Bias Intelligence Alert
Strong-day alerts relate to the historical context generated for the new trading day.
P90 / P10 events trigger only after a confirmed chart bar closes beyond the corresponding weekday range level.
Alerts are monitoring tools and do not execute broker orders.
━━━━━━━━━━━━━━━━━━━━━━
🔔 HOW TO USE ALERTS
━━━━━━━━━━━━━━━━━━━━━━
For a specific alert:
1. Add Daily Bias Intelligence to the chart.
2. Open TradingView's Create Alert dialog.
3. Select Daily Bias Intelligence .
4. Select the required alert event.
5. Choose the notification method.
6. Configure the alert frequency.
7. Test the alert before relying on it.
For a combined workflow:
1. Add the indicator to the chart.
2. Open Create Alert.
3. Select Daily Bias Intelligence .
4. Select Any Daily Bias Intelligence Alert.
5. Configure the notification method.
6. Test the events on the intended symbol and timeframe.
If the script, symbol, timeframe, or important settings change materially, recreate the alert when necessary.
━━━━━━━━━━━━━━━━━━━━━━
🧪 HOW TO USE THE INDICATOR
━━━━━━━━━━━━━━━━━━━━━━
A practical workflow:
1. Add Daily Bias Intelligence to a standard candlestick chart.
2. Make sure enough historical trading days are loaded for the selected Lookback and Minimum Sample.
3. Begin with Volatility-Adjusted Return Units if you want historical movement normalized across changing volatility regimes.
4. Review the Bullish / Bearish Radar.
5. Check the sample size behind each observation.
6. Review the Daily Bias Score and strong-state classification.
7. Compare today's weekday with the ALL baseline.
8. Review P10–P90, P25–P75, P50, and expected absolute movement.
9. Use NOW to compare today's developing state with similar completed historical days.
10. Review prior-day high / low behavior.
11. Review high / low timing.
12. Review streak and daily-range usage.
13. Review session contribution.
14. Use CALLS and RANGE HIT to judge calibration over meaningful samples.
15. Use alerts as monitoring assistance rather than automatic execution.
The indicator should be combined with independent market structure, liquidity, volatility, news, execution, position-sizing, and account-risk analysis.
━━━━━━━━━━━━━━━━━━━━━━
⚙️ SETTINGS REFERENCE
━━━━━━━━━━━━━━━━━━━━━━
⚙️ Statistics Engine
• Lookback Trading Days — number of completed trading days retained.
• Return Units — Volatility-Adjusted / Raw %.
• Volatility Length — completed-day volatility sample.
• Recent Window — completed days used by RECENT.
• Minimum Sample — minimum N required for qualified statistical use.
🧠 Bias Intelligence
• Minimum Bias — required Daily Bias Score displacement from 50.
• Require Significant Check — requires compatible statistical evidence.
📊 Oscillator & Statistics
• Statistics Panel
• Panel Position
• Panel Width / Height
• Text Size
• Plot Style
• Rolling Line
• Today's Expected Range
• Weekday Median
• Daily Result Labels
• Label Location
• Days Shown
📍 Prior Day High / Low
• Show Prior Day High / Low
• Days Kept
• Break Marker
📦 Day Boxes
• Show Day Boxes
• Box Fill Transparency
🧭 Weekday Chart & Scorecard
• Show Weekday Chart
• Show Scorecard
• Main Chart / Pane placement
• Position
• Width
• Bar Area Height
• Show All-Days Column
🔷 Bullish / Bearish Radar
• Show Radar
• Offset
• Radius Bars
• Radius σ
🕯️ Chart Candles
• Candle Colouring — Vs Prior Close / Off
• Bullish Candle Color
• Bearish Candle Color
🎨 Theme & Colours
• Auto
• Dark
• Light
• supporting visual accent controls
Visual and theme changes do not alter the underlying historical calculations.
━━━━━━━━━━━━━━━━━━━━━━
🧠 WHAT MAKES THIS SCRIPT ORIGINAL
━━━━━━━━━━━━━━━━━━━━━━
Daily returns, weekday statistics, volatility normalization, confidence intervals, quantiles, daily highs/lows, and prior-day levels are established analytical concepts.
Daily Bias Intelligence does not claim ownership of those individual concepts.
Its originality lies in how they are coordinated into one completed-day state model.
The implementation combines:
completed-day historical storage
→ weekday context
→ previous-day context
→ three-day regime
→ recent directional context
→ Move Skew
→ Minimum Sample validation
→ Wilson / Student-t statistical filtering
→ √N-weighted Daily Bias Score
→ strong-bias gating
→ volatility-adjusted weekday quantiles
→ same-time-of-day state matching
→ prior-day high / low behavior
→ daily high / low timing
→ streak and range intelligence
→ session contribution
→ sequential range and directional calibration
Distinctive implementation choices include:
• separating observed historical rates from modeled bias
• preventing thin samples from influencing the primary score
• applying statistical filters before strong classifications
• weighting eligible observations by square-root sample depth
• separating live current-day state from completed historical results
• storing historical intraday state for same-time-of-day comparison
• comparing strong-call results with baseline drift
• evaluating projected ranges only after their corresponding days complete
The modules serve one coordinated objective:
making the historical structure surrounding the current trading day visible, measurable, and reviewable.
━━━━━━━━━━━━━━━━━━━━━━
⚠️ IMPORTANT PRACTICAL NOTES
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence depends on available chart history.
Important points:
• Low intraday timeframes can contain fewer completed trading days within the same loaded-bar allowance.
• Every rate should be interpreted together with its sample size.
• Minimum Sample prevents thin observations from influencing key parts of the model.
• Expected weekday ranges require sufficient weekday history.
• Volatility-Adjusted mode changes movement normalization but not directional up/down classification.
• RECENT uses at least the Minimum Sample requirement when the configured Recent Window is smaller.
• Flat completed days are treated as not-up.
• Today's return, high, low, range, NOW state, and contextual candle colors remain live.
• Statistical significance is not certainty.
• Strong historical states and range projections can fail.
• Historical relationships can change as market regimes change.
• Changing important settings rebuilds the historical model under the new configuration.
━━━━━━━━━━━━━━━━━━━━━━
⚠️ LIMITATIONS AND SHORTCOMINGS
━━━━━━━━━━━━━━━━━━━━━━
This script has important limitations:
• Historical frequency is not future probability.
• A statistically significant historical observation does not guarantee today's result.
• The five radar checks overlap and are not independent evidence.
• Multiple comparisons create a risk of chance findings.
• The Daily Bias Score is modeled context, not expected return or probability.
• Strong Bullish / Strong Bearish classifications can be incorrect.
• Sample depth is limited by available chart history.
• Low-timeframe charts may contain relatively few completed trading days.
• Volatility adjustment can react slowly to sudden regime changes.
• Historical quantiles are not fixed future boundaries.
• Prior-day high / low breaks can fail after occurring.
• Session attribution uses fixed UTC hours and does not dynamically adjust for daylight-saving changes.
• Extended-hours data can influence calculations where available.
• High / low timing is limited by chart timeframe resolution.
• Holiday and shortened-session days are treated as normal completed trading days.
• Current-day values remain provisional until the trading day completes.
• Different feeds, symbols, chart history, and timeframes can produce different statistics.
The indicator should be treated as a statistical context tool rather than a standalone predictive system.
━━━━━━━━━━━━━━━━━━━━━━
👤 WHO THIS SCRIPT MAY BE USEFUL FOR
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence may be useful for traders who:
• want historical daily context before evaluating intraday setups
• study weekday tendencies
• want sample sizes beside historical percentages
• prefer statistical filtering over raw percentages alone
• study prior-day highs and lows
• monitor daily-range development
• study when final daily highs and lows tend to form
• compare the current stage of the day with completed historical observations
• want directional context without automatic trade entries
• want historical expected-range information
• value calibration and transparent statistical assumptions
It may be less suitable for users who require automatic entries, automatic SL/TP systems, broker execution, tick-level reconstruction, account-level Strategy Tester results, or guaranteed directional predictions.
━━━━━━━━━━━━━━━━━━━━━━
🧭 BEST PRACTICE SUGGESTIONS
━━━━━━━━━━━━━━━━━━━━━━
For normal use:
• start with sufficient completed-day history
• keep Minimum Sample high enough that thin observations do not dominate interpretation
• compare weekday percentages with the ALL baseline
• read the Daily Bias Score together with the individual radar checks
• distinguish directional lean from a Strong Bullish / Strong Bearish state
• interpret statistical significance as evidence strength, not certainty
• treat expected ranges as historical distributions rather than fixed price barriers
• use NOW as live context rather than a standalone signal
• combine prior-day level statistics with current price behavior
• review CALLS versus drift rather than raw hit rate alone
• wait for meaningful calibration samples before drawing conclusions
• compare symbols and timeframes independently
When testing inputs, change one major group at a time so the effect on sample size, bias classification, expected range, and calibration remains understandable.
━━━━━━━━━━━━━━━━━━━━━━
🔓 PUBLICATION NOTE
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence is published as an educational daily-statistics, historical-bias, intraday-context, expected-range, calibration, visualization, and alert indicator.
This description documents the main mechanics used by the script, including:
• completed-day historical storage
• weekday analysis
• previous-day and three-day context
• recent directional behavior
• Move Skew
• statistical filtering
• Daily Bias Score
• strong-bias classification
• expected weekday distributions
• volatility adjustment
• same-time-of-day analysis
• prior-day high / low behavior
• high / low timing
• streak and range analysis
• session attribution
• sequential calibration
• visualizations and alerts
These modules serve one coordinated purpose:
providing a transparent statistical description of the current trading day based primarily on completed historical observations.
The script does not promise profitable results, remove market risk, or replace independent analysis and personal risk management.
━━━━━━━━━━━━━━━━━━━━━━
🕒 DATA TIMING, REPAINTING, AND HISTORICAL PLACEMENT DISCLOSURE
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence v1.0 builds its principal historical model from completed trading days.
A trading day is finalized when the script detects the beginning of the next trading day.
The previous day's completed data is then added to the historical dataset.
The current day's:
• radar checks
• Daily Bias Score
• strong historical-bias classification
• weekday distributions
• expected range
• expected absolute movement
• historical session averages
are rebuilt from completed historical observations.
The v1.0 daily model does not use a higher-timeframe request.security() feed or future-data lookahead process for these calculations.
Some values are intentionally developing realtime values and can change while today's market develops:
• today's return versus the prior close
• today's high and low
• today's range and range usage
• NOW-card state
• today's high/low session labels
• live day box
• contextual candle coloring
This is normal current-day development and should not be confused with using future historical information.
Prior-day high / low breaks require a confirmed chart bar before they are finalized.
Completed daily-result labels are created only after the corresponding trading day completes.
High / low timing stores the first chart bar that produced the observed extreme, so precision depends on the active timeframe.
Historical calculations can legitimately change when the symbol, timeframe, data feed, available history, Lookback, Volatility Length, Recent Window, Minimum Sample, or Return Units change.
During historical warm-up, the model grows as completed trading days accumulate.
No strong daily classification is permitted until the required warm-up has been satisfied.
These controls reduce hindsight risk in the primary historical model but do not eliminate market uncertainty, regime change, sampling risk, statistical error, or data-feed differences.
━━━━━━━━━━━━━━━━━━━━━━
🛡️ DISCLAIMER
━━━━━━━━━━━━━━━━━━━━━━
Daily Bias Intelligence is provided for educational and informational purposes only.
It does not constitute financial, investment, trading, legal, accounting, or tax advice.
Historical rates, Wilson intervals, statistical classifications, Move Skew, Daily Bias Scores, Strong Bullish / Strong Bearish states, weekday ranges, expected movement, session statistics, prior-day levels, calibration results, visualizations, and alerts are analytical outputs only.
No indicator can guarantee future market direction or profitability.
Historical relationships can weaken, disappear, or reverse as volatility, liquidity, market structure, participation, macroeconomic conditions, market regimes, and data characteristics change.
Every user remains responsible for independent analysis, validation, symbol and timeframe selection, settings, position sizing, account risk, execution planning, broker execution, alert configuration, and applicable legal or tax obligations.
Use Daily Bias Intelligence as a transparent daily statistical-context and historical-review framework — not as a promise of profitability or a substitute for independent judgment.
Wskaźnik

Adaptive Market Commitment & Failure EngineOVERVIEW
Adaptive Market Commitment & Failure Engine is a state-based market analysis framework designed to evaluate whether directional price behavior is developing into persistent commitment or beginning to lose internal efficiency.
Instead of treating individual momentum, volatility, volume, or displacement readings as standalone signals, the engine evaluates how multiple forms of market evidence interact through a structured lifecycle.
The central analytical question is:
Is directional movement being supported by persistent market commitment, or is the move beginning to consume effort without producing proportional structural progress?
CORE METHODOLOGY
The engine organizes market behavior through the following analytical sequence:
Impulse Initiation → Commitment Build → Evidence Agreement → Sustained State → Stress → Release / Failure → Residual Memory
Its assessment is built around four primary evidence dimensions:
Effort
Evaluates normalized range expansion, body participation, directional pressure, wick behavior, and relative participation where volume data is available.
Result
Evaluates displacement efficiency, closing behavior, follow-through, and structural progress produced by the observed effort.
Commitment
Measures persistent agreement between effort and result across multiple analytical horizons. Commitment is treated as a developing market state rather than a single-bar measurement.
Stress
Identifies deterioration inside an existing commitment episode when effort remains meaningful while result, follow-through, or structural progress begins to weaken.
Stress is an OHLCV-derived behavioral classification and should not be interpreted as direct order-flow absorption.
COMMITMENT LIFECYCLE
Directional episodes progress through a confirmed state framework:
DORMANT → EMERGING → CONFIRMED → ESTABLISHED → MATURE → STRESSED → RELEASED / FAILED
Developing evidence and confirmed states are intentionally separated.
State transitions are evaluated on confirmed bars, while separate entry, persistence, and release conditions help reduce rapid state switching around classification boundaries.
Released does not automatically mean reversal.
Failed and Released represent different lifecycle outcomes and should be interpreted within surrounding market structure.
EFFORT–RESULT CONTEXT
The engine also interprets the relationship between observed effort and resulting price progress.
Typical environments can include:
High Effort + Strong Result — committed expansion
High Effort + Weak Result — stress or reduced efficiency
Low Effort + Strong Result — efficient or thin expansion
Low Effort + Weak Result — limited commitment
These classifications describe observed market behavior. They are not trade signals or forecasts.
COMMITMENT CORRIDORS
The primary visual structure is the Commitment Corridor.
Corridors represent spatial areas associated with qualified commitment episodes and can evolve through stages such as:
Created → Developing → Reinforced → Mature → Tested → Weakened → Failed → Decayed
Visual intensity reflects the current relevance of the underlying episode, while older or weakened structures are progressively subdued to maintain chart readability.
STRUCTURAL MEMORY
Qualified commitment episodes can leave residual structural memory after their active lifecycle ends.
When price later interacts with these areas, the engine can evaluate whether the surviving structure remains relevant, becomes reinforced, weakens, or eventually loses significance.
The number of retained structures is intentionally bounded to prevent unlimited historical objects from accumulating on the chart.
DASHBOARD
The dashboard provides a compact summary of the engine's current assessment:
STATE — current lifecycle classification
DIRECTION — directional orientation of the active evidence
COMMITMENT — persistence and agreement of directional evidence
EFFORT — current behavioral effort classification
RESULT — efficiency of resulting price progress
MATURITY — development stage of the current episode
STRESS — internal deterioration assessment
MEMORY — number of retained active structural memories
HOW TO USE
The engine is designed primarily as a contextual analysis tool.
It can be used to study:
Whether a directional move is still developing or has achieved persistent commitment
Whether an established episode is strengthening, maturing, or deteriorating
Whether observed effort is producing proportional price progress
How previously resolved commitment episodes remain relevant when price revisits their locations
The classifications are most useful when interpreted together with broader price structure and the user's own analytical framework.
CONFIRMATION AND LIMITATIONS
Lifecycle transitions are evaluated using confirmed-bar information.
The engine operates from chart-derived price and available volume data. It does not have access to exchange order books, hidden liquidity, institutional positioning, or other information unavailable in the chart data feed.
Volume characteristics can also differ between instruments and data providers.
Commitment, Effort, Result, Stress, Maturity, and Memory are analytical classifications derived from observed market behavior. They are not probabilities, order-flow measurements, guarantees, trading signals, or forecasts of future performance.
No single state should be interpreted as an instruction to enter or exit a position.
ORIGINALITY
Adaptive Market Commitment & Failure Engine is an independently developed state-based framework designed around the lifecycle of directional market commitment.
Its primary purpose is not simply to measure momentum, effort, or price response independently. Instead, it evaluates whether directional evidence develops into a persistent episode, how that episode matures or comes under stress, how it resolves, and what structural context can remain afterward.
The combination of confirmed lifecycle classification, multi-horizon evidence agreement, commitment corridors, episode maturity, stress assessment, and bounded residual structural memory forms the core analytical framework of the indicator.
Release Notes — v1.0
Initial release
Introduces:
Multi-horizon commitment assessment
Effort and result classification
Confirmed commitment lifecycle
Emerging, Confirmed, Established, Mature, Stressed, Released and Failed states
Commitment Corridor visualization
Episode maturity tracking
Internal stress assessment
Residual structural memory
Controlled memory decay and retirement
Compact market-state dashboard
Confirmed-bar lifecycle transitions
Configurable lifecycle and visual controls Wskaźnik

Pivot Consolidation Zone█ OVERVIEW
Pivot Consolidation Zone detects consolidation ranges built between a confirmed pivot high and a confirmed pivot low. A zone is only created once both pivots have been tested and the pair satisfies a set of conditions: time distance, continuity of closes, and an optional height limit relative to ATR.
Once a zone is created, the indicator tracks its development and builds a Volume Profile for the range between the pivot high and pivot low. The profile shows the distribution of volume across price levels, along with an approximate Buy/Sell Volume split.
A close outside the zone ends the zone's activity and can generate a bullish or bearish signal. An optional Volume Confirmation filter requires the breakout direction to agree with the dominant volume side accumulated inside the zone before the breakout candle.
After a breakout, the zone is closed regardless of whether Volume Confirmation is met — the filter only determines whether a confirmed signal (and the zone recolor) is generated, not whether the zone ends. An optional TP/SL module can then plot Entry, Stop Loss, and up to three Take Profit levels, based on ATR or a fixed percentage and a chosen Risk:Reward.
█ CONCEPTS
The indicator combines pivot structure, the consolidation range, tests of the pivot candles, volume distribution, and breakout detection. A pivot on its own does not create a zone — a paired upper and lower pivot, a test on both sides, and price behavior inside the resulting range are all required.
Pivot Structure
A confirmed pivot high and pivot low mark the potential boundaries of a future zone. Pivot Length is the number of candles required on both sides of a local high or low to confirm it.
The zone's upper boundary is the pivot high price, and the lower boundary is the pivot low price. These two levels define the box and should not be confused with a test (see "Pivot Tests" below).
Pivot Pair
A zone is only created from a pair that satisfies all of the following conditions at once:
• the pivot high sits above the pivot low,
• both pivots fall within Max Pivot Pair Distance,
• closes between the start of the pair and the current candle stay inside the resulting range,
• the pair's height passes the optional ATR limit.
Max Pivot Pair Distance limits how far apart in time the pivots forming a single zone can be. This prevents distant price extremes from being automatically merged into one wide range.
Zone Range
Once a valid pair is found, the indicator draws a box:
• Top — the pivot high,
• Bottom — the pivot low,
• Left — extends backward as long as closes stay inside the range, up to a maximum of Max Box Left Edge bars,
• Right — advances with each new candle for as long as the zone remains active.
An optional ATR filter rejects pairs whose height exceeds a specified multiple of ATR.
Pivot Tests
A test does not refer to a touch of the finished zone's boundary. It refers only to the range of the candle that formed a given pivot.
For a pivot high, the indicator stores the range from that candle's high down to its low. For a pivot low, it stores the range from that candle's low up to its high. A test is recorded whenever a later candle overlaps this stored range.
Both pivots must accumulate at least one such test before the pair can form a zone. Optional markers show:
• ▼ — the pivot high candle,
• ▲ — the pivot low candle,
• numbered labels — successive tests of that pivot candle's range.
Numbering runs separately for the upper and lower pivot. These markers document the history that preceded the zone's formation, not subsequent touches of the already-drawn box.
ATR Breakout Margin
Min Breakout Size (x ATR) sets how far a close must move beyond a level to be treated as a breakout:
ATR × Min Breakout Size
A value of 0 disables the filter. The same margin is used to invalidate pivots, to check the continuity of the range, and to detect the zone breakout itself, so minor violations can be treated as noise.
Volume Profile
For an active zone, the range's height is divided into Price Bins. Each candle's volume is distributed across the bins according to how much of its high-low range overlaps each price level, then split into Buy and Sell Volume based on where the candle's close sits within that range:
• a close nearer the high increases the Buy Volume share,
• a close nearer the low increases the Sell Volume share.
The width of the strongest bin corresponds to Max Profile Width, and the remaining bins are scaled proportionally to it. The profile therefore shows both where volume concentrated and its approximate directional split.
By default, only the portion of a candle inside the zone is counted. Include Wick Volume Outside the Zone also adds volume from wicks extending beyond the range, assigning the excess to the nearest edge bin. This setting affects the profile, the Buy/Sell bars, the percentage label, and Volume Confirmation.
Buy/Sell Volume Split
Below the zone, two bars and a label can show the Buy/Sell Volume split for the entire range. The dominant side is:
• Buy — when Buy Volume is greater than or equal to Sell Volume,
• Sell — when Sell Volume is greater than Buy Volume.
Breakout
A zone ends when price closes outside its range:
• Breakout Up — Close > Zone Top + ATR margin,
• Breakout Down — Close < Zone Bottom − ATR margin.
If Volume Confirmation is disabled, the signal direction depends only on the breakout side. If enabled, a bullish breakout requires Buy Volume to be dominant, and a bearish breakout requires Sell Volume to be dominant.
The breakout candle is not added to the profile before this evaluation, so the breakout impulse itself cannot inflate the side that is confirming its own exit from the zone.
After a confirmed breakout, Recolor Zone on Breakout can change the box color to bullish or bearish. If the breakout is not confirmed, the zone stays neutral in color but is still closed.
TP/SL
After a confirmed signal, the TP/SL module plots Entry at the close of the breakout candle, a Stop Loss, and up to three targets. SL can be calculated as ATR × multiplier or as a fixed percentage from Entry. TP levels are derived from the chosen Risk:Reward ratios applied to the Entry-SL distance.
A new signal replaces the previous set of levels. The lines extend with price and stop once the market reaches the SL or the highest enabled TP. This is a level-planning tool, not an assessment of entry quality.
█ FEATURES
• Zone detection from a tested pivot high/pivot low pair, with a time-distance limit, close continuity check, and an optional ATR height limit.
• Volume Profile inside the zone, split into Price Bins with Buy and Sell Volume.
• Optional inclusion of wick volume extending outside the zone.
• Bars and label showing the total Buy/Sell Volume split below the zone.
• Upside and downside breakout signals, with optional Volume Confirmation.
• Zone recoloring on a confirmed breakout.
• Optional markers for pivot candles and numbered tests of their range.
• TP/SL module: Entry, SL, and TP1-TP3 based on ATR or percentage, and Risk:Reward.
• Alerts for upside and downside breakouts.
█ APPLICATIONS
Consolidation Analysis
The indicator locates ranges where price stays between a confirmed and tested pivot high and pivot low, producing a structure anchored to specific swing candles instead of a manually drawn box.
Zone Strength and Volume
The Volume Profile shows which price levels accumulated the most volume. The Buy/Sell split adds context on which side held the advantage across the whole range, not just at the moment of breakout.
Breakout Analysis
A signal marks price leaving the zone on a close outside its range. Volume Confirmation can narrow this down to breakouts that align with the volume split accumulated beforehand.
Example of Use
An active zone is better treated as an area of equilibrium than as a ready-made entry. Before acting on a signal, it helps to weigh:
• the breakout side,
• the dominant Buy/Sell Volume,
• the shape of the Volume Profile,
• the zone's position within the broader structure,
• momentum and context from a higher timeframe.
The zone being drawn, or a triangle appearing, is not on its own a sufficient reason to trade.
█ NOTES
• A test refers to the range of the pivot candle, not to a touch of the already-formed zone boundary.
• Volume Confirmation is optional. Without it, the signal depends only on the breakout direction.
• The breakout candle is excluded from the Volume Profile until after Volume Confirmation is evaluated.
• Buy and Sell Volume are derived from where the close sits within each candle's range. This is an estimate, not actual tape/order-flow buy/sell data.
• Show Breakout Signals is a shared switch: disabling it also disables the TP/SL module and the alerts, not just the on-chart triangles.
• TP/SL is a visual level-planning tool and does not assess the quality of a signal.
• This indicator does not replace independent market analysis or risk management. Wskaźnik

ICT & FVG [UgurTash]ICT & FVG
The level that stopped you was never on your chart
You are on the 15m. The setup is clean, the structure agrees, you take it, and price stalls twelve ticks later at nothing. There is no level there. Not on the 15m.
Open the daily and there it is: a gap left three weeks ago, or the block that started the leg you are currently trading against. It was always there. You just could not see it from where you were standing.
That is the problem this script is built around. Everything else it does is support.
What it actually draws
Five higher timeframes at once, projected onto whatever chart you are on. Monthly, weekly, daily, 4H and 1H by default, each with its own colour and its own switch. Every zone is tagged with the timeframe that produced it, so a box reading OB+ is unambiguous: that is a daily bullish order block, seen from the 15m, drawn at its real daily price and its real daily origin bar.
Two kinds of zone come from each timeframe:
Fair Value Gaps. A three candle gap in that timeframe's own bars. A daily FVG is built from daily candles, not from an average of 15m ones.
Order Blocks. The candle a move actually came from, found by structure rather than by colour. More on the method below, because the method is the part that matters.
And because a higher timeframe zone is only interesting while it is still unfilled, each one carries a state you can see at a glance: untouched, tested, or filled.
How an Order Block is found
Most order block scripts take the last opposite coloured candle before a strong move. That sounds right and often is not. In a real displacement leg there is usually a small pause bar somewhere in the middle, and the nearest opposite candle rule will happily mark that pause bar instead of the place the move came from.
This one works differently, in two steps.
Step one, structure. A swing high or low is confirmed only after a set number of bars have failed to exceed it. Nothing happens until price closes beyond that confirmed swing. No break of structure, no block.
Step two, the origin. When the break happens, the leg between the swing point and the breakout bar is scanned, and the block is anchored to the extreme candle of that leg: the lowest low for a bullish block, the highest high for a bearish one. That is the candle the move actually left from, whatever colour it happened to close.
Each swing point can only produce one block. Once it has been broken it is spent, so the same level does not keep re-arming as price chops around it.
The same function runs on the chart timeframe and inside each of the five higher timeframes, so a 1H block and a 1D block are built by an identical definition. They are comparable because they are the same measurement at different scales.
Optional on top of that: Use Candle Body to measure the block from the body instead of the full range, and Break Confirmation, which demands the breakout close clear the swing by a fraction of the swing range before anything is created. Both are off by default.
Higher timeframe blocks do not repaint
This is worth its own paragraph because it is the easiest thing in a multi timeframe script to get quietly wrong.
Confirm MTF Order Blocks On HTF Close is on by default. A higher timeframe block is only published once its own bar has closed. A daily block appears at the daily close and then never moves, never shifts edge, never vanishes on a later reload.
Turn it off and blocks appear as soon as the condition is met inside the forming higher timeframe bar. Earlier, and able to change its mind. The switch is there because some people want that trade off. The default is the honest one.
Breaker Blocks
A block that price closes through does not have to die.
Turn on Show Breaker Blocks and it flips polarity instead. A bullish block that fails becomes resistance, keeps its box, and is relabelled BB- . It stays until price closes back through its far edge, at which point it is genuinely spent and removed.
This is the same idea the script already applies to gaps through Inverse FVG, now applied to blocks, on the chart timeframe and on every higher timeframe alike. Off by default.
Zone states, and what happens when a zone is used up
Three states, and all three are configurable.
Untouched . Full colour. Nobody has been there yet.
Tested . Price has wicked into the zone without closing through it. The fill fades by an amount you set and the border changes to dashed, dotted, solid or nothing. Turn the whole thing off if you would rather not see it.
Filled . Price closed through. This is where the script stops deciding for you: pick Gray Out to keep it greyed and frozen as a record, Delete to clear it off the chart entirely, or Keep to leave it in its original colour. Fair Value Gaps and Order Blocks get that choice separately, because most people want different behaviour from each.
If you trade a clean chart, set filled gaps to Delete and filled blocks to Gray Out. The chart cleans itself and you still keep the history where it matters.
The chart timeframe layer
The higher timeframe module sits on top of a full imbalance engine running on your own chart, and the two are controlled independently. Switching the MTF panel off does not touch your local zones, and vice versa.
Fair Value Gaps with three mitigation definitions (Engulf, Mitigate, Rebalance), a consequent encroachment line, and Liquidity Void mode which merges consecutive gaps into one region.
Inverse FVG . A filled gap flips and starts working from the other side.
Implied FVG . The wick based variant, for the gaps that do not show up as a clean three candle structure.
Volume Imbalance in classic and advanced form, the body to body gaps between consecutive candles.
True GAP and GAP plus inefficiency, for instruments that actually gap.
Order Blocks and Breaker Blocks , by the method described above.
Each family has its own box limit and its own mitigation rule. Nothing is forced on you.
About the way the boxes look
The fills use a rule worth explaining, because it is the reason the chart stays readable with eight families of zone drawn at once.
The colour picker shows what you chose. What gets drawn is a fixed fraction of that opacity, so the default 50 in the settings lands on screen at a density that layers cleanly instead of burying the candles. Move the slider and the chart moves with it. You get an honest number in the settings and a usable chart at the same time, which the usual approaches give you one of but not both.
Borders are off by default, because a fill and a frame competing for the same edge is noise. Set Box Border Width to 1 if you disagree. Tested and filled zones can still draw their own border regardless.
Where to start
Turn off what you are not using. Seriously. With five higher timeframes and eight local zone families all enabled at once the chart is unreadable, and that is a setting problem, not a script problem.
A reasonable starting point for an intraday chart: monthly and weekly off, daily and 4H on, FVG and Order Blocks on, everything else off. Add one thing at a time from there.
Then set the Swing Lookback for each layer. It is the single control that decides how many blocks you get. Low means many, early and noisy. High means few, late and significant. The MTF layer has its own value because higher timeframe bars are scarce and usually want a smaller number than your chart does.
Limitations, honestly
Chart timeframe order blocks move on the live bar. A block is created the moment price closes beyond a swing, and on the forming bar that close is still changing. It can appear and disappear until the bar closes. Higher timeframe blocks do not have this problem when Confirm On HTF Close is on, which is why it is on.
The block scan is bounded. Max Scan Bars defaults to 50. In an unusually long leg the block anchors to the extreme within the last 50 bars rather than the true origin of the move. Raise it if your instrument runs long legs, but it is a real ceiling and you should know it is there.
Zone state is judged on the chart timeframe's closes. A daily zone is marked filled when the chart you are looking at closes through it, not when the daily candle does. On a 5m chart that is a faster verdict than a daily trader would give.
Five higher timeframes means ten data requests. On a slow connection or a thin symbol the script takes a moment to draw. Disable the slots you are not using.
None of this is a signal. There is no entry, no stop, no target, no win rate, nothing backtested and nothing claimed. It draws where price left work undone. What you do about that is the actual trade, and it is yours.
Feedback welcome, particularly the kind that finds something broken.
Nothing here is financial advice.
Wskaźnik

Trinity Reversal Pattern [AlgoAlpha]🟠 OVERVIEW
Trinity Reversal Pattern identifies three-candle reversal structures and marks the price extreme associated with each detected setup. It is designed to separate structured reversal patterns from isolated bullish or bearish candles.
Each valid pattern receives a strength score based on the signal candle's body relative to the largest candle body within a selected lookback. The resulting reversal level remains active until price returns to it or the level reaches its selected expiry. An optional EMA trend filter can restrict patterns to the current trend direction.
🟠 CONCEPTS
Bullish Trinity Reversal — A three-candle structure that begins with two bearish candles. The middle candle trades below the first candle's low while remaining below its high. The third candle closes bullish and extends above the first candle's high. The lowest price across the three candles becomes the bullish reversal level.
Bearish Trinity Reversal — The inverse structure. It begins with two bullish candles, with the middle candle trading above the first candle's high while remaining above its low. The third candle closes bearish and extends below the first candle's low. The highest price across the three candles becomes the bearish reversal level.
Signal Strength — The absolute body size of the signal candle divided by the largest candle body found within the selected Strength Lookback, expressed as a percentage. A value near 100% means the signal candle is close to the largest recent body. This measures relative candle-body strength, not reversal probability or historical win rate.
Reversal Level — The lowest point of a bullish three-candle pattern or the highest point of a bearish pattern. It marks the price extreme associated with the reversal structure and stays active until touched or expired.
EMA Trend Filter — An optional directional filter based on fast and slow EMAs. A fast EMA cross above the slow EMA establishes the bullish state, while a cross below establishes the bearish state. When enabled, bullish patterns are accepted only during the bullish state and bearish patterns only during the bearish state.
🟠 FEATURES
Trinity Reversal Signals — Bullish and bearish markers identify completed three-candle reversal structures directly on the chart.
Reversal Levels — Each detected setup creates a level at its three-candle price extreme. Active levels extend forward and become dotted after they are touched or expire.
Strength Labels — Active reversal levels can display their fixed signal strength percentage for quick comparison between setups.
EMA Trend Gradient — Optional fast and slow EMA lines display the active trend state with a gradient between them.
🟠 HOW TO USE
Watch for a bullish marker after a three-candle downside structure or a bearish marker after the corresponding upside structure.
Compare the strength labels between signals. Higher values mean the signal candle has a larger body relative to the recent candle bodies in the selected lookback.
Increase Minimum Signal Strength to remove patterns with weaker signal candles. Lower it to include a broader range of detected structures.
Treat an active reversal level as the price extreme linked to its original setup. A later wick reaching that price counts as a touch and stops the level from remaining active.
Adjust Level Expiry Bars to control how long untouched reversal levels remain active. Shorter values focus on recent setups, while longer values preserve levels for more bars.
Enable the EMA Trend Filter when you want signals aligned with the current EMA state. In a bullish EMA state, only bullish Trinity patterns are accepted. In a bearish EMA state, only bearish patterns are accepted.
Enable Confirm Signals on Close when you want a pattern to be confirmed only after its signal candle closes. Disabling it allows the current candle to produce a signal before the bar is complete, so the signal can change while the candle develops.
Use alerts to track bullish or bearish Trinity signals, touches of active reversal levels, level expirations, and EMA trend crosses without continuously watching the chart.
🟠 CONCLUSION
Trinity Reversal Pattern combines three-candle reversal structures, relative candle-body strength, persistent reversal levels, and an optional EMA trend filter. It gives traders a structured way to identify reversal setups, compare their relative strength, and track whether their associated price extremes remain active or are revisited.
Wskaźnik

Adaptive Opening Range Context EngineOVERVIEW
Adaptive Opening Range Context Engine is a session-based market structure tool designed to analyze how price behaves around a defined opening range.
Instead of treating every move beyond an opening range as an immediate breakout signal, the engine follows the development of the range through a structured lifecycle. It evaluates range size relative to volatility, participation conditions, price acceptance or rejection outside the range, retests, expansion behavior, and the distribution of activity formed during the opening-range period.
The objective is to provide contextual information about the opening auction rather than predict future price direction.
CORE METHODOLOGY
The engine follows the following analytical sequence:
Opening Range Formation → Range Lock → Range Quality → Break Attempt → Acceptance / Rejection → Retest → Expansion / Failure
The default opening range is calculated from the 09:30–10:00 America/New_York session and can be adjusted from the settings.
The range can be constructed using either High/Low or Close-based boundaries.
RANGE QUALITY
Once the opening range is complete, its width is normalized against ATR.
This produces a relative Range/ATR measurement used to classify the opening environment as:
Compressed
Balanced
Expanded
This normalization helps distinguish a relatively narrow opening range from one that already represents substantial movement relative to recent volatility.
These classifications describe the observed range environment and are not probability estimates.
BREAKOUT LIFECYCLE
Price moving beyond an opening-range boundary does not automatically qualify as sustained acceptance.
The engine distinguishes between:
Upper Break Attempt
Lower Break Attempt
Upper Acceptance
Lower Acceptance
Upper Rejection / Failure
Lower Rejection / Failure
Retest
Expansion
Acceptance requires confirmed price behavior outside the relevant boundary rather than relying solely on an intrabar excursion.
This lifecycle approach is intended to separate a simple boundary test from a more developed structural response.
PARTICIPATION CONTEXT
The engine compares current volume with a rolling volume baseline and classifies participation as:
Light
Normal
Elevated
Volume is used as contextual information rather than as a standalone directional signal.
For instruments where the available volume represents tick volume or another feed-specific measure, the interpretation should be adjusted accordingly.
OPENING RANGE PARTICIPATION PROFILE
The script includes a native Opening Range Participation Profile.
During formation of the opening range, volume from each range bar is assigned to configurable price buckets using that bar's representative price. The resulting distribution is displayed horizontally inside the opening-range structure.
The largest concentration is identified as the OR POC.
This profile is intentionally described as a participation proxy. It is not an exchange order-book reconstruction and should not be interpreted as true transaction-level volume-at-price when the underlying chart data does not provide that information.
Its purpose is to visualize where activity was relatively concentrated during formation of the opening range.
VISUAL SYSTEM
The chart displays:
Opening Range High
Opening Range Low
Opening Range Equilibrium
Opening Range Participation Profile
OR POC
Upper and lower expansion references
Acceptance and rejection lifecycle events
Current opening-range context
Historical opening ranges with reduced visual emphasis
The current session remains visually dominant while completed sessions provide background structural context.
DASHBOARD
The dashboard summarizes the active opening-range environment through:
STATE — current lifecycle state
RANGE — volatility-normalized range classification
RANGE / ATR — opening-range width relative to ATR
VOLUME — current participation classification
MIDPOINT — opening-range equilibrium
CONTEXT — current upper, lower, or neutral structural context
PROFILE — participation-profile status
HOW TO USE
The indicator is designed primarily for intraday analysis.
First allow the configured opening range to form and lock. After the range is established, observe how price interacts with its boundaries.
A move outside the range can then be evaluated together with the engine's acceptance/rejection state, Range/ATR environment, participation context, OR POC, equilibrium, and subsequent retest behavior.
The tool is intended to provide structured context for discretionary analysis. No individual state, level, profile concentration, or lifecycle event should be interpreted independently as a trade instruction.
CONFIRMATION AND LIMITATIONS
The indicator operates from chart data and does not have access to hidden institutional orders or a complete market-wide order book.
Opening-range behavior can vary substantially between instruments and trading sessions.
Volume quality also depends on the underlying data source.
The Participation Profile is an internally constructed proxy based on the bars available during the opening range. It should not be interpreted as tick-by-tick exchange volume-at-price unless the underlying data itself provides that level of information.
ATR normalization describes the relative size of the opening range; it does not forecast the probability or magnitude of a future move.
Acceptance, rejection, retest, and expansion classifications describe observed price behavior and do not guarantee continuation or reversal.
The configured opening session and timezone should be adjusted when analyzing instruments whose primary trading session differs from the default configuration.
ORIGINALITY
Adaptive Opening Range Context Engine was independently developed around a state-based opening-range framework.
Its primary distinction is the integration of volatility-normalized range classification, participation context, confirmed breakout acceptance/rejection, retest and expansion lifecycle tracking, and an internally constructed Opening Range Participation Profile within one coordinated analytical workflow.
These components are designed to interact as parts of the same opening-range state model rather than operate as unrelated indicator modules.
The script is intended for educational and analytical use and does not attempt to reproduce the proprietary methodology of another indicator.
Release Notes — v1.1
Version 1.1
Introduced the native Opening Range Participation Profile and OR POC visualization.
Expanded the visual framework with clearer Opening Range High, Low and Equilibrium references, contextual expansion zones, current-session emphasis and subdued historical opening ranges.
Refined the dashboard to include participation-profile status while preserving the existing opening-range lifecycle, ATR-normalized range classification, volume context and acceptance/rejection framework.
Improved chart presentation and session-object lifecycle management for cleaner intraday analysis. Wskaźnik

Wskaźnik

Real Fair Value Gaps [GBB]Real Fair Value Gaps
A fair value gap is a three-candle imbalance: the wicks of candle 1 and candle 3 do not overlap, leaving a price range that was never traded. This script finds those gaps on the chart timeframe and on one higher timeframe, tracks each one through its full life (fresh, touched, midpoint tapped, mitigated or inverted), and draws only the ones that matter right now.
What it does differently than other Fair Value Gap indicators
Consumed vs. remaining : As price trades into a gap, the drawn zone shrinks to the unfilled remainder. The consumed part is shown as a dashed fill from the entered edge to the deepest penetration, so you see how much of the gap is actually left, not a full box that price already went through.
Spotlight : Only the N active gaps closest to price carry the full glow (gradient bands, dotted midpoint, origin notch, price chip). Everything else is a thin outline. The chart stays readable with dozens of live gaps.
Freshness : Glow decays to half strength over a set number of bars and then holds. A gap from 300 bars ago looks different from one made ten bars ago.
Inversions : A close beyond the far edge flips the gap into an inverted FVG (IFVG) with the opposite bias instead of retiring it. This is an optional setting
Visibility window : Gaps farther than X ATR from price are tracked but not drawn, so far-away zones do not stretch your price scale.
Higher timeframe without repainting : HTF gaps are built only from completed HTF candles (values are read with a offset) and are anchored to the exact HTF candle times. Auto mode picks one step above your chart (1m→15m, 5m→1H, 15m→4H, 1H→D, 4H→W, D→W).
Everything on confirmed bars. Detection, state changes and alerts all fire on bar close.
Inputs
Detection
Min size (ATR ×) : ignore gaps smaller than a multiple of ATR(14) on the gap's own timeframe. 0 = off.
Auto threshold : keep a gap only if its height relative to price is above the running mean of all candidates seen so far. Overrides Min size.
Require displacement : candle 2 must close beyond candle 1's extreme.
Mitigation
Source : Wick or Close.
Point : Near edge, Midpoint or Far edge (fully filled).
Track inversions : on/off.
Higher timeframe
Enable, and the timeframe (empty = automatic).
Look
Palette : (GBB / Calm blue-amber / Custom), glow intensity, spotlight count, fade length, how long mitigated outlines stay, label mode, and the ATR visibility window.
Display
Info table : active gap counts, nearest gap above and below price, HTF status, and a running fill rate over the loaded bars.
Alerts
New bullish / bearish FVG (chart TF), new HTF bullish / bearish FVG, price entered a gap, midpoint tapped, gap mitigated, gap inverted. All on confirmed bars.
Data window
Active bull count, active bear count, mitigated count, HTF active count, and a last-event code (1 new bull, 2 new bear, 3 touch, 4 midpoint, 5 mitigated, 6 inverted) are exposed as hidden plots for use in your own scripts.
How to read it
The dotted midpoint line is the consequent encroachment level; it disappears once price has consumed it. The small solid notch marks the birth candle. The chip on the right edge shows the midpoint price and tags the gap as HTF or IFVG. A mitigated gap collapses to a grey dashed outline frozen at the bar where it was filled, then drops off after the configured number of bars. Wskaźnik

Gamma Dealer (GEX) FlowGamma Dealer (GEX) Flow
A clean, high-signal way to map options-derived dealer-positioning levels directly onto your chart. This is a visualization tool — it draws levels you provide. It does not calculate levels from live options data and does not connect to any external feed. You supply the data; the script renders it clearly, with a strength-weighted visual hierarchy so the levels that matter stand out at a glance.
Why dealer-positioning levels matter
Options dealers carry enormous exposure across every session. To stay delta-neutral, they hedge by buying or selling the underlying as price moves. Widely followed theory suggests that at strikes where large open interest concentrates, this hedging activity may be significant enough to leave a footprint on intraday price action. Institutional desks often watch these zones as potential structural reference points — areas where price may stall, reverse, or accelerate.
This indicator gives you a disciplined, repeatable way to keep those reference points in front of you, without cluttering the chart.
What it draws
Put Walls — Below-market zones where theoretical dealer buying may provide structural support. If a major put wall breaks, downside moves can accelerate as that support gives way.
Call Walls — Overhead zones where theoretical dealer selling may be heaviest. Call walls may act as resistance and cap upward moves into that strike.
Flip Zones — The regime boundary many traders treat as a filter. Above it, dealer hedging may behave in a more mean-reverting fashion; below it, hedging may amplify moves. Drawn as a distinct dashed line so it never gets confused with a wall.
Magnets — Reference points price may gravitate toward, such as high-concentration strikes or settlement-gravity zones. Drawn dotted so they read as "pull toward," not "barrier."
Each level is theory-driven and provided as external context — the script's job is simply to render your levels faithfully and legibly.
Strength-weighted hierarchy
Not every level carries the same weight, so the indicator doesn't draw them all the same. Each level accepts an optional strength tier — MASSIVE, HEAVY, MOD, LIGHT — and line thickness scales accordingly. The dominant level on the chart is immediately obvious; minor levels stay visible but recede. You read the structure of the session at a glance, without parsing a single number.
Features
Simple paste-in format. Provide your levels as a single compact string (TYPE:PRICE:STRENGTH, comma-separated). The script parses and draws them automatically.
Smart stacked labels. When two level types land at (or near) the same price, their labels stack cleanly instead of overprinting — so a shared put-wall/magnet strike stays readable.
Sortable info table. A compact on-chart table lists every active level and lets you sort by price (high→low or low→high), by type, or by strength, with a visual strength bar for quick scanning. Four corner positions and three sizes.
Deduplicated lines. Multiple labels at one price still draw a single clean line, keeping the chart uncluttered.
Ten manual custom levels. Independent of the paste input, add up to ten of your own lines — full control of price, label, color, line style (solid/dashed/dotted), width, and label distance. Useful for your own S/R, VWAP anchors, prior-day levels, or anything else you track.
Extend toggle, label distance controls, timezone-agnostic rendering. Fine-tune how far lines run and where labels sit so the layout fits your workflow.
How to use it
The indicator ships pre-loaded with a set of illustrative sample levels, so it draws immediately when you add it — you can see the format and the visual language at work right away. To use your own:
Open the settings and replace the contents of Paste Levels with your formatted level string.
The script draws each level with color and thickness matched to its type and strength.
Use the info table to keep an ordered read of where price sits relative to the nearest walls, flip, and magnets.
Optionally enable any of the ten custom levels for your own reference lines.
The color language is intentional and consistent: green = put walls (support), red = call walls (resistance), yellow = flip zone (regime), purple = magnets (gravity) — so structure is legible the instant it loads.
Open source
The full source is published openly, in TradingView spirit — read it, review it, fork it, learn from it. The parsing and rendering layer is completely transparent: you can see exactly how every level is drawn and styled. This is a display and organization tool for level data you already have; how you generate that data is entirely up to you.
Disclaimer: This indicator is a visualization tool for educational and organizational purposes only. It does not calculate options data, does not provide signals, and is not financial advice. Dealer-hedging behavior is theoretical and markets may not respond to any given level. Always do your own research and manage risk accordingly. Wskaźnik

Wick HunterWick Hunter is an open-source price-action indicator designed to identify contextually significant rejection wicks while filtering out many of the smaller or lower-quality wicks that occur during normal market noise.
The purpose of the script is not simply to mark candles with long wicks. Wick size by itself can be misleading, especially during consolidation or strong directional moves. Wick Hunter evaluates the wick together with its size, candle structure, recent volatility, prevailing trend, and surrounding liquidity context before displaying a signal.
The indicator uses three related types of wick behavior:
TREND-CONTINUATION REJECTION
In a strong directional move, Wick Hunter looks for meaningful pullback wicks that reject back in the direction of the prevailing trend. This helps prevent the script from treating every countertrend wick as a reversal.
LIQUIDITY SWEEP/RECLAIM
The script can identify wicks that trade beyond a confirmed swing level and then reclaim that level. These signals represent rejection after liquidity has been taken rather than an isolated candle pattern.
EXTREME WICK EVENTS
Exceptionally large wicks relative to ATR and recent wick behavior can qualify as significant even when they do not fit a normal continuation setup. This is intended to capture unusually aggressive rejection or displacement. The script does not detect scheduled news events; it detects the resulting price behavior.
All three setup types serve the same purpose: determining whether a wick is significant enough to deserve attention. They are not separate indicators combined for additional features.
Wick Hunter also calculates an internal Wick Quality Score . The score considers actual wick size relative to ATR, wick size relative to recent wicks, how much of the candle is occupied by the wick, the quality of the rejection close, the candle’s size relative to recent price action, and the size of the opposing wick. Signals must meet the required quality threshold before appearing.
A moderate consolidation filter is also included. When price is trading inside a compressed range, Wick Hunter suppresses many middle-of-range wick signals while still allowing meaningful rejection near the edges of the range, confirmed liquidity sweeps, and unusually extreme wicks. This filter exists specifically to reduce low-value signals during sideways price action.
SIGNAL INTERPRETATION
A green upward marker indicates a significant lower-wick rejection.
A red downward marker indicates a significant upper-wick rejection.
The accompanying “Significant Wick” label identifies the qualifying candle. Nearby text labels may be suppressed to prevent visual overlap, but valid signal arrows remain visible.
Wick Hunter can display signals on all chart timeframes, but 15-minute and higher timeframes are recommended . The filtering logic was developed with intraday and higher-timeframe price action in mind, and lower timeframes may contain more noise and more frequent short-lived wick behavior. Users can adjust the thresholds to suit different markets and timeframes.
On live candles, Wick Hunter evaluates conditions as price develops and locks a signal once its criteria are satisfied. Historical candles are evaluated using their completed OHLC data, which can result in differences between intrabar behavior and a fully reloaded historical chart.
Wick Hunter includes alert conditions for bullish and bearish Significant Wick signals.
This indicator is intended as a price-action analysis tool and should not be treated as a complete trading system by itself. Market context, execution, risk management, and independent analysis remain important.
SOURCE VISIBILITY
Open-source. The Pine Script code is publicly available so users can inspect how the indicator works. Wskaźnik

STP Flip "Anti-Whipsaw" Modified "Always-In" Overnight Strategy Synapse Trail Pro "Anti-Whipsaw" (Optimized for MNQ overnight on 9 min Candles)
### Overnight MNQ Always-In Flip Strategy | Optimized for 9-Minute Candles
**Synapse Trail Pro PRO** is a modified, session-aware, always-in-the-market trend-flipping strategy designed specifically for **Micro E-mini Nasdaq (MNQ) futures during the overnight trading session**, beginning around **18:00**, and optimized for the **9-minute chart**.
Rather than functioning as a conventional strategy that waits for a setup, enters a trade, takes a fixed profit, and returns to flat, this system is built around a modified **always-in directional framework**. It maintains either a long or short bias and automatically reverses direction when its underlying trend signal changes. When the market shifts from bullish to bearish, the strategy flips short; when it shifts back bullish, it flips long.
The objective is straightforward:
> **Remain engaged with the overnight market so that if MNQ makes a meaningful directional move at any point during the night, the strategy has the opportunity to capture that move and reach its nightly profit target.**
It is not designed around trying to predict the exact time of the overnight breakout, trend, or reversal. Instead, it is designed to continuously adapt to the market's direction and allow the eventual meaningful move to pay for the smaller fluctuations and reversals that may occur beforehand.
---
## Designed Specifically for Overnight MNQ
This version is optimized around the characteristics of the **overnight MNQ session**, rather than the regular cash-session environment.
The intended operating window begins around **18:00 Eastern**, allowing the strategy to participate throughout the overnight period rather than limiting itself to a narrow entry window. The 9-minute chart is used to help filter some of the excessive noise found on lower timeframes while still allowing the system to respond when a meaningful overnight trend develops.
Overnight markets can spend extended periods moving sideways, rotating, or producing several false directional changes before eventually making a substantial move. This strategy is designed to tolerate that process while remaining positioned to participate when the market finally establishes a sustained direction.
The core philosophy is:
**The market does not have to trend immediately. It only needs to produce a meaningful move sometime during the trading night.**
---
## Modified Always-In Flip Architecture
At its core, Synapse Trail Pro PRO is a **continuous directional repositioning system**.
Instead of repeatedly going:
**Flat → Long → Flat → Short → Flat**
the strategy operates more like:
**Long → Short → Long → Short → Long**
with the system remaining engaged until a defined session condition or profit objective ends the trading cycle.
The primary exit mechanism is therefore not a traditional stop-loss exit. Instead, trades are generally closed or reversed because the underlying signal changes direction. This allows the strategy to remain involved in the market rather than sitting flat after every individual trade.
The system is intended to capture the larger directional movement that may emerge after a series of smaller flips, rather than requiring every individual entry to be immediately profitable.
---
## The Overnight Profit Objective
The strategy is designed around a **nightly profit target rather than an unlimited daily trading objective**.
The intended target is approximately:
**+$250 to +$350 per overnight session**
when trading a base position of **1 MNQ**, depending on the configuration and market conditions.
Once the strategy reaches its nightly profit target, it stops trading for that session. This creates a defined objective and prevents the system from continuing to expose already-earned profits to unnecessary additional overnight fluctuations.
The profit target is not intended to be reached through one specific entry at one specific time. Instead, it is designed to be reached through the cumulative effect of the strategy remaining engaged, flipping with the market, and capturing the meaningful directional movement that develops during the night.
---
## Progressive Contract Scaling
This version also incorporates configurable progressive position sizing.
The strategy can increase exposure as the sequence develops, for example:
**1 → 2 → 3 → 4 MNQ**
depending on the selected maximum-contract setting.
This is intended to help the strategy recover from smaller unfavorable sequences and increase its ability to reach the nightly profit target when a sustained directional move develops.
The maximum contract setting is configurable, allowing the trader to determine the desired balance between:
* Profit-target hit rate
* Overnight drawdown
* Exposure during adverse sequences
* Recovery potential
* Overall account risk
For example, in testing, a configuration using a **maximum of 2 MNQ contracts** with a **+$250 profit target** has historically produced a profit-target hit rate of approximately **83% of overnight sessions** in the tested dataset.
That figure should be treated as a backtested observation rather than a guarantee of future performance.
---
## Why the Always-In Concept Matters Overnight
The overnight session is particularly suited to this type of architecture because meaningful moves can occur at unpredictable times.
A market may:
* Move sideways for several hours
* Produce multiple small reversals
* Develop a trend at 21:00
* Reverse again at midnight
* Break into a substantial move at 02:00
* Continue trending toward the morning session
A strategy that only takes one or two carefully timed entries may completely miss the night's most important move.
Synapse Trail Pro PRO is designed differently. It attempts to remain involved throughout the session so that **the timing of the meaningful move matters less than simply being present when it occurs**.
The system does not need to know whether the profitable move will happen at 19:00, 23:30, 02:15, or 04:30. Its purpose is to continue adapting until the market provides the directional opportunity necessary to reach the session objective.
---
## What Makes This Different from the Original Synapse Trail Pro
This version is based on **WillyAlgoTrader's Synapse Trail Pro**, which provides the underlying signal and trend-flipping foundation.
However, this is a significantly modified version of the original concept.
The modifications include:
* Removal of the original **TP1, TP2, and TP3 profit-taking structure**
* Removal of the original traditional stop-loss architecture
* Greater emphasis on **always-in directional flipping**
* Overnight session optimization
* 9-minute MNQ chart optimization
* Configurable progressive contract scaling
* A defined nightly profit target
* Session-based trading controls
* A focus on allowing meaningful overnight moves to complete the profit objective
The intention is to move away from a conventional multi-target trailing strategy and toward a more specialized **overnight directional capture system**.
---
## The Core Trading Philosophy
Synapse Trail Pro PRO is built around a simple premise:
> **You do not need to predict the overnight move if your strategy is designed to remain engaged long enough to capture it.**
The system is not trying to win every flip.
It is not trying to make every individual trade profitable.
It is not trying to identify the exact high or low of the night.
Instead, it is designed to:
1. Begin trading around 18:00.
2. Maintain a directional position.
3. Flip when the underlying trend changes.
4. Progressively scale contracts within configured limits.
5. Remain engaged through overnight fluctuations.
6. Capture a meaningful directional move whenever one develops.
7. Reach the nightly profit target.
8. Stop trading once the target is achieved.
The desired result is a strategy that may experience several smaller unfavorable reversals but is positioned to capitalize when MNQ finally makes the substantial move that defines the night's trading opportunity.
---
## Summary
**Synapse Trail Pro PRO** is a modified **always-in, trend-flipping overnight strategy for MNQ**, optimized for the **9-minute chart** and designed to operate beginning around **18:00**.
Its primary purpose is not to predict the market's next move, but to remain continuously adaptable so that **whenever a meaningful directional move occurs during the night, the strategy has the opportunity to capture it and reach its predefined profit target**.
With configurable progressive contract scaling, a nightly target in the approximate **$250–$350 range**, and a focus on capturing the overnight session's eventual directional movement, the system is designed as a specialized approach to extracting a defined profit objective from the often unpredictable overnight MNQ environment.
**Based on WillyAlgoTrader's Synapse Trail Pro, modified and optimized for overnight MNQ trading by removing the original multi-target and stop-loss architecture and emphasizing continuous directional flipping and configurable position scaling.**
Strategia
