OPEN-SOURCE SCRIPT
clirings

//version=5
indicator("Range Marker [Moscow Exchange]", overlay=true)
// Функция для проверки времени на вхождение в диапазон с 23:50 до 10:00 (ночной клиринг)
isNightTime = (hour >= 23 and minute >= 50) or (hour < 9)
// Функция для проверки времени на вхождение в диапазон с 18:50 до 19:05 (вечерний клиринг)
isEveningClearing = (hour == 18 and minute >= 50) or (hour == 19 and minute <= 5)
// Функция для проверки времени на вхождение в диапазона с 14:00 до 14:05 (дневной клиринг)
isDayClearing = (hour == 14 and minute <= 5)
// Фоновый цвет для ночного времени (23:50–09:00)
bgcolor(isNightTime ? color.new(color.blue, 80) : na, title="Night Session")
// Фоновый цвет для вечернего клиринга (18:50–19:05)
bgcolor(isEveningClearing ? color.new(color.red, 80) : na, title="Evening Clearing")
// Фоновый цвет для дневного клиринга (14:00–14:05)
bgcolor(isDayClearing ? color.new(color.orange, 80) : na, title="Day Clearing")
indicator("Range Marker [Moscow Exchange]", overlay=true)
// Функция для проверки времени на вхождение в диапазон с 23:50 до 10:00 (ночной клиринг)
isNightTime = (hour >= 23 and minute >= 50) or (hour < 9)
// Функция для проверки времени на вхождение в диапазон с 18:50 до 19:05 (вечерний клиринг)
isEveningClearing = (hour == 18 and minute >= 50) or (hour == 19 and minute <= 5)
// Функция для проверки времени на вхождение в диапазона с 14:00 до 14:05 (дневной клиринг)
isDayClearing = (hour == 14 and minute <= 5)
// Фоновый цвет для ночного времени (23:50–09:00)
bgcolor(isNightTime ? color.new(color.blue, 80) : na, title="Night Session")
// Фоновый цвет для вечернего клиринга (18:50–19:05)
bgcolor(isEveningClearing ? color.new(color.red, 80) : na, title="Evening Clearing")
// Фоновый цвет для дневного клиринга (14:00–14:05)
bgcolor(isDayClearing ? color.new(color.orange, 80) : na, title="Day Clearing")
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.