OPEN-SOURCE SCRIPT

[Snowite] Avg Bars to Repeat X% Gain (Short/Long)

159
This script flags any candle that closes at least X% above its open (e.g. open 10, close 10.30 = +3%). Each time this happens, it measures how many bars passed since the last time it happened, then averages all those gaps over the last N bars — shown in a table on the top-right of the chart.
2 adjustable settings:

X% Threshold – how big the up-move needs to be to count
Lookback (bars) – how far back to look when calculating the average

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

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