Volume time

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
User avatar
arnie
Posts: 1581
Joined: 11 Feb 2009
Location: Portugal
Has thanked: 472 times
Been thanked: 508 times

Volume time

Postby arnie » 12 Dec 2009

Hi.

Again, I'm having trouble with a study.

The premise is simple.
Recording today's total volume traded between a specified time range and comparing it with the same previous day traded volume during the same specified time range.

So far so good. The formula below does just that.

The thing is, I want today's reading to indicate the difference of traded volume when compared to yesterday's traded volume at that same time.

So, if today, at 10:05 AM, the ES has already traded 115.882 futures, what is the difference in %, when compared to yesterday's same time?
I can say that this Friday, at 10:05 AM we had traded 129% more volume than the previous day at that same time.

Simply said, I want to know in realtime the trade volume difference when compared to yesterday's traded volume?
How can I program and insert that in the formula below?

Can anyone help me?

Regards,
Fernando


Code: Select all

Inputs:
   startTime      (930),
   endTime      (1200);

variables:
   stTime         (false),
   resetVol      (false),
   sessVol      (0),
   myVolume      (0),
   prevVolume      (0),
   todayVolume      (0);


if BarType >= 2 then                             
   MyVolume = Volume
else                       
   MyVolume = Ticks;
   
   
if date <> date[1] then begin
   resetVol = false;

   if time > startTime and resetVol = false then begin
      resetVol = true;
      prevVolume = todayVolume;
      todayVolume = 0;
   end;

end;

if time > startTime and time < endTime then begin
   todayVolume = todayVolume + myVolume;
end;


plot1(todayVolume);
plot2(prevVolume);

Return to “User Contributed Studies and Indicator Library”