OPEN-SOURCE SCRIPT

[CT] Displacement FVG Toolkit

161
[CT] Displacement FVG Toolkit is a complete ICT market-structure and execution toolkit designed to help you identify when price is truly repricing, where that repricing left inefficiencies, and how to frame trades with clear context, confirmation, and invalidation. The indicator brings together six institutional-grade concepts into one workflow, Displacement, Fair Value Gaps, Reload Zones, Dealing Range premium and discount, CISD, and Market Structure breaks, so you can stop reacting to random candles and start trading the sequence that professional order flow tends to follow, impulse, imbalance, retrace, and continuation or reversal.

The Displacement tool is the engine that decides whether a candle represents meaningful participation or ordinary noise. Displacement is measured by comparing the current candle’s size to the average candle size over a user-defined lookback. You can choose whether the script uses the candle body size or the full high-to-low range for this calculation. When the candle exceeds the average by your selected displacement factor, it is flagged as displacement. Displacement is important because it is the clearest visible clue that the market has moved from balanced auction to aggressive repricing, which is the environment where inefficiencies form and where your best retest trades are born. In the photo, the yellow bars represent the displacement bars, and the indicator prints Buy and Sell markers on those displacement events. The user also has full control to color displacement bars to a color of their choice, so whether you prefer bright yellow, muted gray, or any custom brand color, you can set the exact bullish and bearish displacement bar colors in the inputs. If you do not want bar coloring at all, you can simply turn off displacement bar coloring and use only the markers.

The Structure Filter is a powerful addition that prevents displacement from becoming “any big candle.” When enabled, the indicator requires the displacement candle to also break recent structure, meaning price must break above a recent high for bullish displacement or below a recent low for bearish displacement. You can decide whether the structure break is judged by a candle close beyond the prior structure level or by a wick that pierces it. Close-based structure breaks are cleaner and generally reduce false positives, while wick-based breaks are more sensitive and can trigger earlier at the cost of more noise. This filter matters because a large candle in the middle of chop is not the same as a large candle that actually breaks a meaningful swing point, and the indicator gives you a way to enforce that distinction mechanically.

The Fair Value Gap tool identifies the most valuable type of imbalance, the three-candle FVG, but it only plots those gaps when they are created by validated displacement. A bullish FVG forms when the current candle’s low is above the high from two candles ago, showing that price skipped a region without fully transacting through it. A bearish FVG forms when the current candle’s high is below the low from two candles ago. These gaps represent unfinished auction, a fast repricing that often leaves behind an inefficiency the market may later revisit to rebalance. You can choose to extend FVGs to the right for a set number of bars so you can see the levels well into the future, or you can keep them confined to the period when they formed. You can also choose whether mitigated FVGs remain visible or are hidden. Mitigation in this script means price has traded back into the gap far enough to invalidate it as an active inefficiency, and when that happens you can either keep it on the chart as historical context or remove it to keep your chart clean. The script also manages object limits by keeping only a user-defined maximum number of FVGs, trimming older ones as needed so the indicator remains stable.

Reload Zones are derived directly from the FVGs and are built for execution. Instead of treating the entire gap as the same, the indicator highlights the portion of the imbalance that most often functions as the highest-quality retest area for continuation entries. For bullish FVGs, the Reload Zone is drawn as the upper portion of the gap, and for bearish FVGs it is drawn as the lower portion, which keeps your focus on the retest region that is closest to the direction of repricing and typically provides tighter invalidation. The indicator also includes an optional Invalidation line that marks the far edge of the full FVG, giving you a clean and consistent “line in the sand” for risk management. The intended use is straightforward, you wait for displacement to print and create an FVG, you allow price to retrace into the Reload Zone, and you look for rejection behavior that confirms responsive participation, such as wicks into the zone that close back out, sharp reaction candles, or structure holding in the direction of the displacement. When price accepts inside the zone with multiple closes and slow grind, that’s often a sign the inefficiency is being repaired rather than defended, and the reload entry loses quality. Because reload zones are tied to displacement-generated FVGs, they naturally filter out weaker imbalances and focus you on the kind created during true repricing.

The Dealing Range tool provides context by defining a rolling high-to-low range over a user-defined lookback, then splitting that range into premium and discount. The indicator plots DR High, DR Low, and a DR Mid 50% line, and can optionally show PD 62% and PD 38% reference levels inside the range. The fill visually highlights premium above the midpoint and discount below it, which helps you avoid the most common retail mistake, buying in premium and selling in discount without a strong reason. The dealing range is not meant to be a rigid “support and resistance box.” It is meant to help you frame location. In general, long ideas have better location when price is in discount or reclaiming the midpoint with momentum, and short ideas have better location when price is in premium or rejecting the midpoint from below. This becomes especially powerful when combined with your other tools, because a bullish displacement and FVG that forms in discount and then holds the reload zone tends to have much better continuation odds than the same pattern forming at the very top of premium into overhead liquidity.

CISD in this indicator is your liquidity-sweep and directional-shift engine, designed to answer a very specific question, did price just take liquidity and then flip orderflow enough to justify a new directional bias. The script first maps swing liquidity using pivot highs and pivot lows over your selected swing period, then tracks when those levels are wicked or mitigated within an expiry window. When a swing high or swing low is taken, the CISD logic watches for the characteristic shift pattern that follows, and when it qualifies it prints a CISD level and establishes a trend state. The “Noise Filter” setting controls how strict the CISD trigger is, higher values reduce noise and produce fewer but more meaningful CISDs, while lower values produce more signals but may include weaker shifts. The indicator also distinguishes between a normal CISD and a stronger CISD that occurs after opposing liquidity was recently wicked within your liquidity lookback, and those stronger events are marked with the directional ▲/▼ symbols so you can immediately recognize when a sweep-and-shift sequence likely occurred instead of a random flip.

