5 Min candle Total Price

Jcabrales

New member
I need someone's help to assist create a script that will mark the High / Low of the 1st 5 minute candle and add the price of total value.

SPY High at $500.00 Low $498.25 Total 5 min candle 1.75

This is basically what I'm looking for.

Today 5-13-25 on first 5 min candle 8:30 am to 8:35 am
High $584.31
Low $583.35
Total move = .96 cents

I would like to have a script that can automatically can do the math and give me the $.96 cent move on a custom column search

I have found this on line which marks the High and Low of the 1st 5 min candle, I just need help do it can do the calculation automatically. Thank you agian. I hope you can help me.
I also found this script that calculates the total atr move but I cant get it to work on the 5 min only

Code:
*********************************************
input ATRLength = 14;
def ATR = Round(Average(TrueRange(high, close, low), ATRLength), 2);
AddLabel(yes, (ATR), Color.CYAN);
def agg10 = AggregationPeriod.FIVE_MIN;

input startTimeMarket = 0830;
input endTimeFirst5Minute = 0835;

def startCounter5 = SecondsFromTime(startTimeMarket);
def endCounter5 = SecondsTillTime(endTimeFirst5Minute);
def first5Minutes = if startCounter5 >= 0 and endCounter5 > 0 then 1 else 0;

******************************************************************************


#HL_TimeRange_using_ProfileHL

input begin = 0930;
input end = 0935;

input pricePerRowHeightMode = {AUTOMATIC, default TICKSIZE};
def height;
switch (pricePerRowHeightMode) {
case AUTOMATIC:
height = PricePerRow.AUTOMATIC;
case TICKSIZE:
height = PricePerRow.TICKSIZE;
}

def rth = if isnan(close) then rth[1] else SecondsFromTime(begin) >= 0 and SecondsTillTime(end) > 0;
def cond = rth != rth[1];

profile vol = VolumeProfile("startNewProfile" = cond and secondstilltime(end)>=0, "onExpansion" = no, "numberOfProfiles" = 1000, pricePerRow = height);


profile vol1 = VolumeProfile("startNewProfile" = cond, "onExpansion" = no, "numberOfProfiles" = 1000, pricePerRow = height);


def hProfile = if IsNaN(vol.GetHighest()) then hProfile[1] else vol1.GetHighest();
def lProfile = if IsNaN(vol.GetLowest()) then lProfile[1] else vol1.GetLowest();
def uprof = if !rth or IsNaN(close) then uprof[1] else hProfile;
def lprof = if !rth or IsNaN(close) then lprof[1] else lProfile;

plot ProfileHigh = uprof;
plot ProfileLow = lprof;

ProfileHigh.SetDefaultColor(Color.GREEN);
ProfileLow.SetDefaultColor(Color.RED);
ProfileHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
 

Attachments

  • Screenshot 2025-05-13 at 9.55.28 PM.png
    Screenshot 2025-05-13 at 9.55.28 PM.png
    64.8 KB · Views: 122
Last edited by a moderator:
Solution
Hello Halcyonguy,

Thank you for taking the time and read my post. This is basically what I'm looking for.

Today 5-13-25 on first 5 min candle 8:30 am to 8:35 am
High $584.31
Low $583.35
Total move = .96 cents

I would like to have a script that can automatically can do the math and give me the $.96 cent move on a custom column search

I have found this on line which marks the High and Low of the 1st 5 min candle, I just need help do it can do the calculation automatically. Thank you agian. I hope you can help me.
I also found this script that calculates the total atr move but I cant get it to work on the 5 min only

