Zone Master [SimpleAlgo]

2 748
🧊 INTRODUCING ZONE MASTER

Supply and demand is the oldest idea on a chart: price left a place in a hurry, so something was waiting there, and when price comes back the leftovers get filled. Most zone tools stop at drawing the rectangle. The rectangle then sits on the chart forever, the same colour on its first touch as on its sixth, long after everything inside it has been used up.

Zone Master keeps the books. A zone is born from a quiet base and a fast departure, and from that moment it is measured: how hard price left it, how many times price has come back, and how much of it has been spent. As price trades back into a zone it melts from the edge price meets first, and what has been traded through goes faint. A close an ATR clear of the zone is a hold, a close beyond the far edge ends it, and a zone that has been tested enough times retires. The panel names the nearest demand and supply with their distance in ATR, and keeps the score of what happened on this chart the last ten times a zone was tested.

cuplikan

🧱 The look

Every zone has three parts, and together they are a picture of how it was made. The pad is a small box over the quiet bars, with the departure written beside it: "3.2 ATR" means price travelled three and a bit ATRs away from the base within a few bars. The launch line runs from the pad to the close that made the zone, so the move itself is on the chart. The zone then extends to the right as an ingot that glows at the edge price will meet first and fades toward the far edge, dissolving into the future instead of ending in a wall.

💡 What's different

Zones here are consumable. Price trading into a demand zone eats it down to that low, and the bright edge moves with it, so a half-spent zone is visibly half the ingot it was. The part already traded through stays as a faint ghost so you can see what the zone used to be. Nothing on the chart says "fresh" unless price has never been back.

⚙️ HOW IT WORKS

📌 1. The base

On every closed bar the script asks whether this close is a departure from a quiet base that ended a few bars ago. For each possible base end inside the last 8 bars, the base grows backwards one bar at a time for as long as its whole range stays inside 2 ATR. The longest quiet base is the candidate:

Pine Script®


🚀 2. The departure

If the close is at least 2.5 ATR beyond the top of that base it is demand, beyond the bottom it is supply. The size of the departure in ATRs is the zone's strength and is written on the pad:

Pine Script®


🔁 3. One zone per base

As the departure keeps going, the same base qualifies again on the next bar with a bigger number. That does not make a second zone; it updates the first one's strength. And a new base at the same price as a living zone on the same side, overlapping it by more than half, is the same zone, not a stack of three boxes:

Pine Script®


🫠 4. Spending

Every bar, every living zone. A bar's low into a demand zone eats it down to that low, and the ingot is redrawn from what is left:

Pine Script®


Entering a zone opens a test, and the test stays open until price settles it one way or the other: a close at least an ATR clear of the zone is a hold, a close through the far edge is a break. Dipping back in while the test is open is the same test, so an afternoon of chop on the edge of a zone counts once, not five times:

Pine Script®


Supply is the mirror, eaten upward by highs and held by a close an ATR below it.

💥 5. Breaking and retiring

A close beyond the far edge breaks the zone. So does price wicking through every last bit of it, because nothing is left to hold:

Pine Script®


A zone weakens every time price comes back to it, so after its fourth test it retires, whatever is left:

Pine Script®


🧪 6. The record

Every test gets a verdict, held or broke, and the last ten make the "Zones here" line: "Held 7 of the last 10 tests". A chart where zones hold most of the time is a chart where fading into a zone has been the right side lately. A chart where they break is telling you its zones get run. The rule is the same on every chart, so the number is a measurement, not a setting.

🪟 7. The panel

  • Nearest demand: price range, distance below in ATR, departure, fresh or tested, and how much of it is spent.
  • Nearest supply: the same above.
  • Zones here: the record.
  • Read: one line. "Supply 2.0 ATR above is the first thing in the way, demand is 4.2 ATR down", "Sitting on demand at 215.27, a close below 214.06 breaks it", "Testing supply now, a close above 222.19 breaks it", "Nothing above but open ground". When more than half of the nearest zone is gone it says so: "Demand 1.5 ATR below is the first thing in the way, 90% spent, supply is 1.6 ATR up".


🎨 The glow

The ingot is five slabs from the far edge to the near one, each a little brighter, so the edge price will meet first is the brightest part of the zone and the far edge, the break line, is the faintest:

Pine Script®


cuplikan

🎨 Repainting

A zone is created on a closed bar, from bars that have already closed, and from then on it only shrinks. The drawing is rebuilt on the last bar from the zones as they stand, so there is no history to repaint. On the live bar a zone being tested melts as the bar's low or high moves, which is the live bar doing what it does; the verdict is only final on the close.

✨ WHY IT IS ORIGINAL