A key feature you asked for, and that this indicator includes, is that CISD levels can extend in a very controlled way so you can keep trading them without guessing where the level “ends.” The current timeframe CISD lines are drawn at the origin level and then the script can extend only the most recent X CISD lines out past the current bar by a user-defined number of bars, without creating gaps or redrawing incorrectly. This means your newest CISD levels remain visually “live” and tradable into the immediate future, while older CISDs automatically restore to their original endpoints and behave normally. This is important for execution because it keeps the focus on the levels that are most likely to matter now, while still preserving history without clutter.

The MTF CISD add-on is what gives you institutional alignment, because it allows a higher timeframe CISD to print onto your execution timeframe. The script computes CISD on the selected HTF using request.security and then draws HTF CISD lines on your chart in real time. You can choose “Confirmed HTF only,” which means the HTF CISD only prints when the higher timeframe candle closes, or you can turn confirmation off to see developing HTF CISDs while the HTF candle is still building. The HTF line style is configurable, and the HTF lines can extend to the right so they behave like real mapped levels. The HTF label is also supported and can be pinned to the right edge with an x-offset, so you always know which timeframe the CISD came from without having to guess. Optional HTF markers can print ▲/▼ on the bar where a new HTF CISD event is detected, which gives you a fast “regime shift” alert that pairs extremely well with your displacement and FVG tools.

CISD also includes a candle coloring option so you can visually trade the bias without constantly reading every label. You can keep candle coloring off, turn on an overlay candle layer using plot candle, or use bar color to recolor the native chart candles. The trend that drives candle color can be the current timeframe CISD trend or, if enabled, the HTF CISD trend so your execution timeframe candles reflect the higher timeframe shift. In the combined script, displacement bar coloring still has priority if you leave it enabled, meaning displacement bars will show your displacement color choice first, and the CISD candle coloring will apply where displacement is not overriding. That’s intentional, because displacement bars are “event bars,” while CISD coloring is “state,” and you want to see both without confusion.

In terms of how to use CISD with the rest of this indicator, the cleanest institutional workflow is to treat CISD as the directional context and trigger, and use displacement, FVG, and Reload Zones as the execution framework. A fresh HTF CISD is your “macro shift” that tells you which side is likely building control, then you wait for displacement on your execution timeframe that agrees with that bias and produces an FVG. The Reload Zone becomes your location for entry on the retrace, BOS/CHOCH tells you if structure is truly transitioning or continuing, and your invalidation stays anchored to the far edge of the FVG or the CISD level depending on which is tighter and more structurally meaningful. When CISD and displacement disagree, that’s usually a “stand down or reduce size” condition unless you’re explicitly trading a reversal, because it often means the market is still in rotation or repairing imbalance rather than trending cleanly.

The BOS and CHOCH tool is the structure confirmation layer. The indicator finds swing highs and swing lows using a pivot-based swing length and then plots structure lines at those pivots. Breaks are detected either by close or by wick, based on your setting. BOS, Break of Structure, signals continuation in the current structural regime, while CHOCH, Change of Character, signals a likely regime change. The indicator uses a simple internal state to differentiate BOS from CHOCH, so you can read structure shifts in real time rather than labeling everything as a generic “break.” You can display structure as lines, labels, or both. The lines extend until price breaks them, then they stop at the break so you can visually see exactly where the market transitioned. This module is especially useful for keeping you out of the trap of assuming a pullback is a reversal. If you see displacement and FVGs but no structural confirmation, you can reduce size or wait. If you see a CHOCH that aligns with a displacement shift and then price returns to a reload zone, you have a much higher quality reversal framework.

When you put these tools together, the intended trading workflow becomes a complete narrative. First you identify meaningful movement through displacement, and if you use the structure filter you ensure it is not just a large candle but a break in the auction. That displacement then creates an FVG, the inefficiency left behind by repricing. The Reload Zone marks the most tradable retest area of that inefficiency, and the invalidation line gives you a clear risk boundary. The Dealing Range tells you whether you are taking that setup from a favorable location, discount for longs or premium for shorts. BOS and CHOCH provide the final confirmation layer that tells you whether you are trading continuation or a genuine structural shift. This structure keeps you from chasing breakouts, because it naturally trains you to wait for the pullback into the reload zone and to only participate when price proves acceptance and rejection behavior at the level.

This indicator is built to be flexible. You can run it as a clean displacement plus imbalance tool by focusing on displacement, FVGs, and reload zones, or you can turn it into a full context-and-confirmation system by adding dealing range and BOS/CHOCH. If you want a high-signal, low-noise chart, keep the structure break requirement on, use close-based breaks, limit the number of active gaps, and hide mitigated gaps. If you want more sensitivity and earlier signals, use wick-based breaks and allow more gaps to remain visible. The goal is always the same, to help you see when the market is actually repricing, to mark the price areas where that repricing left unfinished business, and to give you a consistent way to execute retests with defined risk and clear structural context.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.