OPEN-SOURCE SCRIPT
Trade Session Tracker [theUltimator5]

Trade Session Tracker is a unique indicator designed to isolate each discrete trading session on the US stock exchanges and display a cumulative running price for each session so you can visualize how each session performs over long periods of time.
This indicator allows you to unlock a potentially unique and powerful trading strategy that exploits returns during lower liquidity periods through trend analysis. Certain stocks tend to move in the same direction during specific windows in the day, and now you can find them yourself.
This indicator only works properly on the daily timeframe. Other timeframes are not supported.
The sessions that this indicator supports are:
There are two plot modes:
!IMPORTANT!
How it works:
Standard chart data only calculates sessions through open, close, and previous close and cannot isolate out pre-market and after hours price action.
With the addition of overnight data, we now have a separate set of open and close values which can be pulled.
To calculate after hours price action, we use the opening price of the overnight venue divided by the close price earlier that day.
To calculate the pre-market price action, we divide the open price by the previous overnight close price.
Overnight price is simply calculated by overnight close divided by overnight open.
There is a table that can be toggled off and repositioned that shows the current settings.
Here is an example of close-to-open and intraday

Here is an example of overnight returns

This indicator allows you to unlock a potentially unique and powerful trading strategy that exploits returns during lower liquidity periods through trend analysis. Certain stocks tend to move in the same direction during specific windows in the day, and now you can find them yourself.
This indicator only works properly on the daily timeframe. Other timeframes are not supported.
The sessions that this indicator supports are:
- Intraday (Market open to market close)
- After Hours (Market close until 20:00 eastern)
- Overnight (20:00 eastern through 04:00 eastern the next day)
- Pre-market (04:00 eastern through market open)
- Close-to-open (market close to the following market open)
There are two plot modes:
- Cumulative — chained returns since chart start (synthetic continuous price line)
- Daily Change — single-session return (refreshes each new trading day)
!IMPORTANT!
- This indicator only supports symbols that trade on the overnight markets through the BOATS ATS. This includes hundreds of ticker symbols, but the majority of smaller cap stocks or non-equity symbols are not supported.
- Some symbols offer dividends, and the "ADJ" button at the bottom right corner of the chart must be disabled for the data to display properly, or else you will get extremely skewed results. Notorious symbols for this are SPY and AAPL.
How it works:
Standard chart data only calculates sessions through open, close, and previous close and cannot isolate out pre-market and after hours price action.
With the addition of overnight data, we now have a separate set of open and close values which can be pulled.
To calculate after hours price action, we use the opening price of the overnight venue divided by the close price earlier that day.
To calculate the pre-market price action, we divide the open price by the previous overnight close price.
Overnight price is simply calculated by overnight close divided by overnight open.
There is a table that can be toggled off and repositioned that shows the current settings.
Here is an example of close-to-open and intraday
Here is an example of overnight returns
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.