Help with daily RVOL for Intraday timeframes

luicius

New member
From my understanding, aggregation periods seems to work mainly with price rather than volume.
How do I get daily RVOL values on intraday timeframes?

Code:
input threshold = 3.0;
input length = 60;
input numDev = 2.0;
input allowNegativeValues = no;

def agg = AggregationPeriod.DAY;
def rawRelVol = (volume - Average(volume, length)) / StDev(volume, length);
def relVol = if allowNegativeValues then rawRelVol else Max(0, rawRelVol);

AddLabel(yes, Concat("RVOL: ", AsText(relVol,NumberFormat.TWO_DECIMAL_PLACES)), color.white);
 
Solution
@rad14733, thanks for your response. I figured out a solution.

Code:
input threshold = 3.0;
input length = 60;
input numDev = 2.0;
input allowNegativeValues = no;

def dailyRelVol = volume(period = AggregationPeriod.DAY);
def rawRelVol = (dailyRelVol - Average(dailyRelVol, length)) / StDev(dailyRelVol, length);
def relVol = if allowNegativeValues then rawRelVol else Max(0, rawRelVol);

AddLabel(yes, Concat("RVOL: ", AsText(relVol,NumberFormat.TWO_DECIMAL_PLACES)), color.white);

luicius

New member
@rad14733, thanks for your response. I figured out a solution.

Code:
input threshold = 3.0;
input length = 60;
input numDev = 2.0;
input allowNegativeValues = no;

def dailyRelVol = volume(period = AggregationPeriod.DAY);
def rawRelVol = (dailyRelVol - Average(dailyRelVol, length)) / StDev(dailyRelVol, length);
def relVol = if allowNegativeValues then rawRelVol else Max(0, rawRelVol);

AddLabel(yes, Concat("RVOL: ", AsText(relVol,NumberFormat.TWO_DECIMAL_PLACES)), color.white);
 
Solution

Similar threads

Top