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));
#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: