pbghosh

15M 2PM-3PM High/Low

pbghosh Updated   
This script will draw horizontal lines based on the high and low values between 2PM and 3PM (inclusive 2PM & 3PM) on 15 minute time frame. This indicator can be used in 15 minute time frame to plot the high and low lines correctly. This indicator can be used for previous day 2PM-3PM range breakout or breakdown trades.
Release Notes:
This script will draw horizontal lines based on the high and low values between 2PM and 3PM (inclusive 2PM & 3PM) on 15 minute time frame. This indicator can be used in 15 minute time frame to plot the high and low lines correctly. This indicator can be used for previous day 2PM-3PM range breakout or breakdown trades.
Release Notes:
The earlier version was showing incorrect high and low values with regard to previous day 15 minutes 2PM to 3PM time period during real time trading session. I have corrected the flaws encountered in the earlier version and now, you can use this script to plot the range during real time and after market session as well. By default, this script will calculate the high and low values based on NSE India and BSE India exchange timeframe period. If you want to work according to your exchange timeframe, you need to change the time range in the following code of my script:

time(timeframe.period, "0915-1530")

You may need to change the value of dayofweek.saturday and dayofweek.sunday in the following code as well because I have found different values with regards to exchanges:

if (x == 1 and dayofweek != 5 and dayofweek != 6)
Release Notes:
I have encountered a simple logical error in my previous version which I have corrected now.
Release Notes:
The lines were not plotting due to a logical error in the study statement, which is now corrected.
Release Notes:
The Pinescript named constants dayofweek.saturday and dayofweek.sunday were not working properly earlier and as a result I used literals. Now, the named constants are working perfectly well now and therefore, I have replaced the literals with the named constants in this version.

This version will also plot the previous day 2PM-3PM high and low for each day.
Release Notes:
In this version I have added resistance and support lines, price levels at the right side and changed the appearance of the horizontal lines.
Release Notes:
In this version, I have corrected the logic behind the calculation of 2PM-3PM high and low value and changed the line.new() function to plot() function.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?