Session High and Session Low

I have heard many people ask for a script that will identify the high and low of a specific session. So, I made one.

Important Note: This indicator has to be set up properly or you will get an error. Important things to note are the length of the range and the session definition. The idea is that you would set it up for what's relevant to your trading. Going too far back in the chart history will cause errors. Setting the session for a time that is not on the chart can cause errors. If you set it to look farther back than there are bars to display, you may get an error. What I've found is that if you get an error, you just need to change the settings to reflect available data and it will be able to compile the script. At the time of its publishing, the default range start is set to 10/ 01 /2020. If you're looking at this years later, you'll probably have to set the range to something more recent.

Plot or Lines:
Using Plot (displayed), the indicator will track the high/low from the end of the session into the next session. Then at the start of the next session, it will start tracking the high/low of that session until its end, then track that high/low until the start of the next session then reset.
Using lines, it will extend horizontal lines to the right indefinitely. The number of sessions back that the lines apply to is a user-defined number of sessions. There are limits to the number of lines that can be cast on a chart (roughly 40-50). So, the maximum number of sessions you can apply the lines to is the last 21 sessions (42 lines total). That gets really noisy though so I can't imagine that is a limiting factor.

You can change the background color and its transparency, as well as turn the background color on or off.
You can change the highs and lows colors
You can adjust the line width to your preference

Session Length:
You can use a continuous session covering any user-defined period (provided its not tooooo many candles back)
You can define the session length for intraday
You can exclude weekends

Display Options:
You can adjust the colors, transparency, and linewidth
You can display the plotline or horizontal lines
You can show/hide the background color.
You can change how many sessions back the horizontal lines will track

Let me know if there's anything this script is missing or if you run into any issues that I might be able to help resolve.

Here's what it looks like with Lines for the last 5 sessions and different background color.

Note di rilascio: Cleaned up some empty lines in the code
Rimuovi dagli script preferiti Aggiungi agli indicatori preferiti


Thank you very much!
But I am not able to configure the sessions. It happens to me as another one says, it's all in one session. For example, if I want to mark the h/l of every Monday, how should I configure the script?
+1 Rispondi
kurtsmock Che_Trader
@Che_Trader, This is designed to follow intra-day sessions. Setting up a script to track days of the week requires a completely different set of code or a pretty reasonable expansion of this set.
Now you can track since "Last Monday." To do this just set the range date to mondays date and don't check the "include sessions" checkbox. Then it will track the high and low since monday
Che_Trader kurtsmock
@kurtsmock, Got it! Thaks for the fast response, good job!
+1 Rispondi
Sorry this script is so confusing for people. It seemed straightforward to me. I'm happy to help with questions.

Hi kurt,

this is very helpful!

is there a way to get the lows to be displayed for each session

kurtsmock Omaarrfx
@Omaarrfx, The session is the red area. The way you have it set up the whole red area is set as 1 session. You need to adjust the settings to select the session start/end time. Look at images below to see what I mean.
kurtsmock Omaarrfx
@Omaarrfx, Check your TV dms
Will this work on any asset? I tried it for Forex and kept getting "n/a n/a". Any sugestions?
kurtsmock Cgreen32274
@Cgreen32274, Let me look into it. It's likely a settings issue. If you have a specific pair you're looking at then let me know and I can check it out specifically, but I look into it in general and maybe update code if necessary or at least update the script with recommendations.
kurtsmock Cgreen32274
@Cgreen32274, Seems to work ok for me

Home Screener azioni Screener forex Screener cripto Calendario economico Come funziona Caratteristiche Grafico Costi Invita un amico Regolamento Centro di supporto Soluzioni per broker & siti web Widget Librerie grafiche Libreria grafica leggera Blog & Novità Twitter
Profilo Impostazioni profilo Account e fatturazione Amici invitati Coin I miei ticket di supporto Centro di supporto Idee pubblicate Follower Seguiti Messaggi Privati Chat Esci