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
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.