Above PreMarket High - Watchlist Column - Daily?

phil48

New member
Hello! I'm trying to identify when a ticker is above a high made between 8 am and 9:29 am.

This is what I have so far. It only works when I select the 30m watchlist timeframe and have Include Extended Hours Trading session checked.

#ABOVE PREMARKET HIGH#
input alertPeriodStart = 800;
input alertPeriodEnd = 929;
def startCounter = SecondsFromTime(alertPeriodStart);
def endCounter = SecondsTillTime(alertPeriodEnd);
def alertPeriod = if startCounter >= 0 and endCounter >= 0 then 1 else 0;
rec trackHigh = if alertPeriod and !alertPeriod[1] then high else if alertPeriod and high > trackHigh[1] then high else trackHigh[1];
rec trackLow = if alertPeriod and !alertPeriod[1] then low else if alertPeriod and low > 0 and low < trackLow[1] then low else trackLow[1];
plot x= (high>trackHigh);
x.assignValueColor( if x > 0.15 then color.green else color.black);

Is there something in my code that's limiting it 30 minutes? How can I see if this statement is true on a Daily timeframe via my watchlist?

Thanks!
 
Solution
Hello! I'm trying to identify when a ticker is above a high made between 8 am and 9:29 am.

This is what I have so far. It only works when I select the 30m watchlist timeframe and have Include Extended Hours Trading session checked.

#ABOVE PREMARKET HIGH#
input alertPeriodStart = 800;
input alertPeriodEnd = 929;
def startCounter = SecondsFromTime(alertPeriodStart);
def endCounter = SecondsTillTime(alertPeriodEnd);
def alertPeriod = if startCounter >= 0 and endCounter >= 0 then 1 else 0;
rec trackHigh = if alertPeriod and !alertPeriod[1] then high else if alertPeriod and high > trackHigh[1] then high else trackHigh[1];
rec trackLow = if alertPeriod and !alertPeriod[1] then low else if alertPeriod and low > 0 and low < trackLow[1]...
Hello! I'm trying to identify when a ticker is above a high made between 8 am and 9:29 am.

This is what I have so far. It only works when I select the 30m watchlist timeframe and have Include Extended Hours Trading session checked.

#ABOVE PREMARKET HIGH#
input alertPeriodStart = 800;
input alertPeriodEnd = 929;
def startCounter = SecondsFromTime(alertPeriodStart);
def endCounter = SecondsTillTime(alertPeriodEnd);
def alertPeriod = if startCounter >= 0 and endCounter >= 0 then 1 else 0;
rec trackHigh = if alertPeriod and !alertPeriod[1] then high else if alertPeriod and high > trackHigh[1] then high else trackHigh[1];
rec trackLow = if alertPeriod and !alertPeriod[1] then low else if alertPeriod and low > 0 and low < trackLow[1] then low else trackLow[1];
plot x= (high>trackHigh);
x.assignValueColor( if x > 0.15 then color.green else color.black);

Is there something in my code that's limiting it 30 minutes? How can I see if this statement is true on a Daily timeframe via my watchlist?

Thanks!
Try to visualize Time Frames as chunks of data. The 30 min time frame is one chunk. There is no way of determining what the lower timeframes looked like from a 30min bar because the 30min bar cannot be broken down.

It is the same with the Daily bar. The Daily bar is one bar. Looking at the daily bar, we can't know what part of it was pre-market.

It is not possible to calculate any intraday data from a daily bar for your watchlist.
 
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
409 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