PROTECTED SOURCE SCRIPT
Güncellendi Mirror US10Y

This TradingView script is designed to automatically detect the asset you are viewing (stock, commodity, or crypto) and, if it matches a long list of supported tickers, overlays a "mirror" subchart. This subchart plots the price action of a related pair—typically the asset divided by the US 10-Year Treasury yield (US10Y), or another relevant macro or sector index. The script also detects and visualizes "Imbalance Fair Value Gaps" (IFVGs) on the subchart, and can trigger alerts when these gaps are filled.
1. Automatic Subchart Detection
The script first checks which symbol you are viewing.
If it matches a list of supported stocks or commodities (e.g., NVDA, TSLA, GOLD), it sets a corresponding subchart pair (e.g., NVDA/US20Y, GOLD/US10Y).
If it’s a crypto asset, it checks both the exchange and the symbol, and sets a subchart like BINANCE:ADAUSDT/US10Y.
If a match is found, it enables plotting for the subchart.
2. Subchart Data Fetching
Once a subchart is selected, the script fetches its OHLCV data (open, high, low, close) and a 200-period ATR (Average True Range) using request.security.
It then plots the subchart’s candlesticks in white (bullish) or red (bearish).
3. IFVG (Imbalance Fair Value Gap) Detection
The script defines custom types and arrays to track bullish and bearish IFVGs and their "invalidation" (when the gap is filled).
It detects IFVGs by looking for price gaps between the current and previous candles, filtered by ATR to avoid noise.
When a gap is detected, it is stored in an array with its coordinates and direction.
4. IFVG Management and Visualization
The script manages the lifecycle of each IFVG: it tracks when a gap is filled (invalidated) and moves it to a separate array.
It draws colored boxes and dashed lines on the chart to visualize the last few IFVGs, using green for bullish and red for bearish.
When a gap is filled, it places a label (▲ or ▼) at the fill point.
5. Alerts
The script sets up two alert conditions: one for a bullish IFVG fill, and one for a bearish IFVG fill.
These can be used to trigger TradingView alerts for trading signals.
6. Debugging and Info Labels
The script displays labels on the chart showing the detected ticker and the subpair being plotted, for clarity.
This indicator is even more reliable when combined with the Mirror 2 indicator, which shows the same system but mostly with the BTC pair in crypto.
Both the Mirror US10Y and Mirror 2 also allow you to see the main inverse pairs in stocks.
1. Automatic Subchart Detection
The script first checks which symbol you are viewing.
If it matches a list of supported stocks or commodities (e.g., NVDA, TSLA, GOLD), it sets a corresponding subchart pair (e.g., NVDA/US20Y, GOLD/US10Y).
If it’s a crypto asset, it checks both the exchange and the symbol, and sets a subchart like BINANCE:ADAUSDT/US10Y.
If a match is found, it enables plotting for the subchart.
2. Subchart Data Fetching
Once a subchart is selected, the script fetches its OHLCV data (open, high, low, close) and a 200-period ATR (Average True Range) using request.security.
It then plots the subchart’s candlesticks in white (bullish) or red (bearish).
3. IFVG (Imbalance Fair Value Gap) Detection
The script defines custom types and arrays to track bullish and bearish IFVGs and their "invalidation" (when the gap is filled).
It detects IFVGs by looking for price gaps between the current and previous candles, filtered by ATR to avoid noise.
When a gap is detected, it is stored in an array with its coordinates and direction.
4. IFVG Management and Visualization
The script manages the lifecycle of each IFVG: it tracks when a gap is filled (invalidated) and moves it to a separate array.
It draws colored boxes and dashed lines on the chart to visualize the last few IFVGs, using green for bullish and red for bearish.
When a gap is filled, it places a label (▲ or ▼) at the fill point.
5. Alerts
The script sets up two alert conditions: one for a bullish IFVG fill, and one for a bearish IFVG fill.
These can be used to trigger TradingView alerts for trading signals.
6. Debugging and Info Labels
The script displays labels on the chart showing the detected ticker and the subpair being plotted, for clarity.
This indicator is even more reliable when combined with the Mirror 2 indicator, which shows the same system but mostly with the BTC pair in crypto.
Both the Mirror US10Y and Mirror 2 also allow you to see the main inverse pairs in stocks.
Sürüm Notları
This Pine Script v6 indicator, called Mirror US10Y, allows you to visualize and analyze the relationship between any asset and the US 10-Year Treasury Yield (US10Y). The indicator automatically constructs the subpair (ASSET/US10Y) and displays its chart, detecting and marking Imbalance Fair Value Gap (IFVG) zones, both bullish and bearish, and generating alerts when these zones are “invalidated” by price action.How it works
Automatic subpair: The indicator detects the current ticker and constructs the subpair with US10Y. If the ticker already contains a slash (“/”), nothing is added to avoid errors.
Visualization: It displays the ASSET/US10Y chart with candles, using customizable colors for bullish and bearish zones.
IFVG detection: It automatically identifies IFVG (Fair Value Gap) zones, both bullish and bearish, based on price dynamics and a configurable ATR filter.
Zone management: IFVG zones are managed and marked as “invalidated” when price crosses them, and are visually shown with boxes and lines.
Alerts: It generates automatic alerts when an IFVG zone is invalidated, for both bullish and bearish signals.
Customization: You can adjust the number of zones displayed, the type of signal (close or wick), the ATR multiplier, and the colors.
How to use?
When you activate the indicator, you’ll be able to see the IFVGs of your asset in relation to US10Y. If the price reaches an IFVG on the main chart and at the same time on the subchart, it’s a good entry point for an order.
It’s recommended to use IFVG Extended on the main chart to visualize the IFVGs.
It’s also recommended to use Mirror BTC (for crypto) and Mirror VIX to strengthen confluences.
Sürüm Notları
All assets are now displayed with US10YKorumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmaktadır. Ancak, özgürce ve herhangi bir sınırlama olmaksızın kullanabilirsiniz – daha fazla bilgi burada.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmaktadır. Ancak, özgürce ve herhangi bir sınırlama olmaksızın kullanabilirsiniz – daha fazla bilgi burada.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.