OPEN-SOURCE SCRIPT

[CT] MTF CISD w/Extensions

327
This indicator is a modified version of “Change in State of Delivery CISD” originally created by © AlgoAlpha and released under the Mozilla Public License 2.0. The core CISD logic, including how the script identifies qualifying bullish and bearish state changes and how it draws the original CISD levels, comes from AlgoAlpha’s work. The version you are using has been modified by © ChaosTrader63 to add multi time frame CISD functionality, optional HTF labeling and styling controls, and a configurable method to extend a user selected number of the most recent current time frame CISD levels beyond the last candle.

At its core, CISD is designed to identify moments when price behavior suggests a meaningful shift in control, where one side of the market has effectively “taken delivery” and the prior state has changed. The script watches price swings, then tracks specific candle state transitions that can act like triggers. When the conditions are met, it prints a CISD level as a horizontal line originating from the candle that defined the trigger and extending to the detection candle, creating a clear reference level that can behave like a decision point for future price interaction. In practice, those levels often act as areas where price may react, reject, or accept, because they represent the point where a meaningful state change was confirmed by price behavior rather than by a simple moving average or lagging trend filter.

The indicator also includes swing based liquidity tracking to provide context around potential liquidity events. It detects swing highs and swing lows using a pivot period you control, then maintains those swing levels as “liquidity lines” until they are either mitigated or expire after a set number of bars. When price wicks into one of those swing liquidity levels and confirms the mitigation, the script records that event. If a CISD trigger happens shortly after, and the new state change occurs with evidence that opposing liquidity was just taken, the script flags that as a stronger event by marking it on the chart. This is meant to separate normal CISD signals from those that occur after a sweep, because a sweep plus a decisive state change is often more meaningful than a state change that happens in the middle of noise.

The user controls in the calculations section determine how sensitive or selective the CISD detection is. The noise filter controls how strict the script is about qualifying the internal structure that leads to a CISD event. Higher values reduce noise and typically produce fewer, more selective CISD levels, while lower values will produce more frequent levels that may be less reliable in choppy conditions. The swing period controls how far back the script looks when identifying pivot highs and lows, which changes how “major” a swing must be to count as liquidity. The expiry bars setting controls how long older liquidity levels remain active before they stop updating or are removed, and the liquidity lookback determines how recently a swing mitigation must have occurred for the script to treat the CISD as happening with a sweep.

Visually, the script colors candles based on the current CISD trend state. When a bearish CISD is detected, the trend state flips bearish and candles are shaded using the bearish color with a user controlled transparency blend, and when a bullish CISD is detected the trend state flips bullish and candles are shaded using the bullish color. This makes the tool useful not only for marking levels, but also for keeping a simple “state” view on the chart so you can see when the indicator believes control has shifted. If you enable the option to use HTF trend for candle coloring, then the candle shading can reflect the higher time frame trend state instead of the local chart state, which is helpful when you want to trade a lower time frame while staying aligned with the higher time frame CISD bias.

The modifications add a higher time frame CISD layer so you can see more significant CISD levels from a chosen HTF while trading on a lower time frame chart. When enabled, the script computes CISD on the higher time frame through a request security call and then draws HTF CISD lines onto your current chart. You can require confirmed HTF signals only, which means the HTF CISD will print only after the HTF candle closes, reducing repaint style behavior and preventing the level from appearing and disappearing mid-candle. The HTF CISD lines keep the original bullish and bearish color scheme, and you can choose whether they render as solid or dashed to visually separate HTF structure from current time frame structure. The script can also place a label on the HTF CISD level, showing the selected HTF, for example “15 min HTF CISD,” and you can control the label background color, text color, size, and a horizontal offset so the label sits to the right of the current price rather than directly on top of the level.

The other key modification is the extension system for the current time frame CISD levels. The original script draws CISD levels from the origin candle to the detection candle, which is the “normal” behavior and is still preserved for all CISD levels. The enhancement allows you to choose how many of the most recent current time frame CISD levels you want to extend past the last candle by a defined number of bars. This is designed for traders who want their freshest decision levels projected into the future so they can be used as immediate references for reaction, acceptance, rejection, entries, or targets, without cluttering the chart by extending every single historical level. Because the extension uses the original line and simply moves the line’s end point to bar index plus your offset, it extends cleanly from the true starting point with no visual gap, and it automatically updates as new bars print. When a level is no longer within the most recent group, the script restores the original endpoint so older CISD lines revert back to normal and do not continue extending.

To use the indicator effectively, start by choosing whether you want it to be a current time frame decision tool, a higher time frame structure tool, or both. If you are trading lower time frames, enabling HTF CISD with confirmed only is usually the cleanest way to stay aligned with the dominant structure while avoiding levels that shift during an unclosed HTF candle. Then tune the swing period and noise filter to your market. If you are seeing too many levels in chop, increase the noise filter and consider a longer swing period so only larger structural transitions qualify. If you are missing important shifts, reduce the noise filter slightly so the script becomes more responsive. For execution, treat CISD levels like state change reference prices. When price returns to a bullish CISD level, look for acceptance above it to confirm continuation or rejection below it to warn of failure, and do the inverse for bearish levels. The liquidity sweep markers are especially useful as a context filter, because a CISD that occurs after a sweep often represents a more forceful transition where one side grabbed liquidity and then reversed state, which can create cleaner follow-through or stronger reaction zones.

Overall, this modified version keeps AlgoAlpha’s original CISD and liquidity framework intact, but adds the two things traders typically need when using a state change concept in live execution: the ability to overlay higher time frame CISD structure on a lower time frame chart, and the ability to project only the most relevant recent CISD levels into future bars so the levels are immediately actionable without turning the chart into a wall of extended lines.

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.