OPEN-SOURCE SCRIPT

FVG (ICT) with Swing Levels

This indicator, called "Fair Value Gaps (ICT) with Swing Levels", overlays on the main chart and does the following:

Initial Setup:

It defines user-adjustable parameters:

lookback: Lookback period to keep FVGs visible.
swingPeriod: Period for calculating swing highs and lows.
bullColor and bearColor: Colors for bullish and bearish FVGs.




Fair Value Gaps (FVGs) Detection:

Uses a function to identify FVGs by comparing candle high and low prices.
A bullish FVG forms when the low of two candles ago is higher than the high of the current candle.
A bearish FVG forms when the high of two candles ago is lower than the low of the current candle.


Swing Levels Calculation:

Calculates swing highs and lows over the specified period.
These swing levels define the current market range.


Current Range Verification:

Implements a function to check if an FVG is within the range defined by swing levels.
This ensures only the most relevant FVGs for the current market situation are displayed.


FVG Drawing:

When it detects an FVG (bullish or bearish) within the current range, it draws a box on the chart.
Boxes extend from the bar where the FVG formed to the current bar.
Bullish FVGs are drawn in green and bearish in red (colors are customizable).


Old FVGs Management:

On each new bar, the indicator checks all existing FVG boxes.
It removes boxes that are outside the specified lookback period.
It also removes boxes that are no longer within the current range of swing levels.


Swing Levels Visualization:

Draws lines on the chart to show swing highs (in blue) and swing lows (in purple).
These lines help visualize the current market range.


Continuous Update:

The indicator updates on each new candle, constantly refreshing FVGs and swing levels.



In summary, this indicator identifies and visualizes Fair Value Gaps according to the ICT methodology, filtering them based on higher timeframe swing levels. This helps traders focus on the most significant FVGs within the current market context, reducing visual noise and potentially improving trading decision-making.
fairvaluegapFractalfvgictictconceptsictfvgictstudent

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항