I code by copy/paste and frankesteining my needs. Can someone help me here, I'm trying to get a label that tells me the amount of volume in the last 10 seconds. This will give me an idea of the intensity of the tape in a very short span for entries/exits. All ideas are welcomed
Code:
input VolStatsPeriod = AggregationPeriod.MIN;
def HO = open(period = VolStatsPeriod);
def HH = high(period = VolStatsPeriod);
def HC = close(period = VolStatsPeriod);
def HL = low(period = VolStatsPeriod);
def HV = volume(period = VolStatsPeriod);
def HBuying = HV * (HC - HL) / (HH - HL);
def HSelling = HV * (HH - HC) / (HH - HL);
def HtotVol = Round(HBuying, 0) + Round(HSelling, 0) ;
def htotvoltensec = round(htotvol - htotvol[.16],0);
addlabel(yes,"volmin: "+htotvoltensec,color.gray);