*********************************************
input ATRLength = 14;
def ATR = Round(Average(TrueRange(high, close...
Hello Halcyonguy,

Thank you for taking the time and read my post. This is basically what I'm looking for.

Today 5-13-25 on first 5 min candle 8:30 am to 8:35 am
High $584.31
Low $583.35
Total move = .96 cents

I would like to have a script that can automatically can do the math and give me the $.96 cent move on a custom column search

I have found this on line which marks the High and Low of the 1st 5 min candle, I just need help do it can do the calculation automatically. Thank you agian. I hope you can help me.
I also found this script that calculates the total atr move but I cant get it to work on the 5 min only

*********************************************
input ATRLength = 14;
def ATR = Round(Average(TrueRange(high, close, low), ATRLength), 2);
AddLabel(yes, (ATR), Color.CYAN);
def agg10 = AggregationPeriod.FIVE_MIN;

input startTimeMarket = 0830;
input endTimeFirst5Minute = 0835;

def startCounter5 = SecondsFromTime(startTimeMarket);
def endCounter5 = SecondsTillTime(endTimeFirst5Minute);
def first5Minutes = if startCounter5 >= 0 and endCounter5 > 0 then 1 else 0;

******************************************************************************


#HL_TimeRange_using_ProfileHL

input begin = 0930;
input end = 0935;

input pricePerRowHeightMode = {AUTOMATIC, default TICKSIZE};
def height;
switch (pricePerRowHeightMode) {
case AUTOMATIC:
height = PricePerRow.AUTOMATIC;
case TICKSIZE:
height = PricePerRow.TICKSIZE;
}

def rth = if isnan(close) then rth[1] else SecondsFromTime(begin) >= 0 and SecondsTillTime(end) > 0;
def cond = rth != rth[1];

profile vol = VolumeProfile("startNewProfile" = cond and secondstilltime(end)>=0, "onExpansion" = no, "numberOfProfiles" = 1000, pricePerRow = height);


profile vol1 = VolumeProfile("startNewProfile" = cond, "onExpansion" = no, "numberOfProfiles" = 1000, pricePerRow = height);


def hProfile = if IsNaN(vol.GetHighest()) then hProfile[1] else vol1.GetHighest();
def lProfile = if IsNaN(vol.GetLowest()) then lProfile[1] else vol1.GetLowest();
def uprof = if !rth or IsNaN(close) then uprof[1] else hProfile;
def lprof = if !rth or IsNaN(close) then lprof[1] else lProfile;

plot ProfileHigh = uprof;
plot ProfileLow = lprof;

ProfileHigh.SetDefaultColor(Color.GREEN);
ProfileLow.SetDefaultColor(Color.RED);
ProfileHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ProfileLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

here you go
you found a good study, that had the data, so it was pretty easy to add a few lines to do this.

i loaded your study on a chart to verify the lines. looked at many symbols , at the first bars of the day to verify line levels.
i removed the atr code at the beginning.

uprof and lprof have the desired values, at the orb bar and for the rest of the day.
so i made a formula, to calc the desired value.
def orb_diff = uprof - lprof;

i made a column study (watchlist)
disabled the original plots. in a column, only need 1 output , either a plot or a label.
in a column, the plot color (or label color) is the font color. i set it to black.

i used plot, so the output is a number, and will sort normally.
if you use addlabel, the output is text and leading 0's need to be added to the output, so sorting will work.

i used a formula within AssignBackgroundColor() to draw 4 different colors in the cell, for different dollar ranges , 0-1, 1-2 , 2-3 , 3+

i add a z to all my custom column studies so they will be grouped together at the end of the study list

column study
zorb5rng
http://tos.mx/!zQrRjZha


Code:
#zorb5rng
#orb_5min_price_range_col
#https://usethinkscript.com/threads/5-min-candle-total-price.20969/
#5 Min candle Total Price
#Jcabrales  May 11, 2025

#this is basically what I'm looking for.
#Today 5-13-25 on first 5 min candle 8:30 am to 8:35 am
#High $584.31
#Low $583.35
#Total move = .96 cents
#I would like to have a script that can automatically can do the math and give me the $.96 cent move on a custom column search


#HL_TimeRange_using_ProfileHL
input begin = 0930;
input end = 0935;

input pricePerRowHeightMode = {AUTOMATIC, default TICKSIZE};
def height;
switch (pricePerRowHeightMode) {
case AUTOMATIC:
height = PricePerRow.AUTOMATIC;
case TICKSIZE:
height = PricePerRow.TICKSIZE;
}

def rth = if isnan(close) then rth[1] else SecondsFromTime(begin) >= 0 and SecondsTillTime(end) > 0;
def cond = rth != rth[1];

profile vol = VolumeProfile("startNewProfile" = cond and secondstilltime(end)>=0, "onExpansion" = no, "numberOfProfiles" = 1000, pricePerRow = height);

profile vol1 = VolumeProfile("startNewProfile" = cond, "onExpansion" = no, "numberOfProfiles" = 1000, pricePerRow = height);


def hProfile = if IsNaN(vol.GetHighest()) then hProfile[1] else vol1.GetHighest();
def lProfile = if IsNaN(vol.GetLowest()) then lProfile[1] else vol1.GetLowest();
def uprof = if !rth or IsNaN(close) then uprof[1] else hProfile;
def lprof = if !rth or IsNaN(close) then lprof[1] else lProfile;

#plot ProfileHigh = uprof;
#plot ProfileLow = lprof;
#ProfileHigh.SetDefaultColor(Color.GREEN);
#ProfileLow.SetDefaultColor(Color.RED);
#ProfileHigh.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#ProfileLow.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);

def orb_diff = uprof - lprof;
#addlabel(1, "ORB5 rnage " + orb_diff, color.white);

# just a number for a column
plot z = orb_diff;
z.setdefaultcolor(color.black);


AssignBackgroundColor(
     if orb_diff < 1 then color.blue
else if orb_diff < 2 then color.magenta
else if orb_diff < 3 then color.yellow
else color.green);
#
 

Attachments

  • img2-col.JPG
    img2-col.JPG
    55.5 KB · Views: 128
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
375 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