How to record RTH and ETH for every single day?

Hi guys,

May I politely check if it is possible to record every single day for the regular trading hour (RTH) 's high, low and range and extended trading hour (ETH) 's high, low and range based on the below image?

For example, we can refer every single day RTH and ETH 's data for the past thirty (30) days or more. Thought that there might be other alternatives beside using the bubble charts.

As below the script which can only record label for one (1) day.

Much appreciated if anyone can share your advises.



Code:
# Reg and after Market High Low Level
input afterMarket_Open = 1600; #EST
input afterMarket_Close = 0929; #EST
input afterMarket_Label = yes;
input afterMarket_Cloud = no;
input afterMarket_Line = yes;
input regMarket_Line = yes;
input regMarket_Label = yes;
Input marketOpen = 0930;
Input marketClose = 1559;

def afterMarketOpen = If(SecondsFromTime(afterMarket_Open) >= 0 or SecondsTillTime(afterMarket_Close) >= 0, 1, 0);
def afterMarketReset = if afterMarketOpen and !afterMarketOpen[1] then 1 else 0;
def afterMarketHigh = CompoundValue(1, If((high > afterMarketHigh[1] and afterMarketOpen) or afterMarketReset, high, afterMarketHigh[1]), high);
def afterMarketLow = CompoundValue(1, If((low < afterMarketLow[1] and afterMarketOpen) or afterMarketReset, low, afterMarketLow[1]), low);

def TradingDayStart= SecondsFromTime(marketOpen);
def TradingDayEnd = SecondsTillTime(marketClose);
def DayTrading = tradingDayStart >= 0 and tradingDayEnd >= 0;
def tradingMarketTimeRange = tradingDayStart >= 0 and tradingDayEnd >= 0;
def tradingMarket = tradingMarketTimeRange and !tradingMarketTimeRange[1];
def trading_Market_High = compoundValue(1, if((high > trading_Market_High[1] and tradingMarketTimeRange) or tradingMarket, high, trading_Market_High[1]), high);
def trading_Market_Low = compoundValue(1, if((low < trading_Market_Low[1] and tradingMarketTImeRange) or tradingMarket, low, trading_Market_Low[1]), low);

def regMarket_High = if regMarket_Line then trading_Market_High else Double.NaN ;
#regMarket_High.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#regMarket_High.SetDefaultColor(Color.CYAN);
#regMarket_High.SetLineWeight(2);
def regMarket_low = if regMarket_Line then trading_Market_Low else Double.NaN ;
#regMarket_Low.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#regMarket_Low.SetDefaultColor(Color.CYAN);
#regMarket_Low.SetLineWeight(2);

AddLabel(if regMarket_Label  then 1 else 0, "RTH High " + "$ " + Round(regMarket_High, 2) + " ", Color.light_green);
AddLabel(if regMarket_Label  then 1 else 0, "RTH Low " + "$ " + Round(regMarket_Low , 2) + " ", Color.light_red);
AddLabel(if regMarket_Label  then 1 else 0, "" + AsPercent((regMarket_high - regMarket_Low)/regMarket_high) + " ", Color.gray);
AddLabel(if regMarket_Label  then 1 else 0, "RTH Range " + "$ " + Round(regMarket_high - regMarket_Low , 2) + " ", Color.Yellow);


plot afterMarket_High = if afterMarket_Line then afterMarketHigh else Double.NaN ;
#afterMarket_high.SetStyle(curve.SHORT_DASH);
afterMarket_high.SetStyle(Curve.MEDIUM_DASH);
#afterMarket_High.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
afterMarket_High.SetDefaultColor(Color.CYAN);
afterMarket_High.SetLineWeight(2);
plot afterMarket_Low = if afterMarket_Line then  afterMarketLow else Double.NaN  ;
#afterMarket_Low.SetStyle(curve.SHORT_DASH);
afterMarket_Low.SetStyle(Curve.MEDIUM_DASH);
#afterMarket_Low.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
afterMarket_Low.SetDefaultColor(Color.ORANGE);
afterMarket_Low.SetLineWeight(2);
#AddLabel(if afterMarket_Label  then 1 else 0, "   ", color.black);
AddLabel(if afterMarket_Label  then 1 else 0, "ETH High " + "$ " + Round(afterMarket_High, 2) + " ", Color.cyan);
AddLabel(if afterMarket_Label  then 1 else 0, "ETH Low " + "$ " + Round(afterMarket_Low , 2) + " ", Color.ORANGE);
AddLabel(if afterMarket_Label  then 1 else 0, "" + AsPercent((afterMarket_high - afterMarket_Low)/afterMarket_high) + " ", Color.gray);
AddLabel(if afterMarket_Label  then 1 else 0, "ETH Range " + "$ " + Round(afterMarket_high - afterMarket_Low , 2) + " ", Color.Yellow);

AddCloud(if afterMarket_Cloud  then afterMarket_High  else Double.NaN, if afterMarket_Cloud  then afterMarket_Low  else Double.NaN, Color.LIGHT_GRAY, Color.LIGHT_GRAY);
########################################################################
 
Hi guys,

May I politely check if it is possible to record every single day for the regular trading hour (RTH) 's high, low and range and extended trading hour (ETH) 's high, low and range based on the below image?

For example, we can refer every single day RTH and ETH 's data for the past thirty (30) days or more. Thought that there might be other alternatives beside using the bubble charts.

As below the script which can only record label for one (1) day.

Much appreciated if anyone can share your advises.



Code:
# Reg and after Market High Low Level
input afterMarket_Open = 1600; #EST
input afterMarket_Close = 0929; #EST
input afterMarket_Label = yes;
input afterMarket_Cloud = no;
input afterMarket_Line = yes;
input regMarket_Line = yes;
input regMarket_Label = yes;
Input marketOpen = 0930;
Input marketClose = 1559;

def afterMarketOpen = If(SecondsFromTime(afterMarket_Open) >= 0 or SecondsTillTime(afterMarket_Close) >= 0, 1, 0);
def afterMarketReset = if afterMarketOpen and !afterMarketOpen[1] then 1 else 0;
def afterMarketHigh = CompoundValue(1, If((high > afterMarketHigh[1] and afterMarketOpen) or afterMarketReset, high, afterMarketHigh[1]), high);
def afterMarketLow = CompoundValue(1, If((low < afterMarketLow[1] and afterMarketOpen) or afterMarketReset, low, afterMarketLow[1]), low);

def TradingDayStart= SecondsFromTime(marketOpen);
def TradingDayEnd = SecondsTillTime(marketClose);
def DayTrading = tradingDayStart >= 0 and tradingDayEnd >= 0;
def tradingMarketTimeRange = tradingDayStart >= 0 and tradingDayEnd >= 0;
def tradingMarket = tradingMarketTimeRange and !tradingMarketTimeRange[1];
def trading_Market_High = compoundValue(1, if((high > trading_Market_High[1] and tradingMarketTimeRange) or tradingMarket, high, trading_Market_High[1]), high);
def trading_Market_Low = compoundValue(1, if((low < trading_Market_Low[1] and tradingMarketTImeRange) or tradingMarket, low, trading_Market_Low[1]), low);

def regMarket_High = if regMarket_Line then trading_Market_High else Double.NaN ;
#regMarket_High.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#regMarket_High.SetDefaultColor(Color.CYAN);
#regMarket_High.SetLineWeight(2);
def regMarket_low = if regMarket_Line then trading_Market_Low else Double.NaN ;
#regMarket_Low.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#regMarket_Low.SetDefaultColor(Color.CYAN);
#regMarket_Low.SetLineWeight(2);

