OPEN-SOURCE SCRIPT
Aggiornato

FeraTrading Multi-Timeframe FVG w/ Volume Filtering

1 329
Welcome to the FeraTrading Multi-Timeframe FVG w/ Volume Filtering Indicator.

This Fair Value Gap (FVG) indicator identifies bullish and bearish FVGs across up to 5 customizable timeframes—from intraday scalps to higher-timeframe confluences.

🔹 Volume-Filtered FVGs: Optionally filter for high-volume zones only, focusing on strong institutional interest.

🔹 Bullish & Bearish Toggles: Choose which setups you want to see.

🔹 Dynamic Gap Lengths: Gap size automatically scales with volume intensity using a smart multiplier.

🔹 Multi-Timeframe Support: Pulls FVGs from higher timeframes without cluttering your chart.

🔹 Color-Coded Zones: Easily distinguish between bullish and bearish areas with custom transparency.

Great for scalpers, day traders, and swing traders looking for precise entry zones backed by volume and structure.

We made this indicator open-source on purpose: So you can tweak it, improve it, or build on it. Whether you’re a developer or a trader with some coding skills, we want you to make it your own and help the tool evolve with the community. Mess with the volume logic or how the FVGs interact with candles, it is all setup for you to do so. If you are not a coder, enjoy using a great indicator!

This indicator was developed by FeraTrading to visualize market structure.
Note di rilascio
Updated Informational Section.
Note di rilascio
UNDERSTANDING THE CODE

1. User Inputs for Timeframes:

The script defines up to five separate timeframe inputs (tf1, tf2, tf3, tf4, tf5).

Each timeframe has a toggle (enableTF1, enableTF2, etc.) so the user can enable or disable specific timeframes dynamically.

2. Determining Whether the Timeframe is Higher or Lower:

Inside the f_process_timeframe_custom function:

It compares the selected timeframe (tf_val) to the current chart’s timeframe (timeframe.multiplier).

If the selected timeframe is greater than the chart timeframe → it flags compositeNeeded = true (meaning higher timeframe behavior is required).

If not greater → it processes like normal lower timeframe data.

3. Lower Timeframe Processing (Same or Lower):

If compositeNeeded = false, it uses request.security() to pull standard high, low, close, and volume values.

Then it runs the standard FVG detection logic (f_processFVG) on every bar.

FVGs are drawn immediately based on the raw data.

4. Higher Timeframe Processing (Composite Needed = True):

If compositeNeeded = true, it uses request.security() to call a special higher timeframe FVG function (f_htf_fvg()).

f_htf_fvg() processes inside the higher timeframe and returns:

Volume strength

Bullish FVG condition

Bearish FVG condition

High and low prices

Additionally, the HTF bar’s time (htfTime) is pulled using request.security(time).

New FVGs are only processed once per new HTF candle — not every chart candle — by checking if htfTime != htfTime[1].

This prevents repainting and avoids overplotting for higher timeframes.

5. Drawing the FVG Boxes:

When a FVG condition is confirmed (bullish or bearish):

A box is created starting from the second bar before the gap (bar_index[2]) extending right based on a dynamic width calculated from volume (volCalc).

Volume filters are optionally applied if enabled by the user (HighVolume input).

All boxes are stored in an internal array boxesArray to track and manage them efficiently.

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.