Gaps + Imbalances + Wicks (MTF) - By Leviathan

This script will identify and draw price gaps, wicks and imbalances with customizable fill conditions, multi-timeframe function, zone size filtering, volume comparison, lookback filtering, as well as highly customizable appearance and settings.

I’ve made this indicator to combine the three similar but different elements that occur in price movements and serve as significant zones of interest or way of PA interpretation in various different strategies.

Imbalances (or Fair Value Gap/FVG/Inefficiency/whatever)
- The Imbalance “pattern” consists of 3 candles (1- candle before the sharp move, 2 - sharp move candle and 3- candle after the sharp move). When price makes a move downwards, the imbalance zone is defined as the area between the low of 1 and the high of 3 When price makes a move upwards, the imbalance zone is defined as the area between the high of 1 and the low of 3.
A price gap is an area on a chart where no trading activity has taken place. A gap up means that the low of the current candle is higher than the high of the previous candle and a gap down means that the high of the current candle is lower than the low of the previous candle.
Wicks (or shadows/tails/whatever)
Wicks are used to indicate where the price has fluctuated relative to the opening and closing price of the candle. An upper wick is the zone between candle high and candle close/open (whichever is higher) and a lower wick is the zone between candle’s low and candle’s close/open (whichever is lower).

Settings Overview

“Zone Type” - This input lets you decide which zones should the script plot and on which timeframe. You should always pick a timeframe higher than your chat’s.
“Middle Line, Top Line, Bottom Line” - Show or hide the Middle Line (horizontal level in the middle of each zone), Show or hide Top Line (horizontal level at the top of the zone), Show or hide Bottom Line (horizontal level at the bottom of the zone)
“UP/DOWN Zones" - This input lets you show/hide UP Zones or DOWN Zones an pick their color, border color and label color.
”Fill Condition” - If turned ON, the zones will end drawing when your prefered Fill Condition is met (Full Filll = price mitigates the whole zone, Half Fill = zone is at least halfway mitigated and Touch = zone is touched by price). If turned OFF, the zones will only be plotted for the amount of bars defined it “Zone Length”.
”Lookback (D)” - This input lets you limit the amount of zones plotted on the chart by choosing how many days back in time should the script go to find and plot zones. For example, input 1 will only show you the zones of the past day, input 7 will only show you the zones of the past week.
”Hide Filled Zones” - If turned ON, the zones that have been filled will be removed from the chart.
”Show Boxes” - Show or hide the boxes that represent the zones. This is useful for those who want the zones to be visualized by just lines.
“Filter Type” - this input lets you create a filter that will make the script only show zones that are larger than ATR or larger than a certain percentage. You can choose the ATR Length and the multiplier (higher multiplier → larger zone required), as well as the Percentage (%) and its multiplier (higher percentage → larger zone required). If you choose “None”, the zones of all sizes will be plotted.
”Zone Labels” - this part of the settings lets you: show/hide labels, decide on the size of the labels and their positions, choose a custom name for each zone, choose the data that the labels present (Type of the zone/Timeframe/ Volume ).
”Other settings” - ‘Stop/Delete zone after X number of candles’ will force stop/delete the zone if it’s plotted for more than prefered number of bars. ‘Line Style’ lets you choose the style and the color of the lines, ‘Zone Length’ defines the length of the zone if Fill Condition is “None”.

More settings, modifications and improvements coming in future updates. This script is a bit old so I will clean up and optimize the code once I have more time.

Register and get access to exclusive scripts:
WOO X: referral.woo.org/7MY2

USDT(TRC20): TEv77qPZ4iC2oFbXppVEw1wZ6N6LEGokhg
ETH(ERC20): 0x29f3081160b8ddfc48383d6a8923440df839784e
BTC: 1EYHZoWFBv7wQmn7w5hxS5LdWT9PHeKic2

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。