What was the high of the highest volume day?

elMatador@01

New member
Hi guys! I need to find the date and high of day price for the day with the highest vol in a year--the same for a date X days from today

#I want to find the number of days were volume was >= X. I want to know the date of 2 specific days. 1) The day with the highest vol. 2) The date where the criteria was #met closest to current date. I Need to know the HOD of those 2 days. Below is the code I managed to write with a few days reading about thinkScript.
#I wasn't able to figure out the rest.

input volCriteria = 1;
def vol = volume (period = "DAY");

# Here is where I count the number of days that met the criteria
def conditionMet = if (vol >= volCriteria)then 1 else 0;
def counter = if conditionMet == 1 then counter[1] + 1 else counter [1];
addLabel(yes,"Leyers: "+ counter);

addLabel(yes," 1 Year Highest vol: "+ HighestAll(vol));
 
Last edited by a moderator:
Hi guys! I need to find the date and high of day price for the day with the highest vol in a year--the same for a date X days from today

#I want to find the number of days were volume was >= X. I want to know the date of 2 specific days. 1) The day with the highest vol. 2) The date where the criteria was #met closest to current date. I Need to know the HOD of those 2 days. Below is the code I managed to write with a few days reading about thinkScript.
#I wasn't able to figure out the rest.

input volCriteria = 1;
def vol = volume (period = "DAY");

# Here is where I count the number of days that met the criteria
def conditionMet = if (vol >= volCriteria)then 1 else 0;
def counter = if conditionMet == 1 then counter[1] + 1 else counter [1];
addLabel(yes,"Leyers: "+ counter);

addLabel(yes," 1 Year Highest vol: "+ HighestAll(vol));

your words are confusing. not sure what you are asking.
here is something to experiment with.
it finds the highest day volume, within x days. set to 20 for testing.
finds the high of that day.

Code:
#vol_hi_day

#https://usethinkscript.com/threads/what-was-the-high-of-the-highest-volume-day.18498/
#What was the high of the highest volume day?

# date and high of day ,
#.. day with the highest vol in a year
#.. a date X days from today

def dat = getyyyymmdd();
#def days = 252;
def days = 20;

def agg = aggregationperiod.day;
def vol = volume(period = agg);
def hi = high(period = agg);
def daycnt = if hi != hi[1] then daycnt[1] + 1 else daycnt[1];
def hivol = highest(vol, days);
def hivoloff = GetMaxValueOffset(vol, days);
def hivolhi = getvalue(hi, hivoloff);

addlabel(1, "highest vol " + hivol, color.yellow);
addlabel(1, "days to highest vol " + hivoloff, color.yellow);
addlabel(1, "high of highest vol " + hivolhi, color.yellow);

#---------------------------------
# test stuff

input test1 = no;
addchartbubble(test1 and !isnan(close), 0,
#vol + "\n" +
hivol + "\n" +
hivoloff + "\n" +
hivolhi
, color.yellow, no);
#
 

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
445 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