OPEN-SOURCE SCRIPT
Telah dikemas kini Same-Direction Candles (Two Symbols)

Same-Direction Candles (Two Symbols)
What it does
Highlights bars on your chart when two symbols print the same candle direction on the chosen timeframe:
Both Bullish → one color
Both Bearish → another color
Great for spotting synchronous moves (e.g., NQ & ES, QQQ & SPY), or confirming risk-on/risk-off with an inverse asset (e.g., NQ vs DXY with inversion).
How it works
For each bar, the script checks whether close > open (bullish), close < open (bearish), or equal (doji) for:
The chart’s symbol
A second symbol pulled via request.security() (optionally on a different timeframe)
If both symbols are bullish, it paints Bull color; if both are bearish, it paints Bear color. Dojis can be ignored.
Inputs
Second symbol: Ticker to compare (e.g., CME_MINI:ES1!, NASDAQ:QQQ, TVC:DXY).
Second symbol timeframe: Leave blank to use the chart’s TF, or set a specific one (e.g., 5, 15, D).
Invert second symbol direction?: Flips the second symbol’s candle direction (useful for inversely related assets like DXY vs indices).
Ignore doji candles: Skip highlights when either candle is neutral (open == close).
Coloring options: Toggle bar coloring and/or background shading; pick colors; set background transparency.
Alerts
Three alert conditions:
Both Bullish
Both Bearish
Both Same Direction (bullish or bearish)
Create alerts from the Add Alert dialog after adding the script.
Use cases
Index confluence: NQ & ES moving in lockstep
ETF confirmation: QQQ & SPY agreement
FX/Index risk signals: Invert DXY against NQ/ES to see when equity strength aligns with dollar weakness
Tips
For mixed timeframes (e.g., chart on 1m, ES on 5m), set Second symbol timeframe to the higher TF to reduce noise.
Keep Ignore dojis on for cleaner signals.
Combine with your own entry rules (structure, FVGs, liquidity sweeps).
Notes
Works on any symbol/timeframe supported by TradingView.
Overlay script; no strategy/entries/exits are executed.
Past performance ≠ future results; for education only.
Version: 1.0 – initial release (bar/background highlights, doji filter, inversion, multi-TF support, alerts).
What it does
Highlights bars on your chart when two symbols print the same candle direction on the chosen timeframe:
Both Bullish → one color
Both Bearish → another color
Great for spotting synchronous moves (e.g., NQ & ES, QQQ & SPY), or confirming risk-on/risk-off with an inverse asset (e.g., NQ vs DXY with inversion).
How it works
For each bar, the script checks whether close > open (bullish), close < open (bearish), or equal (doji) for:
The chart’s symbol
A second symbol pulled via request.security() (optionally on a different timeframe)
If both symbols are bullish, it paints Bull color; if both are bearish, it paints Bear color. Dojis can be ignored.
Inputs
Second symbol: Ticker to compare (e.g., CME_MINI:ES1!, NASDAQ:QQQ, TVC:DXY).
Second symbol timeframe: Leave blank to use the chart’s TF, or set a specific one (e.g., 5, 15, D).
Invert second symbol direction?: Flips the second symbol’s candle direction (useful for inversely related assets like DXY vs indices).
Ignore doji candles: Skip highlights when either candle is neutral (open == close).
Coloring options: Toggle bar coloring and/or background shading; pick colors; set background transparency.
Alerts
Three alert conditions:
Both Bullish
Both Bearish
Both Same Direction (bullish or bearish)
Create alerts from the Add Alert dialog after adding the script.
Use cases
Index confluence: NQ & ES moving in lockstep
ETF confirmation: QQQ & SPY agreement
FX/Index risk signals: Invert DXY against NQ/ES to see when equity strength aligns with dollar weakness
Tips
For mixed timeframes (e.g., chart on 1m, ES on 5m), set Second symbol timeframe to the higher TF to reduce noise.
Keep Ignore dojis on for cleaner signals.
Combine with your own entry rules (structure, FVGs, liquidity sweeps).
Notes
Works on any symbol/timeframe supported by TradingView.
Overlay script; no strategy/entries/exits are executed.
Past performance ≠ future results; for education only.
Version: 1.0 – initial release (bar/background highlights, doji filter, inversion, multi-TF support, alerts).
Nota Keluaran
Same-Direction Candles (Two Symbols)What it does
Highlights bars on your chart when two symbols print the same candle direction on the chosen timeframe:
Both Bullish → one color
Both Bearish → another color
Great for spotting synchronous moves (e.g., NQ & ES, QQQ & SPY), or confirming risk-on/risk-off with an inverse asset (e.g., NQ vs DXY with inversion).
How it works
For each bar, the script checks whether close > open (bullish), close < open (bearish), or equal (doji) for:
The chart’s symbol
A second symbol pulled via request.security() (optionally on a different timeframe)
If both symbols are bullish, it paints Bull color; if both are bearish, it paints Bear color. Dojis can be ignored.
Inputs
Second symbol: Ticker to compare (e.g., CME_MINI:ES1!, NASDAQ:QQQ, TVC:DXY).
Second symbol timeframe: Leave blank to use the chart’s TF, or set a specific one (e.g., 5, 15, D).
Invert second symbol direction?: Flips the second symbol’s candle direction (useful for inversely related assets like DXY vs indices).
Ignore doji candles: Skip highlights when either candle is neutral (open == close).
Coloring options: Toggle bar coloring and/or background shading; pick colors; set background transparency.
Alerts
Three alert conditions:
Both Bullish
Both Bearish
Both Same Direction (bullish or bearish)
Create alerts from the Add Alert dialog after adding the script.
Use cases
Index confluence: NQ & ES moving in lockstep
ETF confirmation: QQQ & SPY agreement
FX/Index risk signals: Invert DXY against NQ/ES to see when equity strength aligns with dollar weakness
Tips
For mixed timeframes (e.g., chart on 1m, ES on 5m), set Second symbol timeframe to the higher TF to reduce noise.
Keep Ignore dojis on for cleaner signals.
Combine with your own entry rules (structure, FVGs, liquidity sweeps).
Notes
Works on any symbol/timeframe supported by TradingView.
Overlay script; no strategy/entries/exits are executed.
Past performance ≠ future results; for education only.
Version: 1.0 – initial release (bar/background highlights, doji filter, inversion, multi-TF support, alerts).
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.