RTH session - 3 equal parts, 130min each - HIGH /LOW /OPEN

grapetux

Member
Hey folks, I'm attempting to create custom time frames within the RTH trading day.

I run my longer term chart in blocks of 130min.. which breaks the RTH session into 3 equal parts:

Morning 930-1140 / Lunch 1140-1350 / Afternoon 1350 -1600. * * Its amazing how these levels get retested / respected * *

In order to trade this setup properly I will need to reference the open, the high and the low for each of these periods as well as the option to plot a horizontal line for the open which would extend through the individual period but not beyond. Also the ability to displace the high and low to the next period so the morning h/l plots during the lunch time, the lunch time during the afternoon, and the afternoon for the next morning session (plotting once that session is closed). FYI i keep EXT hour turned off **

One thing Im always looking for is if the lunch time or morning high/ low has been swept during the afternoon session which can help me form my bias , looking to trade in the direction of the higher time frames.. So being able to reference these periods for custom intra day scanners will be super helpful for this strategy, finding stocks that fit the mentioned criteria.

Hopefully I explained this well enough to make sense! I appreciate any help from this great community and look forward to hearing any thoughts to add or simplify these ideas. Thanks so much.
-N
 
Solution
Hey folks, I'm attempting to create custom time frames within the RTH trading day.

I run my longer term chart in blocks of 130min.. which breaks the RTH session into 3 equal parts:

Morning 930-1140 / Lunch 1140-1350 / Afternoon 1350 -1600. * * Its amazing how these levels get retested / respected * *

In order to trade this setup properly I will need to reference the open, the high and the low for each of these periods as well as the option to plot a horizontal line for the open which would extend through the individual period but not beyond. Also the ability to displace the high and low to the next period so the morning h/l plots during the lunch time, the lunch time during the afternoon, and the afternoon for the next morning...
Hey folks, I'm attempting to create custom time frames within the RTH trading day.

I run my longer term chart in blocks of 130min.. which breaks the RTH session into 3 equal parts:

Morning 930-1140 / Lunch 1140-1350 / Afternoon 1350 -1600. * * Its amazing how these levels get retested / respected * *

In order to trade this setup properly I will need to reference the open, the high and the low for each of these periods as well as the option to plot a horizontal line for the open which would extend through the individual period but not beyond. Also the ability to displace the high and low to the next period so the morning h/l plots during the lunch time, the lunch time during the afternoon, and the afternoon for the next morning session (plotting once that session is closed). FYI i keep EXT hour turned off **

One thing Im always looking for is if the lunch time or morning high/ low has been swept during the afternoon session which can help me form my bias , looking to trade in the direction of the higher time frames.. So being able to reference these periods for custom intra day scanners will be super helpful for this strategy, finding stocks that fit the mentioned criteria.

Hopefully I explained this well enough to make sense! I appreciate any help from this great community and look forward to hearing any thoughts to add or simplify these ideas. Thanks so much.
-N

maybe this will help
and set to 2:10
https://usethinkscript.com/threads/65-min-aggregationperiod.14541/#post-120199
 
Hey folks, I'm attempting to create custom time frames within the RTH trading day.

I run my longer term chart in blocks of 130min.. which breaks the RTH session into 3 equal parts:

Morning 930-1140 / Lunch 1140-1350 / Afternoon 1350 -1600. * * Its amazing how these levels get retested / respected * *

In order to trade this setup properly I will need to reference the open, the high and the low for each of these periods as well as the option to plot a horizontal line for the open which would extend through the individual period but not beyond. Also the ability to displace the high and low to the next period so the morning h/l plots during the lunch time, the lunch time during the afternoon, and the afternoon for the next morning session (plotting once that session is closed). FYI i keep EXT hour turned off **

One thing Im always looking for is if the lunch time or morning high/ low has been swept during the afternoon session which can help me form my bias , looking to trade in the direction of the higher time frames.. So being able to reference these periods for custom intra day scanners will be super helpful for this strategy, finding stocks that fit the mentioned criteria.

Hopefully I explained this well enough to make sense! I appreciate any help from this great community and look forward to hearing any thoughts to add or simplify these ideas. Thanks so much.
-N

This uses the Opening Range method to plot the Highs/Lows from the prior time range onto the next time range. The 1350-1600 range for the prior day is plotted for the 0930-1140, for example.

The open for each range is plotted just within that range.

Screenshot 2023-06-26 154126.png
Code:
#HLO_3_Ranges_Plotted_on_Next_Range

input showbubbles   = yes;
input n = -130; #Hint n: Number (+ only) of bars to move bubble to the right in the expansion area
def n1  = n + 1;

input OR1 = 0930;
input OR2 = 1140;
input OR3 = 1350;
input ORE = 1600;

def today   = if GetDay() == GetLastDay() and SecondsFromTime(OR1) >= 0
               then 1
               else 0;

def   ORA1   = if SecondsTillTime(OR2) > 0 and SecondsFromTime(OR1) >= 0
               then 1
               else if SecondsFromTime(OR1)[1] < 0 and SecondsFromTime(OR1) >= 0
               then 1 else 0;

def ORH1     = if ORH1[1] == 0 or ORA1[1] == 0 and ORA1 == 1
               then high
               else if ORA1 and high > ORH1[1]
               then high
               else ORH1[1];
def ORL1     = if ORL1[1] == 0 or ORA1[1] == 0 and ORA1 == 1
               then low
               else if ORA1 and low < ORL1[1]
               then low
               else ORL1[1];
def Op1      = if GetDay() == GetLastDay() and SecondsFromTime(OR1) == 0
               then open
               else if SecondsFromTime(OR2) >= 0
               then Double.NaN
                else Op1[1];

