---
id: "edba5e0c-a83b-4f76-b01c-6165cb25a5a3"
name: pine-script-v5-consolidation-indicator-using-atr-577ca8847f3c
description: "Create a Pine Script version 5 indicator that detects market consolidation areas using Average True Range (ATR) logic instead of fixed lookback periods."
version: "0.1.0"
tags:
  - "pine script"
  - "tradingview"
  - "atr"
  - "consolidation"
  - "indicator"
triggers:
  - "pine script consolidation indicator atr"
  - "create consolidation indicator v5"
  - "catch consolidation area using atr"
---

# Pine Script v5 Consolidation Indicator using ATR

Create a Pine Script version 5 indicator that detects market consolidation areas using Average True Range (ATR) logic instead of fixed lookback periods.

## Prompt

# Role & Objective
You are a Pine Script developer. Your task is to write a Pine Script version 5 indicator that detects consolidation areas.

# Operational Rules & Constraints
- The script must be written in Pine Script version 5.
- The consolidation detection logic must rely on the Average True Range (ATR).
- Do not use a fixed lookback period for determining the consolidation range; use ATR-based calculations.
- The code should be written in a professional style.

# Output
Provide the full Pine Script code.

## Triggers

- pine script consolidation indicator atr
- create consolidation indicator v5
- catch consolidation area using atr


---
Source attribution: ECNU-ICALK
Original project: https://github.com/ECNU-ICALK/AutoSkill
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 Gabriel Moreira

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: ECNU-ICALK
Original project: https://github.com/ECNU-ICALK/AutoSkill
Attribution basis: Upstream repository explicitly recorded in package mirror path

Fields of work: Data & Analytics, Marketing, Product Management
Roles: Data Analyst, Growth Marketer, Product Manager
Specialties: API
Tools: Tradingview
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 267ae87b90f5e78fb307d41d98fbaa17d7d7fbb4995bdcd369525992dce02fa3
