PROTECTED SOURCE SCRIPT
Mark 4H Candle Span

This TradingView indicator, called "Mark 4H Candle Span", serves to **visually highlight alternating 4-hour time blocks** directly on the price chart.It does this by coloring the background of the chart for one 4-hour period and leaving the next 4-hour period uncolored, creating a pattern of vertical stripes.---### How It WorksThe code operates in two main steps:1. **Calculation of the 4-Hour Block**:The line `session_id = math.floor(time("1") / (1000 * 60 * 60 * 4))` calculates a unique identification (ID) number for each 4-hour block.* `time("1")`: Gets the current time (in milliseconds).* `(1000 * 60 * 60 * 4)`: Is the total number of milliseconds in 4 hours.* By dividing the time by the 4-hour interval and rounding down with `math.floor`, the script assigns the same `session_id` to all the candles within the same 4-hour block.2. **Background Coloring**:The line `bgcolor(session_id % 2 == 0 ? color.new(color.blue, 85) : na)` decides whether to color the background.
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmaktadır. Ancak, özgürce ve herhangi bir sınırlama olmaksızın kullanabilirsiniz – daha fazla bilgi burada.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Korumalı komut dosyası
Bu komut dosyası kapalı kaynak olarak yayınlanmaktadır. Ancak, özgürce ve herhangi bir sınırlama olmaksızın kullanabilirsiniz – daha fazla bilgi burada.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.