OPEN-SOURCE SCRIPT
Renko Reversal Blocks & Alerts

Detects Renko reversals — the first opposing brick after a directional run — draws the reversal brick's wick as a persistent zone, and fires an alert the moment the brick prints.
Why this exists
Renko charts filter noise well but offer no native reversal alert. TradingView's built-in alert types cover price and crossing conditions, not brick direction. This script adds that, and adds two things a raw direction flip does not give you: a run-length filter so single-brick alternations are ignored, and separate treatment of the reversal brick's wick, which is where the invalidation level actually sits.
Method
Brick direction is taken from body sign. The script counts consecutive same-direction bricks and signals only when the preceding run met a minimum length. The reversal brick's wick is measured independently of its body, and flips whose wick exceeds a chosen fraction of a box can be filtered out as low-quality reversals — a wide wick means a far invalidation for the same signal.
The wick region of the reversal brick is drawn as a block extending right. Blocks persist until a later brick closes through them, then freeze at that bar and dim rather than disappearing, leaving invalidated levels visible as history.
Box size is auto-detected. Because every brick body on a fixed-box Renko chart equals exactly one box, the script reads the size from the first brick, so the setting cannot desynchronise from the chart when switching between box sizes. The same measurement doubles as a chart validation: inconsistent brick bodies indicate an ATR Renko chart, which repaints, and a warning is displayed.
Inputs
Minimum bricks in prior run · maximum reversal wick, expressed in boxes so it scales across chart settings · box size (auto-detect, presets, or custom) · block extent, wick only or full brick · live blocks retained per side · alert on brick print or brick close · triangle size and colour · optional invalidation price label with tick buffer.
Use
Apply to a Traditional Renko chart with wicks enabled. Create the alert on the indicator using "Any alert() function call" set to Once Per Bar; this is what produces a print-time alert rather than one delayed by a further box. The message carries direction, wick size, prior run length, and the invalidation price.
Limitations
A Renko reversal necessarily arrives after price has travelled two boxes from the extreme. That lag is inherent to the chart type and is the cost of its noise filtering, not a shortcoming of this script. A brick's body is fixed at print, but its high and low can extend while it remains the rightmost bar, so an invalidation price delivered at print may widen before the brick completes; the "Brick close" option removes this at the cost of another box of delay. ATR-based Renko is not supported.
This marks a structural event. It is not a strategy, incorporates no trend or higher-timeframe context, and produces no performance statistics.
Why this exists
Renko charts filter noise well but offer no native reversal alert. TradingView's built-in alert types cover price and crossing conditions, not brick direction. This script adds that, and adds two things a raw direction flip does not give you: a run-length filter so single-brick alternations are ignored, and separate treatment of the reversal brick's wick, which is where the invalidation level actually sits.
Method
Brick direction is taken from body sign. The script counts consecutive same-direction bricks and signals only when the preceding run met a minimum length. The reversal brick's wick is measured independently of its body, and flips whose wick exceeds a chosen fraction of a box can be filtered out as low-quality reversals — a wide wick means a far invalidation for the same signal.
The wick region of the reversal brick is drawn as a block extending right. Blocks persist until a later brick closes through them, then freeze at that bar and dim rather than disappearing, leaving invalidated levels visible as history.
Box size is auto-detected. Because every brick body on a fixed-box Renko chart equals exactly one box, the script reads the size from the first brick, so the setting cannot desynchronise from the chart when switching between box sizes. The same measurement doubles as a chart validation: inconsistent brick bodies indicate an ATR Renko chart, which repaints, and a warning is displayed.
Inputs
Minimum bricks in prior run · maximum reversal wick, expressed in boxes so it scales across chart settings · box size (auto-detect, presets, or custom) · block extent, wick only or full brick · live blocks retained per side · alert on brick print or brick close · triangle size and colour · optional invalidation price label with tick buffer.
Use
Apply to a Traditional Renko chart with wicks enabled. Create the alert on the indicator using "Any alert() function call" set to Once Per Bar; this is what produces a print-time alert rather than one delayed by a further box. The message carries direction, wick size, prior run length, and the invalidation price.
Limitations
A Renko reversal necessarily arrives after price has travelled two boxes from the extreme. That lag is inherent to the chart type and is the cost of its noise filtering, not a shortcoming of this script. A brick's body is fixed at print, but its high and low can extend while it remains the rightmost bar, so an invalidation price delivered at print may widen before the brick completes; the "Brick close" option removes this at the cost of another box of delay. ATR-based Renko is not supported.
This marks a structural event. It is not a strategy, incorporates no trend or higher-timeframe context, and produces no performance statistics.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
Hermetic Trader · "What gets measured gets managed."
hermetictrader.com
hermetictrader.com
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
Hermetic Trader · "What gets measured gets managed."
hermetictrader.com
hermetictrader.com
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.