OPEN-SOURCE SCRIPT

Dynamic Rollover & Spread Window

278
Dynamic Rollover & High Spread Zones
If you trade across different asset classes, you know that daily rollovers, CFD maintenance breaks, and weekly opens carry massive spread widening and low liquidity. Getting caught in a trade during these windows often leads to unnecessary slippage or getting stopped out by the spread alone.
This indicator automatically highlights these high-risk liquidity gaps directly on your chart. Instead of manually drawing time boxes or switching indicator settings every time you change tickers, the script reads what you are trading and adapts instantly.
The Hidden Cost of High Spreads
The spread is the difference between the Bid (sell) price and the Ask (buy) price. During rollover windows and market opens, institutional liquidity dries up. To protect themselves, brokers widen this spread dramatically—sometimes inflating a standard 1-pip spread to 15 or 20 pips.

This impacts your trading in two fatal ways:
Bad Entries: If you execute a market order during a high-spread window, you are forced to pay that inflated premium. You instantly start the trade in a much deeper drawdown, meaning the market has to move significantly further in your direction just for you to break even.
Phantom Stop-Outs: Stop-loss orders are triggered by the Bid or Ask price, not necessarily the mid-price you see on the chart. If the spread widens enough, it can tag your stop-loss even if the actual market price hasn't moved.

A Simple Example: Imagine you are in a short position on EUR/USD. The current price on the chart is 1.1000, and your stop-loss is placed 10 pips above at 1.1010. Normally, the spread is 1 pip.

At 17:00 NY time (rollover), the broker widens the spread to 15 pips. Even though the chart price remains exactly at 1.1000, the Ask price instantly jumps to 1.1015. Your stop-loss is triggered, closing you out for a loss. Five minutes later, the spread returns to normal, and EUR/USD drops 50 pips in your favor—but you are already out of the trade.

Key Features:
Dynamic Asset Detection: The script automatically detects if you are viewing a Forex pair, an Index (futures or CFD), or a Commodity. It then applies the correct low-liquidity window for that specific market.
Daily Rollovers vs. Weekly Opens: Daily maintenance windows (Monday–Friday) are highlighted in one color, while the notoriously thin Sunday Weekly Opens are isolated and highlighted in another.
Timezone Proof: All session times are anchored strictly to the "America/New_York" timezone (EST/EDT). This ensures the windows remain 100% accurate year-round, completely bypassing local Daylight Saving Time shifts.
Built for Edge Cases: The detection engine accurately categorizes generically labeled CFD tickers (like NAS100, US30, XAUUSD) and standard CME Futures (ES, NQ, CL).

Default Time Windows (NY Time):
Forex: 17:00–18:00 (Daily) | 17:00–19:00 (Sunday Open)
Indices: 16:00–18:00 (Daily) | 18:00–19:00 (Sunday Open)
Commodities: 17:00–18:00 (Daily) | 18:00–19:00 (Sunday Open)

Customization:
All session times and highlight colors are fully customizable in the indicator inputs to match your specific broker's server times if they differ from the standard exchange breaks.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.