extended hours data when the extended hours setting is not on.

pfriedl

New member
Hey all, hopefully I can get some help with this. I'm using the script below on multiple small timeframe charts (1, 2, 5 minute). Right now it's able to get the 4am open, but only if the chart is set to show extended trading data is enabled.

I need to be able to plot these values, even if the extended session data is disabled: 4am premarket open, premarket high and low (after 4am). I'm at a loss as to how to do this. Any help is greatly appreciated. Thanks!

Code:
def newDay = GetDay() <> GetDay()[1];
def start = newDay or SecondsTillTime(400) == 0;
rec premarketOpen = if start then open else premarketOpen[1];
plot po = premarketOpen;
 

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

Hey everyone! I'm wanting to have a TOS chart visually show the premarket price for my gap scans without having to have extended hours turned on or reading the top bar of my charts and using my mouse to hover to that price and see where it's at. It would make judging whether the gaps are worth keeping on my watchlist or not extraordinarily easier, but I've been struggling to find anyone with a similar chart, other than premarket high/low indicators.

I found this nice Mobius script that shows current price as a chart line and bubble, but it's only accurate for premarket price when extended hours are turned on.

Code:
# Line At Price
# Mobius
# Alternative to using the HighestAll() function

input barsBack = 1000;
input minimumGapPct = .05;

def c = if !IsNaN(close) and IsNaN(close[-1
        then close
        else c[1];
plot line = if isNaN(close[-barsBack])
            then c[-barsBack]
            else Double.NaN;

def gapDown = high < low[1] - low[1]*minimumGapPct;

def gapUp = low > high[1] - high[1]*minimumGapPct;

AddChartBubble(c,close,c,color.yellow);

I've read elsewhere that you can't access the premarket data without it on, but at the same time, default charts show the current bid/ask in the top of the chart regardless of this setting.

If that's true, perhaps an indicator similar to this one that shows current bid/ask could also work for what I'm needing -- maybe that data IS accessible? Another idea with that limitation is having extended hours turned on, but then forcefully hiding the extended hours area on the charts (not sure if that's possible), just so the scripts can access the premarket data. Anyone try to make something similar or can point me in the right direction with thinkscript functions?

Thanks!
 

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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