plot ORHi1  = if ORA1 or today < 1 or SecondsFromTime(OR3) >= 0 then Double.NaN else ORH1;
plot ORLo1  = if ORA1 or today < 1 or SecondsFromTime(OR3) >= 0 then Double.NaN else ORL1;
plot Open1  = if ORA1 then Op1 else Double.NaN;

ORHi1.SetDefaultColor(Color.GREEN);
ORHi1.SetStyle(Curve.LONG_DASH);
ORHi1.SetLineWeight(2);
ORLo1.SetDefaultColor(Color.RED);
ORLo1.SetStyle(Curve.LONG_DASH);
ORLo1.SetLineWeight(2);
Open1.SetDefaultColor(Color.CYAN);
Open1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

def   ORA2   = if SecondsTillTime(OR3) > 0 and SecondsFromTime(OR2) >= 0
               then 1
               else if SecondsFromTime(OR2)[1] < 0 and SecondsFromTime(OR2) >= 0
               then 1 else 0;

def ORH2     = if ORH2[1] == 0 or ORA2[1] == 0 and ORA2 == 1
               then high
               else if ORA2 and high > ORH2[1]
               then high
               else ORH2[1];
def ORL2     = if ORL2[1] == 0 or ORA2[1] == 0 and ORA2 == 1
               then low
               else if ORA2 and low < ORL2[1]
               then low
               else ORL2[1];
def Op2      = if GetDay() == GetLastDay() and SecondsFromTime(OR2) == 0
               then open
               else if SecondsFromTime(ORE) >= 0
               then Double.NaN
               else Op2[1];

plot ORHi2  = if ORA1 or ORA2 or today < 1 or SecondsFromTime(ORE) >= 0 then Double.NaN else ORH2;
plot ORLo2  = if ORA1 or ORA2 or today < 1 or SecondsFromTime(ORE) >= 0 then Double.NaN else ORL2;
plot Open2   = if ORA2 then Op2 else Double.NaN;

ORHi2.SetDefaultColor(Color.GREEN);
ORHi2.SetStyle(Curve.LONG_DASH);
ORHi2.SetLineWeight(2);
ORLo2.SetDefaultColor(Color.RED);
ORLo2.SetStyle(Curve.LONG_DASH);
ORLo2.SetLineWeight(2);
Open2.SetDefaultColor(Color.CYAN);
Open2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

#######
def   ORA3   = if SecondsTillTime(ORE) > 0 and SecondsFromTime(OR3) >= 0
               then 1
               else if SecondsFromTime(OR3)[1] < 0 and SecondsFromTime(OR3) >= 0
               then 1 else 0;

def ORH3     = if ORH3[1] == 0 or ORA3[1] == 0 and ORA3 == 1
               then high
               else if ORA3 and high > ORH3[1]
               then high
               else ORH3[1];
def ORL3     = if ORL3[1] == 0 or ORA3[1] == 0 and ORA3 == 1
               then low
               else if ORA3 and low < ORL3[1]
               then low
               else ORL3[1];
def Op3      = if GetDay() == GetLastDay() and SecondsFromTime(OR3) == 0
               then open
               else if SecondsFromTime(ORE) >= 0
               then Double.NaN
               else Op3[1];

plot ORhi3   = if GetDay() == GetLastDay() and ORA1 then ORH3 else Double.NaN;
plot ORLo3   = if GetDay() == GetLastDay() and ORA1 then ORL3 else Double.NaN;
plot Open3   = if GetDay() == GetLastDay() and OR3 then Op3 else Double.NaN;

ORhi3.SetDefaultColor(Color.GREEN);
ORhi3.SetStyle(Curve.LONG_DASH);
ORhi3.SetLineWeight(2);
ORLo3.SetDefaultColor(Color.RED);
ORLo3.SetStyle(Curve.LONG_DASH);
ORLo3.SetLineWeight(2);
Open3.SetDefaultColor(Color.CYAN);
Open3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

AddChartBubble(showbubbles and !IsNaN(ORHi1[n1]) and IsNaN(ORHi1[n]), ORHi1[n1], AsText(ORHi1[n1]), Color.GREEN, yes);
AddChartBubble(showbubbles and !IsNaN(ORLo1[n1]) and IsNaN(ORLo1[n]), ORLo1[n1], AsText(ORLo1[n1]), Color.RED, no);

AddChartBubble(showbubbles and !IsNaN(ORHi2[n1]) and IsNaN(ORHi2[n]), ORHi2[n1], AsText(ORHi2[n1]), Color.GREEN, yes);
AddChartBubble(showbubbles and !IsNaN(ORLo2[n1]) and IsNaN(ORLo2[n]), ORLo2[n1], AsText(ORLo2[n1]), Color.RED, no);

AddChartBubble(showbubbles and !IsNaN(ORhi3[n1]) and IsNaN(ORhi3[n]), ORhi3[n1], AsText(ORhi3[n1]), Color.GREEN, yes);
AddChartBubble(showbubbles and !IsNaN(ORLo3[n1]) and IsNaN(ORLo3[n]), ORLo3[n1], AsText(ORLo3[n1]), Color.RED, no);

AddChartBubble(showbubbles and !IsNaN(Open1[n1]) and IsNaN(Open1[n]), Open1[n1], AsText(Open1[n1]), Color.CYAN, no);
AddChartBubble(showbubbles and !IsNaN(Open2[n1]) and IsNaN(Open2[n]), Open2[n1], AsText(Open2[n1]), Color.CYAN, no);
AddChartBubble(showbubbles and !IsNaN(Open3[n1]) and IsNaN(Open3[n]), Open3[n1], AsText(Open3[n1]), Color.CYAN, no);
 
Solution

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
361 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top