Pre-Market Hours on Daily Chart

practicalopinion

New member
Plus
I am using the below code to check for pre-market hours.

Code:
Def isPreMarket = SecondsFromTime(0400) > 0 and SecondsFromTime(0929) < 0;

# Add a label if it's pre-market
AddLabel(isPreMarket, "Pre-Market", color.yellow);

The code WORKS when I am in MINUTE CHART.
The code DOESN'T WORK when I am in DAILY CHART.

Any pointers / guidance appreciated!
 
Last edited by a moderator:
Solution
Thanks, How do I check if the current time is > 9:30 AM EST when in DAILY CHART?

With futures, the next day's pre-market begins when today's maintenance is complete. A new daily bar begins at this time. Equities don't behave like this, so you can check for the discrepancy. Enable extended hours on the daily chart, and check one bar forward on a futures contract. If there's no extra bar, then it's after 9:30.

def isDailyExtHours =
!isNan(close) and isNaN(close[-1])
and !isNaN(close("/ES:XCME")[-1]);
addlabel(isDailyExtHours, " Extended Hours ");

It just won't immediately detect post-market for equity markets until the futures reopen after maintenance.
I am using the below code to check for pre-market hours.

Code:
Def isPreMarket = SecondsFromTime(0400) > 0 and SecondsFromTime(0929) < 0;

# Add a label if it's pre-market
AddLabel(isPreMarket, "Pre-Market", color.yellow);

The code WORKS when I am in MINUTE CHART.
The code DOESN'T WORK when I am in DAILY CHART.

Any pointers / guidance appreciated!
No, there is no "pre-market" for daily or higher timeframes.
"pre-market" designations are limited to timeframes less than daily.
 
Thanks, How do I check if the current time is > 9:30 AM EST when in DAILY CHART?

With futures, the next day's pre-market begins when today's maintenance is complete. A new daily bar begins at this time. Equities don't behave like this, so you can check for the discrepancy. Enable extended hours on the daily chart, and check one bar forward on a futures contract. If there's no extra bar, then it's after 9:30.

def isDailyExtHours =
!isNan(close) and isNaN(close[-1])
and !isNaN(close("/ES:XCME")[-1]);
addlabel(isDailyExtHours, " Extended Hours ");

It just won't immediately detect post-market for equity markets until the futures reopen after maintenance.
 
Solution
With futures, the next day's pre-market begins when today's maintenance is complete. A new daily bar begins at this time. Equities don't behave like this, so you can check for the discrepancy. Enable extended hours on the daily chart, and check one bar forward on a futures contract. If there's no extra bar, then it's after 9:30.

def isDailyExtHours =
!isNan(close) and isNaN(close[-1])
and !isNaN(close("/ES:XCME")[-1]);
addlabel(isDailyExtHours, " Extended Hours ");

It just won't immediately detect post-market for equity markets until the futures reopen after maintenance.
Thank you
 
Hello, I am in the Daily Chart in the Pre-Market Session.

I need the current stock price, I have tried the below.

def currentPrice = close(period=AggregationPeriod.DAY)[0];

def currentPrice = close(period=AggregationPeriod.MIN)[0];

None of the them seem to work, any pointers / guidance appreciated!
 
Hello, I am in the Daily Chart in the Pre-Market Session.

I need the current stock price, I have tried the below.

def currentPrice = close(period=AggregationPeriod.DAY)[0];

def currentPrice = close(period=AggregationPeriod.MIN)[0];

None of the them seem to work, any pointers / guidance appreciated!

this is the same question you posted yesterday.
please don't make duplicate posts.
you can't read premarket data on a daily chart.

@MerryDay
https://usethinkscript.com/threads/pre-market-hours-on-daily-chart.18120/
 
this is the same question you posted yesterday.
please don't make duplicate posts.
you can't read premarket data on a daily chart.

@MerryDay
https://usethinkscript.com/threads/pre-market-hours-on-daily-chart.18120/
I didn't realize I had posted that, BTW, the BID and ASK values are visible on the DAILY chart in the Pre-Market session, is there a wy to get the BID and ASK values?

1709557689977.png
 
I didn't realize I had posted that, BTW, the BID and ASK values are visible on the DAILY chart in the Pre-Market session, is there a wy to get the BID and ASK values?

View attachment 21265

You could detach a 1m chart
Put the folllowing script in a lower pane (modify as needed)
In chart settings, uncheck show price subgraph
Click the pin in the top line to have it always show on top
Shrink this chart and move it to the upper left corner of the main chart set to whatever agg you want
Link to detached chart https://tos.mx/qHJxFvw

Screenshot 2024-03-04 053105.png
Code:
def PreviousClose = close(period = AggregationPeriod.DAY)[1] ;
def premarketclose = if SecondsFromTime(0930) == 0 then close[1] else premarketclose[1];
def previouspremarketclose = premarketclose[1];

AddLabel(1, "PC:" +PreviousClose + " PMC:" + previouspremarketclose+" CC: "+ close, color.yellow);
 
Last edited:

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
406 Online
Create Post

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