Quiet base, fast departure: that is supply and demand as it has always been taught, and we have not changed what a zone is. What is new is the bookkeeping and the picture it makes. A zone is spent exactly as far as price has traded into it, it breaks on a close or on being used up, it retires when worn out, and it is drawn as what is left rather than what it was, with the move that made it on the chart beside it. Then every test is scored by one fixed rule so the chart can tell you whether its zones hold. A rectangle tool, a volume profile and a pivot script each exist on their own. Zones that melt, with their departure written on them and a measured record, is what none of them give you.

🧭 HOW TO USE IT

👀 Read the pads first

The number on the pad is how hard price left. A 5 ATR departure means something was there; a 2.5 ATR departure barely qualified. Fresh zones are bright, tested zones are dim, and the faint ghost above a demand ingot is the part that has already been used.

🚦 Then the nearest two

The panel names the nearest demand below and supply above with their distances. "Supply 2.0 ATR above is the first thing in the way" is a ceiling two average bars away; "demand is 4.2 ATR down" is background. When price is sitting on a zone the Read says what breaks it, which is also where a stop belongs if you are trading the zone.

📒 Then the record

Held 8 of 10 and the zones on this chart are worth respecting. Held 3 of 10 and this is a chart that runs its zones, and a fresh zone is a target rather than a barrier. Take the number at face value and let it argue with your habit.

⏱️ Timeframes

Everything is measured in ATRs and bars, so the same settings give sensible zones on a 5-minute chart and a daily. On the 5-minute a zone lives for hours and the record fills in a day. On the daily a zone can sit for months and ten tests can be a year, so read the count. A base on the 5-minute is a single candle on the hourly, so different timeframes show different zones on the same symbol at the same moment.

cuplikan

🌱 If you're new

Three sentences. The mint boxes are places price shot up from and may bounce from again, the pink boxes are places price fell from and may stall at again. The bright edge is where price meets the zone, the dotted edge is where the zone is beaten. The panel tells you which one is closest and how often zones on this chart have held.

None of this predicts where price goes. It is a map of where price left in a hurry, kept honest about what has been used up, and a record of what happened when price came back. Use it with your own analysis and manage your risk.

🛠️ SETTINGS

🧊 Zones

  • Base no taller than (ATR): 2.0 by default. The quiet part of a zone has to fit inside this.
  • Departure of at least (ATR): 2.5 by default. Raise it for only the violent departures, lower it for more zones.
  • Departure within (bars): 8 by default. A slow drift away is not a departure.
  • Shortest base and Longest base (bars): 4 and 12 by default.
  • Retire after (tests): 4 by default.
  • Zones age out after (bars): 2000 by default.


🖌️ Look

  • Zones to draw, each side: 3 by default. The nearest above price and the nearest below; the rest are tracked but not drawn.
  • Within (ATR): 20 by default. Zones further away are tracked but not drawn, so an old zone far from price cannot stretch the chart.
  • Extend right (bars): 12 by default.
  • Colours: Mint and Pink, Ice, Neon, or Custom.
  • Brightness: 1 to 5.
  • Names, Edges, Launch lines: on by default.
  • Panel: position and size.


The rules behind the record are fixed: a test is one visit to a zone, a hold is a close an ATR clear of it, a break is a close through the far edge or the whole zone traded through. Those are right or wrong rather than a matter of taste, and the record only means something if the rule behind it never moves.

🔔 ALERTS

  • New demand zone, New supply zone: a zone was born on this close.
  • Demand reached, Supply reached: price entered a zone, a test opened.
  • Zone held: price closed an ATR clear of a zone without closing through it.
  • Zone broke: a close beyond the far edge, or the zone used up.


Set them to "Once per bar close".

📝 NOTES AND LIMITS

  • A zone is a place price left quickly. It says nothing about why, and it does not know what is resting there now. The spent part is the part price has already traded through, which is the best a chart can do.
  • The departure number is the close that made the zone, so it grows while the departure continues and then stops. It is a measure of how hard price left, not of how strong the zone is now.
  • Only the nearest three zones on each side within 20 ATR are drawn. Everything else is tracked and will appear when price gets near.
  • A zone that retires after four tests is not gone from history; it is simply no longer drawn or counted.
  • On the live bar a zone being tested melts with the bar's extreme. The verdict and the record are only final on the close.
  • The record is ten tests. On a daily chart that is a long time. Read the count.


⚠️ DISCLAIMER

This script is for education and information. It isn't financial advice, a recommendation to buy or sell anything, or a promise about what any market will do. Past behaviour of a market, a method or an indicator doesn't guarantee future results, and nothing on this chart replaces your own judgement. Trading involves risk and you are responsible for your decisions.

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.