OPEN-SOURCE SCRIPT

Percentage Range Consolidation Histogram

ที่อัปเดต:
The Percentage Range Consolidation histogram is a measure of volatility, ranking current price range compared to past ranges.

🟩​ USAGE

สแนปชอต

Here there are 2 heavy contractions of price shown on chart that lead to a big rally. Shows a possible way to approach trading this. Take into account that this is for illustration purposes only and these entry methods have not been tested for long term profitability.

สแนปชอต

Same price behaviour.


🟩​ CALCULATION

The script will use 3 different ranges all configurable by the user to check for low volatility on different zone lengths. On default zone 1 will be 10 period, 2 will be 30 period and 3 is 50 periods long.

It will then measure the percentage these ranges have from top (highest close) to bottom (lowest close) and plot those numbers as 3 gray histograms.

For each of these histograms separately it will use 'percentage zone PNR Length setting' as a lookback to rank current zone percentage compared to past results.
How it will do that is using the 'percentage zone PNR % setting' it will draw a line using ta.percentile_nearest_rank() formula. At default this is 20% meaning that only 20% of lookback values where below this level.

When the histogram is below this white line (small range compared to past ranges) it will color the histogram. Yellow for zone 1, orange for zone 2 and blue for zone 3.


There is also a 'Percentage zone % filter' which you can use as a maximum % current zone for it to be considered a small range. On default this is set to 15%. You can turn this off by selecting 'median' as 'Consolidation filters' instead of 'all'. Or only use this by selecting 'percentage'

🟩​ BAR COLORING

Now that you understand how to find small ranges (contractions of price) with the indicator there is a bar coloring option in the indicator.

You can select how many of the 3 zones have to be ranging for it to color the bar. On default this is set to 3 so the script will only color when price is in a very small range. As illustrated by the above charts these can lead to the beginnings of big trends.
เอกสารเผยแพร่
As requested by a user added alerts to the script and show them in script.

  • "Consolidation start" - Alerts when a new consolidation area is created.
  • "breaks top of range" - Alerts when closing price closes above top of consolidation range.
  • "breaks bottom of range" - Alerts when closing price closes below bottom of consolidation range.


สแนปชอต
In case the break alerts are confusing here is a visual on how it works. Script will track highest highs and lowest lows in last consolidation area (as seen by red candles). When price is no longer consolidating and closes beyond one of these lines it removes them and sends an alert.
เอกสารเผยแพร่
Changed background coloring for breaks to be red for short pressure and green for long pressure
Bands and ChannelsHistorical VolatilityVolatility

สคริปต์โอเพนซอร์ซ

ด้วยเจตนารมณ์หลักของ TradingView ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถเข้าใจและตรวจสอบได้ ต้องขอบคุณผู้เขียน! ที่ให้คุณใช้ได้ฟรี แต่การนำโค้ดนี้ไปใช้ในการเผยแพร่ซ้ำจะต้องอยู่ภายใต้ กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?


✅ Learn how I trade as a FUND MANAGER here.

Telegram —> t.me/honestalgo
Telegram —> t.me/honestalgo
Telegram —> t.me/honestalgo
และใน:

คำจำกัดสิทธิ์ความรับผิดชอบ