OPEN-SOURCE SCRIPT
Impulse Origin [Smart Money]

A strong move only tells you it mattered once it is over. Impulse Origin waits for that moment: a run that closes in one direction for a set number of bars without a single counter-close, ending on a bar whose volume has expanded against its own average. When that run is complete, the tool walks back and marks the candle it started from — and not just any opposing candle, but one whose liquidity was taken by the candle that came after it. The result is a zone at the origin of the move, which is then tracked: the first close through it flips its role between support and resistance, and the second close through it retires it.
HOW IT WORKS
The idea behind it is that the beginning of a move is only interesting if the move turned out to be decisive, and you cannot know that while it is still running. So the measurement is deliberately backward-looking: the run is the gate, the origin is the output.
An uninterrupted run of higher closes therefore produces a support zone below, at the candle the run started from — and a run of lower closes produces a resistance zone above, the same way.
Original zones and flipped zones are kept in separate pools with their own capacity, so a new signal never pushes out a zone that has already flipped. Because a long run can produce several trigger bars in a row that all resolve to the same origin candle, the tool remembers the origin it last used and will not redraw the same candle.
HOW TO READ
INPUTS
NOTES & LIMITS
A zone records where a decisive move began and whether that level has since been closed through. What you make of it at the next touch is yours, and that is exactly as it should be. The volume gate is part of the mechanism, so the tool needs a volume feed to produce anything at all — on a symbol that publishes no volume, no zones are drawn, and on forex and CFDs the volume is tick volume (the number of price updates, not contracts traded), which makes the gate read more loosely there. The zone is anchored to the origin candle in the past but is published on the close of the bar that completes the run, so on a chart you are scrolling back through, the zone was not on the screen for the bars between the two. Its price boundaries are set when it is created and never move afterwards: creation, the role flip and the removal all happen on closed bars, and the colour change is a change of state, not of level. The zone is as tall as the candles it came from — with the sweep requirement active that is the origin candle and the candle that swept it combined — so on volatile instruments it can be a wide band; Min Zone Height only ever expands a zone, never shrinks one. Breaks are judged on closes alone, so a wick beyond a zone leaves its role unchanged. No profit, win-rate, or guarantee claim. Open-source under CC BY-NC-SA 4.0 — non-commercial use, attribution to ElisTools required for reuse or derivatives. TradingView (Pine v6) only.
HOW IT WORKS
The idea behind it is that the beginning of a move is only interesting if the move turned out to be decisive, and you cannot know that while it is still running. So the measurement is deliberately backward-looking: the run is the gate, the origin is the output.
- The run — over the last N bars there must be no close against the direction at all. A single lower close breaks an up-run; a single higher close breaks a down-run. This is measured on closes, not on candle bodies, so the run describes where price actually settled bar after bar.
- The volume gate — the bar that completes the run must carry at least a chosen multiple of the average volume over its own baseline period. The baseline is independent of the run length, so a long run cannot inflate its own reference level.
- The origin — from that bar the tool searches backwards for the first candle that closed against its own open: a down candle for an up-run, an up candle for a down-run. This is the candle price left from.
- The sweep requirement — an opposing candle only qualifies as an origin if its liquidity was taken by the candle immediately after it. For a support origin, the next candle's low must trade below the origin low; for a resistance origin, the next candle's high must trade above the origin high. Search Back keeps walking further back until such a candle is found. First Only tests just the first opposing candle and draws nothing if it does not qualify. Off removes the requirement entirely and uses the opposing candle alone.
- The zone — with the sweep requirement active, the zone spans the combined range of the origin candle and the candle that swept it, so the swept level sits inside the zone rather than at its edge. The zone is anchored to the origin candle and extends forward from there.
- Role tracking — a zone holds a role until a bar closes beyond it. Wicks through it change nothing. On the first close beyond, the zone switches colour and swaps role: a support that is closed through becomes resistance, a resistance that is closed through becomes support. On the second close beyond, it is removed from the chart.
An uninterrupted run of higher closes therefore produces a support zone below, at the candle the run started from — and a run of lower closes produces a resistance zone above, the same way.
- A run of N bars completes with no counter-close and with expanded volume on the final bar
- The tool searches backwards for the opposing candle that started it, keeping only one whose low or high was taken by the candle after it
- The zone is drawn from that candle, then tracked: first close through it flips the role, second close through it removes it
Original zones and flipped zones are kept in separate pools with their own capacity, so a new signal never pushes out a zone that has already flipped. Because a long run can produce several trigger bars in a row that all resolve to the same origin candle, the tool remembers the origin it last used and will not redraw the same candle.
HOW TO READ
- A zone marks where a decisive move began, with the stops below or above it already taken before it left. Price returning to that area is returning to the point it departed from.
- A grey zone is still in its original role. A blue zone has been closed through once and is now working the other way round — the level that was holding price up is now the level it is trading under, or the reverse.
- A blue zone is on its last life by design. The next close through it, now in its flipped role, removes it rather than leaving an old level on the chart forever.
- Only closes matter. A wick through a zone leaves it untouched, so a zone survives being tested and only changes when price actually settles on the other side.
- It fires rarely by design. A run with no counter-close at all, ending on expanded volume, is not a common event — on most charts you will see a handful of zones rather than a wall of them. Shorten the run length or lower the volume ratio for more, raise them for fewer and more selective ones.
- The shading carries no information: every zone is drawn at the same intensity, because the zone sits on the origin candle while the volume condition was measured on the bar that completed the run.
INPUTS
- Streak Length — how many consecutive bars must close in one direction with no counter-close.
- Volume Average Length — the baseline period the trigger bar's volume is measured against.
- Min Volume Ratio — how many times the average that volume must be. Higher gives fewer, more selective zones.
- Max Origin Lookback — how far back the search for the origin candle may run.
- Liquidity Sweep — Off, Search Back, or First Only, as described above.
- Original Support / Original Resistance — draw each side, with its own capacity for how many grey zones are kept.
- Flipped Support Max / Flipped Resistance Max — capacity for zones that have already flipped, held separately from the originals.
- ATR Length / Min Zone Height (%ATR) — if a zone is thinner than this share of ATR, it is expanded symmetrically around its midpoint. At 0 the zone keeps the exact range of the candles it came from.
- Colours / Transparency Offset — the original and flipped colours, and a single offset that shifts the tone of all zones together.
NOTES & LIMITS
A zone records where a decisive move began and whether that level has since been closed through. What you make of it at the next touch is yours, and that is exactly as it should be. The volume gate is part of the mechanism, so the tool needs a volume feed to produce anything at all — on a symbol that publishes no volume, no zones are drawn, and on forex and CFDs the volume is tick volume (the number of price updates, not contracts traded), which makes the gate read more loosely there. The zone is anchored to the origin candle in the past but is published on the close of the bar that completes the run, so on a chart you are scrolling back through, the zone was not on the screen for the bars between the two. Its price boundaries are set when it is created and never move afterwards: creation, the role flip and the removal all happen on closed bars, and the colour change is a change of state, not of level. The zone is as tall as the candles it came from — with the sweep requirement active that is the origin candle and the candle that swept it combined — so on volatile instruments it can be a wide band; Min Zone Height only ever expands a zone, never shrinks one. Breaks are judged on closes alone, so a wick beyond a zone leaves its role unchanged. No profit, win-rate, or guarantee claim. Open-source under CC BY-NC-SA 4.0 — non-commercial use, attribution to ElisTools required for reuse or derivatives. TradingView (Pine v6) only.
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
"No-hype tools for serious chart traders — no profit promises, just clean tools that show their work."
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
"No-hype tools for serious chart traders — no profit promises, just clean tools that show their work."
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน