After Hours highs and low label

rudy seena

New member
Hi all, as always thanks for the great work you guys are doing. I am learning a ton. My question is how do I add a label for only "AFTER HOURS" highs and lows (NOT Premarket) . I checked your extensive library but could not find any posts related to my specific question. Would love your help on this. Thanks, Rudy
 
Solution
OK. Price in a ime range...

Code:
declare upper;

def endRTH = 1600;

def midnight = 2359;

def aftermarket = if secondsFromTime(endRTH) > 0 AND secondsTillTime(midnight) > 0 then 1 else 0;

def yesterday = if GetLastDay() == GetDay() then 1 else 0;

rec post_market_high = if aftermarket == 1 and yesterday == 1 and HIGH > post_market_high[1] then HIGH else post_market_high[1];

addLabel(yes, "After-Market High: " + post_market_high, color.orange);

This may, or may not run exactly as you expect. I still, after spending years with ThinkScript, have a hard time wrapping my head around how to deal with weekends.

Happy Trading,
mashume
OK. Price in a ime range...

Code:
declare upper;

def endRTH = 1600;

def midnight = 2359;

def aftermarket = if secondsFromTime(endRTH) > 0 AND secondsTillTime(midnight) > 0 then 1 else 0;

def yesterday = if GetLastDay() == GetDay() then 1 else 0;

rec post_market_high = if aftermarket == 1 and yesterday == 1 and HIGH > post_market_high[1] then HIGH else post_market_high[1];

addLabel(yes, "After-Market High: " + post_market_high, color.orange);

This may, or may not run exactly as you expect. I still, after spending years with ThinkScript, have a hard time wrapping my head around how to deal with weekends.

Happy Trading,
mashume
 
Last edited:
Solution
OK. Price in a ime range...

Code:
declare upper;

def endRTH = 1600;

def midnight = 2359;

def aftermarket = if secondsFromTime(endRTH) > 0 AND secondsTillTime(midnight) > 0 then 1 else 0;

def yesterday = if GetLastDay() == GetDay() then 1 else 0;

rec post_market_high = if aftermarket == 1 and yesterday == 1 and HIGH > post_market_high[1] then HIGH else post_market_high[1];

addLabel(yes, "After-Market High: " + post_market_high, color.orange);

This may, or may not run exactly as you expect. I still, after spending years with ThinkScript, have a hard time wrapping my head around how to deal with weekends.

Happy Trading,
mashume
Hi Mashume, thanks for the code. I really appreciate your valuable time to share. Unfortunately, it gives me a value of zero & only After-Market High:0, not After-Market Low, also. I used TOS OnDemand to backtest on a Saturday, so not sure if I have to wait for regular market hours for it to work? Thoughts? Rudy
 
@rudy seena Maybe it is an on-demand issue. It works fine on the regular platform.
And yes, this is only a High label. But now that you have the logic, you can add & modify the code to meet your needs.
a1.png
 
@rudy seena Maybe it is an on-demand issue. It works fine on the regular platform.
And yes, this is only a High label. But now that you have the logic, you can add & modify the code to meet your needs.
View attachment 1086
Thanks. I called TOS and it was an OnDemand issue. Also, I was able to modify your code for the AH Low. Thanks again. You guys are awesome! Rudy
 
Hi all, sorry for the delay. Below is the code for the After Hours highs and lows. Unfortunately, when I ran this morning at 9.22am, before mkt opens, it still does not give me the correct data. Instead it prints: AHH: 0, AHL: 0.

I did speak to TOS but they were unable to help me and said it was a coding issues. Can you guys help? Thanks, Rudy

declare upper;

def endRTH = 1600;

def midnight = 2359;

def aftermarket = if secondsFromTime(endRTH) > 0 AND secondsTillTime(midnight) > 0 then 1 else 0;

def yesterday = if GetLastDay() == GetDay() then 1 else 0;

rec post_market_high = if aftermarket == 1 and yesterday == 1 and HIGH > post_market_high[1] then HIGH else post_market_high[1];

addLabel(yes, "AHH: " + post_market_high, color.orange);

rec post_market_low = if aftermarket == 1 and yesterday == 1 and LOW > post_market_low[1] then low else post_market_low[1];

addLabel(yes, "AHL: " + post_market_Low, color.orange);
 
Hi all, as always thanks for the great work you guys are doing. I am learning a ton. My question is how do I add a label for only "AFTER HOURS" highs and lows (NOT Premarket) . I checked your extensive library but could not find any posts related to my specific question. Would love your help on this. Thanks, Rudy
Interesting. How are you using this information to help make a trade?
 
Interesting. How are you using this information to help make a trade?
I use pre-mkt data to see strength or weakness at daily support or resistance areas. For example, if pre-mkt highs are > than After Hours and prior day highs - at the open, I wait for a pullback to prior day highs and enter. Currently, I have to physically locate After Hours highs and lows. A label would save much valuable time.
 
interesting Idea. Why the after hours high and low? why not from close to open after hours high and low? What is it that you think is happening during that time? On tesla yesterday i noticed a huge spike down from 821 to 816 witch just seems very manipulated/fishy
 
interesting Idea. Why the after hours high and low? why not from close to open after hours high and low? What is it that you think is happening during that time? On tesla yesterday i noticed a huge spike down from 821 to 816 witch just seems very manipulated/fishy
Previous Prior day, Prior day, After Hours, Pre market highs & lows are support & resistance price levels (R1, R2, R3, R4, etc) I use for game planning what if scenarios for the trading day. For example, if SPY is weak, but stock opens strong & jacks to Previous Prior day Highs, I will short it.
 

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
506 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