Hi,

I am going crazy trying to figure out what is going wrong with the
following code. I would be very grateful if someone could help!

The aim of the code is to return the Volume from exactly a year ago
and I've coded it as follows:

currentDate = DateNum ();
dateYearAgo = currentDate - 10000; //date 1 year ago
CurrentTime = TimeNum();

numBars = BarsSince(DateNum() == dateYearAgo AND TimeNum() ==
CurrentTime); 
VolumeYearAgo = Ref (V,-numBars);

//VolumeYearAgo = ValueWhen(DateNum() == dateYearAgo AND TimeNum() ==
CurrentTime, V, 1);

However, numBars is always empty and when I use the ValueWhen
function, it also returns "Empty".

Thanks in advance for any help!

Reply via email to