PINE LIBRARY
Updated EventFilterLib

🧠 EventFilterLib – Summary & Usage
📘 Purpose
EventFilterLib helps suppress trading signals around sensitive market times, improving signal quality and reducing risk during volatile or illiquid periods.
🔢 Included Event Filters
🟥 Tier 1 – High Impact Events (3h buffer default)
--FOMC Meetings
--NFP
--CPI
--Fed Chair Speeches
--US Federal Holidays
🟧 Tier 2 – Medium Impact Events (2h buffer default)
--ADP Employment Reports
--Retail Sales
--PPI Releases
--ISM Reports
--Crude Oil Inventories
🟦 Tier 3 – Session-Based Filters (built-in)
--NY Open/Close (±30min)
--Asia–London Overlap (07:00–09:00 UTC)
--NY Lunch (17:00–18:00 UTC)
--Midnight GMT Volatility Spike (00:00–00:30 UTC)
🟨 Weekend Filter
--Full-day block on Saturday/Sunday
--Optional buffer (e.g. Friday after 3pm)
The library returns 4 Booleans, [tier1, tier2, weekend, session]. You can call the function in your script using the following snippet:
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
barTime = time
// === Inputs
weekendMode = input.bool(true, "Enable Weekend Filter")
bufferT1Before = input.int(180, "Tier 1 Buffer Before (min)")
bufferT1After = input.int(180, "Tier 1 Buffer After (min)")
bufferT2Before = input.int(120, "Tier 2 Buffer Before (min)")
bufferT2After = input.int(120, "Tier 2 Buffer After (min)")
bufferWBefore = input.int(180, "Weekend Buffer Before (min)")
bufferWAfter = input.int(180, "Weekend Buffer After (min)")
// === Call Function
[tier1, tier2, weekend, session] = EventFilterLib.isInQuietPeriod(
barTime, weekendMode, bufferT1Before, bufferT1After,
bufferWBefore, bufferWAfter, bufferT2Before, bufferT2After
)
// === Apply to Visualization or Signal Filter
bgcolor(tier1 ? color.red : na, title="Tier 1 Quiet")
bgcolor(tier2 ? color.orange : na, title="Tier 2 Quiet")
bgcolor(weekend ? color.blue : na, title="Weekend Quiet")
bgcolor(session ? color.purple : na, title="Session Quiet")
// Example Trade Block
allowTrade = not (tier1 or tier2 or weekend or session)
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
/Novo Algo Team
📘 Purpose
EventFilterLib helps suppress trading signals around sensitive market times, improving signal quality and reducing risk during volatile or illiquid periods.
🔢 Included Event Filters
🟥 Tier 1 – High Impact Events (3h buffer default)
--FOMC Meetings
--NFP
--CPI
--Fed Chair Speeches
--US Federal Holidays
🟧 Tier 2 – Medium Impact Events (2h buffer default)
--ADP Employment Reports
--Retail Sales
--PPI Releases
--ISM Reports
--Crude Oil Inventories
🟦 Tier 3 – Session-Based Filters (built-in)
--NY Open/Close (±30min)
--Asia–London Overlap (07:00–09:00 UTC)
--NY Lunch (17:00–18:00 UTC)
--Midnight GMT Volatility Spike (00:00–00:30 UTC)
🟨 Weekend Filter
--Full-day block on Saturday/Sunday
--Optional buffer (e.g. Friday after 3pm)
The library returns 4 Booleans, [tier1, tier2, weekend, session]. You can call the function in your script using the following snippet:
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
barTime = time
// === Inputs
weekendMode = input.bool(true, "Enable Weekend Filter")
bufferT1Before = input.int(180, "Tier 1 Buffer Before (min)")
bufferT1After = input.int(180, "Tier 1 Buffer After (min)")
bufferT2Before = input.int(120, "Tier 2 Buffer Before (min)")
bufferT2After = input.int(120, "Tier 2 Buffer After (min)")
bufferWBefore = input.int(180, "Weekend Buffer Before (min)")
bufferWAfter = input.int(180, "Weekend Buffer After (min)")
// === Call Function
[tier1, tier2, weekend, session] = EventFilterLib.isInQuietPeriod(
barTime, weekendMode, bufferT1Before, bufferT1After,
bufferWBefore, bufferWAfter, bufferT2Before, bufferT2After
)
// === Apply to Visualization or Signal Filter
bgcolor(tier1 ? color.red : na, title="Tier 1 Quiet")
bgcolor(tier2 ? color.orange : na, title="Tier 2 Quiet")
bgcolor(weekend ? color.blue : na, title="Weekend Quiet")
bgcolor(session ? color.purple : na, title="Session Quiet")
// Example Trade Block
allowTrade = not (tier1 or tier2 or weekend or session)
//////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
/Novo Algo Team
Release Notes
v2Release Notes
v3Pine library
In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in publications is governed by 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.
Pine library
In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in publications is governed by 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.