the TIME of the HIGH and LOW that a stock made

mwalstea

New member
Hello everyone,

I have a very simple question, is it possible to have a column script that can record the TIME of the HIGH and LOW that a stock made? Would love to know because manually tracking it is so time consuming, would love to hear if so.

Thank you!
 
@mwalstea Please note that a single watchlist column can only plot a single piece of data. Thus you can either display the timestamp for the intraday high or the intraday low, but not both. In order to display both sets of data you would then have to use two watchlist columns to implement this. The other thing to note is that due to the fine granularity required to capture the timestamps, the watchlist aggregation must be set at 1 minute.
 
Thank you for the response Tom. Yeah I understand all you said. I came across this a couple weeks ago and was wondering if it were possible to code? Attached is a picture to help. Please let me know if that makes sense and is possible.



@mwalstea Absolutely possible to code this and I have just COMPLETED that. Just so long as you understand that you will NEED to implement two separate custom watchlist columns - one for HOD and the other for LOD. Both watchlists MUST be run at 1 minute aggregation.

I have posted TWO codes here - Use the first one for HOD and the second one for LOD

CUSTOM COLUMN 1 - RTH High Timestamp Watchlist

Code:
# RTH High Timestamp Watchlist
# tomsk
# 12.22.2019

# Make sure you run this at 1 minute aggregation

declare hide_on_daily;

def Hrs = Floor(9.5 + SecondsFromTime(0930) / 60 / 60) - 1;
def Min = ((9.5 + SecondsFromTime(930) / 60 / 60) % 1) * 60;
def active = SecondsFromTime(0930) >= 0 and SecondsTillTime(1600) >= 0;
def H = if !IsNaN(high) then high else H[1];

def RTHH = if active and !active[1] then H
           else if active and H > RTHH[1] then H
           else RTHH[1];

def HighHH = if H == RTHH then Hrs else HighHH[1];
def HighMM = if H == RTHH then Min else HighMM[1];

AddLabel(1, HighHH + ":" + HighMM, Color.Yellow);
# End RTH High Timestamp Watchlist


CUSTOM COLUMN 2 - RTH Low Timestamp Watchlist

Code:
# RTH Low Timestamp Watchlist
# tomsk
# 12.22.2019

# Make sure you run this at 1 minute aggregation

declare hide_on_daily;

def Hrs = Floor(9.5 + SecondsFromTime(0930) / 60 / 60) - 1;
def Min = ((9.5 + SecondsFromTime(930) / 60 / 60) % 1) * 60;
def active = SecondsFromTime(0930) >= 0 and SecondsTillTime(1600) >= 0;
def L = if !IsNaN(low) then low else L[1];

def RTHL = if active and !active[1] then L
           else if active and L < RTHL[1] then L
           else RTHL[1];

def LowHH = if L == RTHL then Hrs else LowHH[1];
def LowMM = if L == RTHL then Min else LowMM[1];

AddLabel(1, LowHH + ":" + LowMM, Color.Yellow);
# End RTH Low Timestamp Watchlist
 
Tom this is so awesome thank you for this. While I have the thought running through my mind I thought I would ask...is it possible to include PreMarket and Afterhours because its a commonality for stocks to top in the PM time range. If not, no worries, very grateful for this code.

Thank you,
Mark
 
This seems to be ahead an hour on the tops / bottoms. Im on EST not sure if that matters. Some of the stocks are odd, like check CBIO the numbers are similar. But I have consistently noticed its an hour ahead on my end not sure why. Would love to know if I'm doing something wrong thank you
 
Don't think you've done anything "wrong", that's the way TOS operates from what I have observed anyway. First of all, noticed I used the TOS SecondsFromTime() and SecondsTillTime() function calls. These calls expects any input to be in the EST timezone

https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Date---Time/SecondsFromTime
The other thing to note is that on my charts at least, the times that are listed at the bottom of the charts are based in Central timezone. I've learnt to live with that. If you are still concerned, you may consider contacting TOS support.
 
Last edited:

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