OPEN-SOURCE SCRIPT

Overnight Session State

767
Overnight Session State [OVN]
Overnight drift is a well-known concept in equities and index futures. This indicator asks a narrower question. Does that drift depend on where price sat relative to the moving averages when the session began?

"If the close prints above the 1H EMA stack, does the night behave differently than if it prints below? Is a night that starts inside the stack a coin flip, or something else?"

That is the whole question this tool was built to answer. It reads where price sits against the EMA stack (20/50/100) at the 16:00 ET close, labels the night above, below or mixed, and draws what happened. The panel then keeps score for each label: average drift, win rate and average range.

🔶 USAGE
Load the indicator on a 1H chart. It was built and tested on index futures (MNQ, MES, NQ, ES), but it runs on anything with an overnight session — set the entry and exit hours to suit the market you're on.
Each overnight session is one shaded box, from the 16:00 ET entry bar to the 07:00 ET exit bar. The box height is the session high to low. The colour is the outcome: green if the 07:00 close finished above the 16:00 entry, red if below.
Inside each box, the solid line is the entry price and the dashed line is the exit price. The gap between them is the overnight drift.
The glyph on the top edge of each box is the state the night started in:
▲ ABOVE — price above all three EMAs at entry
▼ BELOW — price below all three EMAs at entry
• MIXED — price inside the stack at entry
Look at the ▼ nights and see if they look different from the ▲ nights. Then check the panel to see if you notice any trends.
The panel shows which state the current session is in, then a row for above, below and mixed with the number of nights, average drift in bp, win rate and average range in bp across the chart's loaded history. The last bar's time is written at the bottom so you know the numbers are current.

🔶 DETAILS
The state is set once, on the 16:00 bar, using the EMA values from the bar before. It doesn't change after that. The box colour updates as the night goes on and locks in at 07:00. Nothing repaints.
Drift is measured from the 16:00 open to the 07:00 close. Range is the high to low of the whole session. Both are in basis points (1 bp = 0.01%) so the numbers compare across contracts at different price levels.
Nights with no 07:00 bar within 16 hours (holidays, data gaps) are skipped. Sunday's entry is 18:00 ET. Session times are worked out in the session timezone, not the chart's, so the numbers don't change if you switch chart timezones, but the boxes will only line up with the time axis if the chart is set to New York.

🔶 SETTINGS
EMA Stack
EMA 1 / EMA 2 / EMA 3 — the three averages that set the state (20 / 50 / 100)
Show EMA stack — draw the three lines on the chart
EMA colours follow chart theme — lines pick a neutral colour to suit light or dark charts; untick to set your own
EMA 1 / 2 / 3 colour — used when the theme option is off

Session
Session timezone — America/New_York by default; the session hours below are read in this zone
Entry hour Mon–Thu — 16
Entry hour Sunday — 18
Exit bar hour — 7
Drop segment if no exit within (h) — nights with no exit bar inside this window are skipped

Style
Night paid — box and line colour when the exit closes above entry
Night lost — colour when it closes below
Box transparency — 80 by default
Show state glyph — the ▲ ▼ • marker on each box

Panel
Show panel
Corner — move the stats table if it overlaps something

🔶 SUMMARY
Most charts don't give you a clean look at the overnight session. This one does. Each night is labelled by where it started against the averages, boxed by what it did, and counted in the panel so you can see how each group has behaved over the history you've got loaded. What you make of it is up to you. Some people will see a pattern, some won't.
It's not a buy signal and it doesn't include commission or slippage. It's just a way to see how price moved during the overnight session.


Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.