How to access yesterday's intraday data for specific indicators' highest value

TillonS

New member
Greetings!
I wanted to reach out for help after multiple attempts at trying to access previous day's indicator/study data have not worked and I am stuck. I have tried various searches to find reference information or specific examples but mostly came up empty. Many thanks in advance and all help is highly appreciated!

I am trying to:
1a. Capture Highest High of Yesterday's KeltnerChannel Upper band data from 15min intraday chart (26 bars lookback on 15min chart, and default KC indicator setting)
1b. Capture Lowest Low of yesterday's intraday KeltnerChannel Lower band data from 15m chart. (same lookback and settings as above)
2. Project the captured highest high, and lowest low values from yesterday's intraday KC data in step 1 as horizontal upper and lower lines on the today's 15min chart. These lines would show for entire given day, and redraw again next day.
3. Calculate width of KC channel range (ie. width of highest high - lowest low) at each day market open time (to be later used for further study).


Just for context, overall goal is to identify stocks in compression based on KC data, then look for breakouts, and compare breakout stocks 15min OR range to KC range, and then finally use that ratio to quantify the breakout as grade A-C, and it can lead to calculation of position size and price extension levels.)

Thank you again!
Tillon
 
Solution
Greetings!
I wanted to reach out for help after multiple attempts at trying to access previous day's indicator/study data have not worked and I am stuck. I have tried various searches to find reference information or specific examples but mostly came up empty. Many thanks in advance and all help is highly appreciated!

I am trying to:
1a. Capture Highest High of Yesterday's KeltnerChannel Upper band data from 15min intraday chart (26 bars lookback on 15min chart, and default KC indicator setting)
1b. Capture Lowest Low of yesterday's intraday KeltnerChannel Lower band data from 15m chart. (same lookback and settings as above)
2. Project the captured highest high, and lowest low values from yesterday's intraday KC data in...
Greetings!
I wanted to reach out for help after multiple attempts at trying to access previous day's indicator/study data have not worked and I am stuck. I have tried various searches to find reference information or specific examples but mostly came up empty. Many thanks in advance and all help is highly appreciated!

I am trying to:
1a. Capture Highest High of Yesterday's KeltnerChannel Upper band data from 15min intraday chart (26 bars lookback on 15min chart, and default KC indicator setting)
1b. Capture Lowest Low of yesterday's intraday KeltnerChannel Lower band data from 15m chart. (same lookback and settings as above)
2. Project the captured highest high, and lowest low values from yesterday's intraday KC data in step 1 as horizontal upper and lower lines on the today's 15min chart. These lines would show for entire given day, and redraw again next day.
3. Calculate width of KC channel range (ie. width of highest high - lowest low) at each day market open time (to be later used for further study).


Just for context, overall goal is to identify stocks in compression based on KC data, then look for breakouts, and compare breakout stocks 15min OR range to KC range, and then finally use that ratio to quantify the breakout as grade A-C, and it can lead to calculation of position size and price extension levels.)

Thank you again!
Tillon

See if this helps

Screenshot 2023-06-15 120549.png
Code:
input agg = AggregationPeriod.FIFTEEN_MIN;

plot kcupper = KeltnerChannels(price = close(period = agg)).Upper_Band;
plot kclower = KeltnerChannels(price = close(period = agg)).lower_Band;

#Previous Day Range
def range    = GetDay() == GetLastDay() - 1 and SecondsFromTime(0930) >= 0 and SecondsTillTime(1600) > 0;

#Previous Day High
def kch      = if range[1] == 0 and range
               then kcupper
               else if range
               then Max(kch[1], kcupper)
               else kch[1];

#High extemded to shown on Today
plot kchop   = if GetDay() == GetLastDay() and
               SecondsFromTime(0930) >= 0 and SecondsTillTime(1600) > 0
               then kch
               else Double.NaN;

#Previous Day Low
def kcl      = if range[1] == 0 and range
               then kclower
               else if range
               then Min(kcl[1], kclower)
               else kcl[1];

#Low extemded to show on Today
plot kclop   = if GetDay() == GetLastDay() and
               SecondsFromTime(0930) >= 0 and SecondsTillTime(1600) > 0
               then kcl
               else Double.NaN;

def width    = kchop - kclop;

AddLabel(1, "KC Width " + AsDollars(width), Color.YELLOW);
 

Attachments

  • Screenshot 2023-06-15 120549.png
    Screenshot 2023-06-15 120549.png
    93.2 KB · Views: 145
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
468 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