OPEN-SOURCE SCRIPT
Aggiornato 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).
Note di rilascio
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).
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.