Constant Range Channel
Download scriptThis tool is designed for the MetaTrader trading platform to create a visual "Constant Range Channel" on your price charts. It acts as a dynamic pricing guide that helps traders identify specific zones of interest by projecting three distinct lines: an Upper level, a Middle level, and a Lower level.
How the Logic Works
1. Dynamic Step Calculation Rather than using a fixed price number (like $10.00), the script takes a "Step Tick" input from the user. It automatically detects the smallest price movement allowed by your specific financial instrument (the tick size) and multiplies it by your chosen step. This ensures that the channel remains mathematically consistent whether you are trading Forex, Gold, or Indices.
2. Smart Level Adjustment The core logic follows a "sticky" behavior based on the most recent price action. As the market moves, the script evaluates three specific scenarios to decide where the next Middle level should be placed:
- Breakout Up: If the current price closes above the existing Upper level, the channel "shifts up" to accommodate this new momentum.
- Breakout Down: If the current price falls below the existing Lower level, the channel "shifts down."
- Consolidation: If the price stays within the boundaries of the current channel, the Middle level remains stable at its current position.
3. Visual Output The script continuously updates these three lines on your screen:
- Middle Line: The primary anchor point of the channel.
- Upper Line: Positioned exactly one "Step" above the Middle line.
- Lower Line: Positioned exactly one "Step" below the Middle line.
User Experience
For a trader, this means the channel acts like a dynamic corridor. It expands and contracts with the market's volatility—moving upward when the trend breaks high and downward when it breaks low—while always maintaining a perfectly consistent distance between the three lines. It provides a clean, automated way to visualize price boundaries without manual drawing.
ÿþ/ / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# d e f i n e M N a m e "