AddLabel(if regMarket_Label  then 1 else 0, "RTH High " + "$ " + Round(regMarket_High, 2) + " ", Color.light_green);
AddLabel(if regMarket_Label  then 1 else 0, "RTH Low " + "$ " + Round(regMarket_Low , 2) + " ", Color.light_red);
AddLabel(if regMarket_Label  then 1 else 0, "" + AsPercent((regMarket_high - regMarket_Low)/regMarket_high) + " ", Color.gray);
AddLabel(if regMarket_Label  then 1 else 0, "RTH Range " + "$ " + Round(regMarket_high - regMarket_Low , 2) + " ", Color.Yellow);


plot afterMarket_High = if afterMarket_Line then afterMarketHigh else Double.NaN ;
#afterMarket_high.SetStyle(curve.SHORT_DASH);
afterMarket_high.SetStyle(Curve.MEDIUM_DASH);
#afterMarket_High.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
afterMarket_High.SetDefaultColor(Color.CYAN);
afterMarket_High.SetLineWeight(2);
plot afterMarket_Low = if afterMarket_Line then  afterMarketLow else Double.NaN  ;
#afterMarket_Low.SetStyle(curve.SHORT_DASH);
afterMarket_Low.SetStyle(Curve.MEDIUM_DASH);
#afterMarket_Low.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
afterMarket_Low.SetDefaultColor(Color.ORANGE);
afterMarket_Low.SetLineWeight(2);
#AddLabel(if afterMarket_Label  then 1 else 0, "   ", color.black);
AddLabel(if afterMarket_Label  then 1 else 0, "ETH High " + "$ " + Round(afterMarket_High, 2) + " ", Color.cyan);
AddLabel(if afterMarket_Label  then 1 else 0, "ETH Low " + "$ " + Round(afterMarket_Low , 2) + " ", Color.ORANGE);
AddLabel(if afterMarket_Label  then 1 else 0, "" + AsPercent((afterMarket_high - afterMarket_Low)/afterMarket_high) + " ", Color.gray);
AddLabel(if afterMarket_Label  then 1 else 0, "ETH Range " + "$ " + Round(afterMarket_high - afterMarket_Low , 2) + " ", Color.Yellow);

AddCloud(if afterMarket_Cloud  then afterMarket_High  else Double.NaN, if afterMarket_Cloud  then afterMarket_Low  else Double.NaN, Color.LIGHT_GRAY, Color.LIGHT_GRAY);
########################################################################

i'm sorry, your words are confusing. i am not sure what you are asking for.
the picture is blurry, so that doesn't help.

not sure what you mean by 'record'. every variable keeps its values for each bar, and are capable of being read from other bars.

can you elaborate on what,
.. you want to see
.. and where you want to see it?

if you want to store many values at the same time on the same bar, then you will need a variable for each value.
the range can be calculated from high - low, so don't need to store it.

for just RTH, to store the high and low for each hour, for 7 hours a day (rth) , for 30 days, would be,
2 * 7 * 30 = 420 variables.
 

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

i'm sorry, your words are confusing. i am not sure what you are asking for.
the picture is blurry, so that doesn't help.

not sure what you mean by 'record'. every variable keeps its values for each bar, and are capable of being read from other bars.

can you elaborate on what,
.. you want to see
.. and where you want to see it?

if you want to store many values at the same time on the same bar, then you will need a variable for each value.
the range can be calculated from high - low, so don't need to store it.

for just RTH, to store the high and low for each hour, for 7 hours a day (rth) , for 30 days, would be,
2 * 7 * 30 = 420 variables.
Hi bro, thank you for your reply.

Sorry and please pardon my English. Haha

So as per the image above, which show two (2) days which today and yesterday.

I can get the label data(written) for last night extended trading hour (ETH) and today regular trading hour (RTH).

I understand we can't get the label data (written) for yesterday RTH and previous night ETH.

May I check with you if how can we get the data (written, maybe as a chart bubble) for example, for the past five (5) days with:

1) RTH, high, low and its range.

2) ETH, high, low and its range.

Many thanks in advance for your advise. Cheers.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
424 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