First, the credit for the original script to plot a High and Low between a certain time goes to developer paaax.
I took that idea, converted it to Pinescript V5, cleaned up the code, and added a few more lines so you can plot different levels based on time of day.
Published open source like the original.
The example shown has:
Blue - plotting from the start of...
Shows pre-market highs and lows on RTH or ETH chart
-Pre-market duration user input (default is 16 'bar hours'; covering the time from S&P RTH close at 4pm >> 9:30am RTH open next day
-Displays on both RTH and ETH charts
-Written for ES (ES1! or e.g ESM2023), but tested and working on SPY, SPX
-Works across timeframes
Example usage on Electronic trading hours...
This is a 1 trade per day strategy for trading SPY or QQQ index. By default, this is designed for 1 min time frame. This was an experimental script that seems to be profitable at the time of publication.
How it works:
Pre-market high and low is defined per trading day between 9:00 to 9:30 EST.
Then we looking for the first breakout on either PM high or PM...
This indicator draws the Pre-Market Low and High for futures. Futures do not really have "P.M" because they are almost always open, but I chart /ES and trade $SPY options, so this has been useful in finding P.M levels.
Credit to original code goes to paaax and NSDT. Modified to include premarket H/L levels and to show only daily levels. Indicator includes Close levels.
-US Premarket High and Low Levels
-Daily OHL Levels (No close included)
-Yesterday and Previous day OHLC level
-Labels and ability to modify user preferences (color, line)