The Congestion Identifier (CI) is a specialized technical tool designed to help traders visualize price stability and market activity levels. Unlike standard moving averages or oscillators that simply follow price, this script focuses on identifying "congestion"—periods where the price is oscillating within a specific, tight range rather than trending strongly in one direction.
How the Logic Works
The core mechanism of the script revolves around three main components: Range Detection, Frequency Counting, and Level Crossing.
1. Range Detection
The script looks at a specific point in time and establishes a "neutral zone" based on your settings. It takes the current price and adds/subtracts a specific value (the Delta). For example, if the price is $100 and your Delta is 10, the script creates a virtual box between $90 and $110.
2. Frequency Counting (The Counter Graph)
Once that "neutral zone" is established, the script looks backward over a set number of historical candles (the Period). It counts how many of those candles closed inside that price box.
- High Count: If almost all candles in that period are staying within the box, it indicates high congestion (sideways movement).
- Low Count: If very few candles are in the box, it suggests the price is moving aggressively outside of that range (a trend or breakout).
This data is plotted as a continuous line on your chart, allowing you to see how the "density" of the market changes over time.
3. Signal Identification (In/Out Arrows)
To make this data actionable, the script identifies specific moments when the market transitions from one state to another based on a user-defined Level. It looks for "crosses" in the counting data:
- Entry Signal (In): Triggered when the congestion count drops below your chosen level. This suggests that price is breaking out of its previous "box" and gaining enough momentum to potentially start a new trend.
- Exit Signal (Out): Triggered when the congestion count rises above your chosen level. This suggests that price has entered a state of consolidation, where it may be "stalling" or moving sideways, often signaling a time to reduce exposure or wait for a clearer direction.
Summary of Visual Elements
- Blue Line: Represents the "Congestion Count." The higher the line, the more compressed/sideways the market is.
- Green Arrows: Indicate a drop in congestion (potential breakout).
- Red Arrows: Indicate an increase in congestion (potential sideways stall).
ÿþ/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
/ / | C I . m q 5 |
/ / | C o p y r i g h t 2 0 1 8 , M e t a Q u o t e s S o f t w a r e C o r p . |
/ / | h t t p s : / / m q l 5 . c o m |
/ / + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
# p r o p e r t y c o p y r i g h t "