OPEN-SOURCE SCRIPT
Aggiornato Fractal Levels Monitor w/ Trade Lines (ChadAnt) v2

Small update. Prevents the break candle from getting another signal after the first buy/sell signal detected.
1. Fractal Level Detection
The indicator identifies Fractals, which are simply a series of bars where the center bar has the highest high (Bearish Fractal) or the lowest low (Bullish Fractal) compared to a set number of bars on either side (determined by the "Fractal Period" input, usually 2 to 5 bars).
Bullish Fractal Level (Support): The indicator plots a horizontal line at the lowest low of the most recently formed Bullish Fractal.
Bearish Fractal Level (Resistance): It plots a horizontal line at the highest high of the most recently formed Bearish Fractal.
2. The "Cross Candle" Event
The core idea isn't to trade the fractal itself, but the reaction after the fractal level is broken.
When the price breaks and closes through the established Bullish Level (support) or Bearish Level (resistance), that bar is marked as the Cross Candle.
This Cross Candle's High and Low are saved. This is the "setup" for the trade.
3. The Trade Signal (Entry Trigger)
A trade is only taken when the price breaks the extreme (High or Low) of the Cross Candle.
Buy Signal: The trade is entered long if the price breaks above the High of the Cross Candle.
Sell Signal: The trade is entered short if the price breaks below the Low of the Cross Candle.
1. Fractal Level Detection
The indicator identifies Fractals, which are simply a series of bars where the center bar has the highest high (Bearish Fractal) or the lowest low (Bullish Fractal) compared to a set number of bars on either side (determined by the "Fractal Period" input, usually 2 to 5 bars).
Bullish Fractal Level (Support): The indicator plots a horizontal line at the lowest low of the most recently formed Bullish Fractal.
Bearish Fractal Level (Resistance): It plots a horizontal line at the highest high of the most recently formed Bearish Fractal.
2. The "Cross Candle" Event
The core idea isn't to trade the fractal itself, but the reaction after the fractal level is broken.
When the price breaks and closes through the established Bullish Level (support) or Bearish Level (resistance), that bar is marked as the Cross Candle.
This Cross Candle's High and Low are saved. This is the "setup" for the trade.
3. The Trade Signal (Entry Trigger)
A trade is only taken when the price breaks the extreme (High or Low) of the Cross Candle.
Buy Signal: The trade is entered long if the price breaks above the High of the Cross Candle.
Sell Signal: The trade is entered short if the price breaks below the Low of the Cross Candle.
Note di rilascio
This indicator combines fractal-based breakout signals, FVG (Fair Value Gap) filtering, session filtering, and optional automatic trade mapping (Entry / SL / TP lines).It is designed to highlight breakout opportunities while avoiding entries into unfavorable imbalance zones.
1. Core Logic: Fractal Breakouts
The indicator detects bullish and bearish fractals using a user-selectable period.
✔ Bullish Fractal
A bullish fractal forms when a candle’s low is the lowest among surrounding candles (left & right).
This defines a bullish break level.
✔ Bearish Fractal
A bearish fractal forms when a candle’s high is the highest among surrounding candles.
This defines a bearish break level.
The indicator then:
Plots these fractal levels as horizontal lines.
Optionally plots triangle markers at fractal candles.
Waits for price to cross the most recent fractal level.
Colors the “cross candle” for visual clarity.
A breakout setup is created when price closes or wicks through a fractal level.
This becomes the cross candle, whose high/low defines the breakout structure.
🔹 2. Breakout Signal Logic
After a fractal level is crossed:
Buy conditions
A buy signal triggers when:
A bullish fractal level is broken.
Price breaks above the high of the cross candle.
Time is inside allowed session (if enabled).
The FVG filter does NOT block the buy.
Sell conditions
A sell signal triggers when:
A bearish fractal level is broken.
Price breaks below the low of the cross candle.
Session conditions are met.
The FVG filter does NOT block the sell.
Signals appear as BUY / SELL labels and trigger TradingView alerts.
🔹 3. FVG Filter System (Advanced)
The indicator automatically detects:
Bullish FVGs (upward imbalances)
Bearish FVGs (downward imbalances)
It draws boxes (optional) and tracks them dynamically.
FVGs can be removed when:
Price mitigates the gap
✔ by close
✔ or by wick
(user chooses which)
OR when they exceed a customizable duration (bars).
Entry Blocking Logic
To avoid poor entries:
Buys are blocked inside Bearish FVGs
Sells are blocked inside Bullish FVGs
This prevents long trades into an opposing imbalance zone and vice-versa.
Blocked trades show an X marker.
🔹 4. Session-Time Filtering
You can limit signal generation to a specific chart session
(default: 9:30–16:00, NYSE hours).
Options include:
Enable/disable time filtering
Highlight the session background on the chart
Outside the session:
Cross candle resets
Signals are not generated
🔹 5. Trade Management Lines
When a buy or sell signal triggers, the indicator automatically draws:
📍 Entry Line
at the breakout point (cross-candle high/low)
📍 Stop Loss Line
at the opposite side of the cross candle
📍 Take Profit Lines (R:R)
TP1 always shows
TP2 & TP3 are optional
Custom R:R ratios can be set per TP.
Trades are updated dynamically until:
SL or TP1 is hit (status closed)
Oldest trades are deleted automatically when exceeding the max visible count.
This gives a clean visual representation of trade structure and outcomes.
🔹 6. Color-Coded Cross Candles
The candle where the fractal break occurs (the “cross candle”) is highlighted:
Custom body, wick, and border colors for bullish and bearish crosses
Optional modified candle rendering to emphasize the breakout point
🔹 7. Alerts
The indicator provides two alert conditions:
Buy Signal
Sell Signal
Alerts fire when the breakout confirmation condition is met (after FVG filtering).
🔹 8. Summary of What This Indicator Helps You Do
✔ Identify key fractal structures
✔ Track breakout levels in real time
✔ Auto-detect FVGs and avoid bad entries
✔ Enforce time-based trading windows
✔ Visualize full trade setups (entry, SL, TP)
✔ Receive clean buy/sell alerts only when conditions are aligned
It is essentially a breakout-trading system enhanced by liquidity theory (fractal sweeps) and ICT-style imbalance filtering.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.