OPEN-SOURCE SCRIPT

EMA Extension Pulse [AlgoNorth]

1 018
EMA Extension Pulse

Every trader faces the same moment: price is far from its average and you have to decide what that means. Chase it, fade it, or leave it alone. Most tools answer with one number, "how far", and treat every stretch the same. But a move that walked out in a straight line and a move that lurched out through chop are not the same event. Does that difference matter on the chart you trade? That is what this script measures.

EMA Extension Pulse shows both at once. Column height is how far price has stretched from its 20 EMA in ATR; column brightness is how cleanly it got there. When a stretch reaches the gold guide in a straight line, a gold dot marks it on the pane and on the price chart, once per move. Then a live panel keeps score: how often clean and messy stretches kept going on the exact chart you are looking at. No borrowed rules of thumb, no guessing, just your own symbol and timeframe showing you how its stretches have played out.

🔶 USAGE

🔸 Watch the columns. Height is the stretch from the EMA in ATR: above zero is above the mean, below zero is below it. Brightness is efficiency, so a bright column is a move travelling in a straight line and a faint one is a move grinding through chop.

🔸 Follow the white line. It is a smoothed read of the stretch, drawn through the columns, so the rhythm of each push and pullback is easy to see.

🔸 Check the gold guides. The dashed lines sit at ±2 ATR, labelled on the scale. A move whose column crosses one is a stretch.

🔸 Look for the gold dots. A dot marks a stretch that reached the guide cleanly, once per move, on both the pane and the price chart. A dashed stem joins each price dot to its candle.

🔸 Read the panel. It shows the stretch and efficiency right now, then how often clean and messy stretches kept going 10 bars later on this chart, with the median move, average move and count for each.

🔸 Alerts: clean stretch up, clean stretch down.

🔶 DETAILS

🔸 Stretch. (close − EMA 20) ÷ ATR 14. Measuring in ATR makes the columns read the same on any symbol or timeframe.

🔸 Efficiency. Net price travel ÷ total price travel over the last 14 bars, the efficiency ratio introduced by Perry Kaufman. 1.0 is a straight line; values near 0 are chop.

🔸 One stretch per move. A stretch is recorded on the first bar that closes beyond the ±2 ATR guide. The next one can only start once stretch has come back inside ±1 ATR, so one long push, or a small dip near the guide, is counted once.

🔸 Grading. A stretch is graded clean when efficiency reaches 0.50 on the crossing bar or either of the next two bars while price is still beyond the guide. The gold dot goes on the first bar that qualifies. Otherwise the stretch is graded messy and carries no dot.

🔸 Measurement. Clean and messy stretches are both measured from the bar that first reached the guide and checked 10 bars later: did price keep going in the stretch direction, and by how many ATR. Both groups share the same starting point, so the two panel rows compare like with like.

🔸 Colours. The palette follows your chart theme automatically, with a dark set and a light set.

🔶 SETTINGS

🔸 Extension: Mean length (EMA), ATR length, Efficiency lookback, Messiest column transparency, Line smoothing. The first three set the measurements. Messiest column transparency is how faint a column tip gets at zero efficiency; tips at or above the clean threshold are always fully bright.

🔸 Clean stretches: Stretch guide (ATR), Reset below (ATR), Clean when efficiency is at least, Clean check window (bars), Measure after (bars). The guide is the distance a move must reach; Reset below is how far back toward the mean it must return before a new move can be counted; the threshold and window set the grading, and the threshold is also the efficiency at which column tips reach full brightness; Measure after is how many bars later each stretch is checked.

🔸 Marks: Mark clean stretches, Dot gap beyond the column tip, Mark clean stretches on price, Price dot distance (× ATR). Switch each dot on or off and set how far it sits from the column tip or the candle.

🔸 Panel: Show panel, Panel position. Four positions, for when more than one copy is loaded.

🔸 Colours: above, below and clean-stretch marks, one set for dark charts and one for light. The script picks the set from your chart theme.

🔶 NOTES

🔸 Every dot, alert and panel count is set when its bar closes and never changes afterwards. A dot lands on the crossing bar, or up to two bars later when the clean check window is in use.

🔸 The panel is learned from the history loaded on your chart, so each symbol and timeframe builds its own reading, and the more history you load, the steadier it gets.

🔸 The panel's date row is shown in exchange time, named in the row, which can differ from your chart's display timezone.

🔸 On very long histories the most recent 500 price-chart stems are kept; every dot stays on the chart.

🔸 Built for standard candle and bar charts. Renko, Kagi and Point & Figure charts can rebuild past bars, which changes the stretch history behind the counts.

🔶 SUMMARY

Price is far from its average, and you have to decide what that means. EMA Extension Pulse shows you two things at once: how far price has stretched from its 20 EMA, and how cleanly it got there. Clean stretches are marked with a gold dot, once per move, and a live panel keeps score of what clean and messy stretches did next on the chart you are looking at. Not a rule of thumb: your own symbol and timeframe, showing you how its stretches have played out.

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

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