Volume Analysis

garethb

Well-known member
Messages
307
Likes
15
There has been discussion recently about determining early in the day trend days vs consolidation. Does anybody have a veiw on the role volume has to play in this. I have been experimenting recently with an indicator which compares the cumulative volume so far today with the average cumulative volume at this time of day over the past few days.

See picture below two versions of an indicator which tracks todays cumulative volume compared with recent history on SPY. The bottom chart tracks a histogram of todays vol vs a red line showing recent average. The middle chart shows todays vol/ the recent average. The bottom one is more intuitive but the middle one is easier to read once you understand what the number means.

On 4th October the big ramp up in volume when the market rallied between 10:00 and 10:30 led me to believe (correctly in hindsight) that we were having an uptrend day. Yesterday the high volume in first 15 minutes put me in "uptrend" mode early which turned out to be wrong and perhaps the sudden drop off in volume after 9:45 (together with narrow price range) was the warning.

Any thoughts on interpreting volume in this way?
 

Attachments

  • vol analysis.jpg
    vol analysis.jpg
    266.4 KB · Views: 47
Last edited:
And here's some code to produce the charts. For personal use and provided without warranty. If anybody has bright ideas to improve(or fix ) it please share with me in return.

Ave length is no of days (NB not a bar count) it it uses to calc exponential MA of volume to each point in the day. PlotasRatio switches between the two forms of display. Ignore the other parameters Broadcast sets a GV but is untested and ExportSwitch I used for debugging.

Should work on any Intraday timeframe chart. Need to set the chart to go back about 2* length number of days to get sensible EMA numbers ie if using default 14 set the chart to about 30 days of data.

Enjoy

Gareth



Inputs:
AveLength(14),
PlotasRatio(False),
Broadcast(False),
ExportSwitch(False);


Variables:
DailyBarCount(0),
DayCount(0),
K(2/(AveLength+1)),
RtnVal(0);

Arrays:
float BarVolSum[1440](0),
float BarVolAve[1440](0),
float CumVolToday[1440](0),
float CumVolSum[1440](0),
float CumVolAve[1440](0);

If ExportSwitch = True then
Begin
Variables:
FileString(""),
DataString("");

FileString = "C:\Program Files\TradeStation 8.1 (Build 3228)\MyWork\Exports\CumVolAnalysis-" +
Symbol+".csv";
End;

If BarType = 1 then
Begin
If Date <> Date[1] then
Begin
DailyBarCount = 1;
CumVolToday[0] = 0;
DayCount = DayCount + 1;
End
Else
DailyBarCount = DailyBarCount + 1;

If DayCount > 0 and DayCount <= AveLength then
Begin

BarVolSum[DailyBarCount] = Volume + BarVolSum[DailyBarCount];
BarVolAve[DailyBarCount] = BarVolSum[DailyBarCount] / DayCount;
CumVolToday[DailyBarCount] = CumVolToday[DailyBarCount-1] + Volume;
CumVolSum[DailyBarCount] = CumVolToday[DailyBarCount] + CumVolSum[DailyBarCount];
CumVolAve[DailyBarCount] = CumVolSum[DailyBarCount] / DayCount;
End;

If DayCount > AveLength then
Begin
BarVolAve[DailyBarCount] = (Volume * K) + (BarVolAve[DailyBarCount] * (1 - K));
CumVolToday[DailyBarCount] = CumVolToday[DailyBarCount-1] + Volume;
CumVolAve[DailyBarCount] = (CumVolToday[DailyBarCount] * K) + (CumVolAve[DailyBarCount] * (1 - K));
End;

{ if close >= open then SetPlotColor(1, Green)
else SetPlotColor(1,Red);

Plot1(Volume, "Volume");
Plot2(BarVolAve[DailyBarCount], "AveVol");
}
If Plotasratio and CumVolAve[DailyBarCount] > 0 then
Begin
Plot3(CumVolToday[DailyBarCount]/CumVolAve[DailyBarCount], "Rel Volume");
Plot4 (1,"Average");
End
Else
Begin
Plot1(CumVolToday[DailyBarCount], "VolumeToday");
Plot2 (CumVolAve[DailyBarCount], "AveDailyVol");
End;

If Broadcast and CumVolAve[DailyBarCount-1] <> 0 and DailyBarCount > 1 then
RtnVal = GVSetNamedFloat(Symbol+"VolAnal",CumVolToday[DailyBarCount-1]/CumVolAve[DailyBarCount-1]);

If ExportSwitch = True then
Begin
DataString=Symbol+","+
ELDatetoString(Date)+","+
NumtoStr(time,0)+","+

NumtoStr(AveLength,0)+","+
NumtoStr(DayCount,0)+","+
NumtoStr(DailyBarCount,0)+","+
NumtoStr(Volume,2)+","+
NumtoStr(BarVolSum[DailyBarCOunt],2)+","+
NumtoStr(BarVolAve[DailyBarCount],2)+","+
NumtoStr(CumVolToday[DailyBarCOunt],2)+","+
NumtoStr(CumVolSum[DailyBarCOunt],2)+","+
NumtoStr(CumVolAve[DailyBarCOunt],2)
+NewLine;
FileAppend(FileString,DataString);
End;


End;
 
Gareth,

It should be noted that to use this you will need to have the GlobalVariable.dll as well as other functions to installed.


Paul
 
garethb said:
There has been discussion recently about determining early in the day trend days vs consolidation. Does anybody have a veiw on the role volume has to play in this. I have been experimenting recently with an indicator which compares the cumulative volume so far today with the average cumulative volume at this time of day over the past few days.

See picture below two versions of an indicator which tracks todays cumulative volume compared with recent history on SPY. The bottom chart tracks a histogram of todays vol vs a red line showing recent average. The middle chart shows todays vol/ the recent average. The bottom one is more intuitive but the middle one is easier to read once you understand what the number means.

On 4th October the big ramp up in volume when the market rallied between 10:00 and 10:30 led me to believe (correctly in hindsight) that we were having an uptrend day. Yesterday the high volume in first 15 minutes put me in "uptrend" mode early which turned out to be wrong and perhaps the sudden drop off in volume after 9:45 (together with narrow price range) was the warning.

Any thoughts on interpreting volume in this way?

Hi garethb,

Your cumulative volume chart provides an interesting viewpoint, and is much welcomed. I use a different trading platform (Real Tick), and can't really contribute to your accumulative volume charts. I have though taken a snap shot of the last 5 trading days for Intra-day volume comparison and attached them. But I too have been trying to put a handle on finding a method of identifying when the Market is in Consolidation like it was today for a while. It was like watching paint dry – LOL.

I agree that volume can be used as an early consolidation identifier, but I see it as one indicator and I have been using the Range of the Indexes (Dow & Nas) as another, but these two have not satisfied me enough as of yet, so I keep looking searching, and noticed your post.

I’ve attached two files in MS Word with charts on the NASDAQ showing the Intra-day volume. The volume is not accumulated but are snap shots shown during the day on three 60 min charts for comparison of the time frames at 11:06, 12:06, and EOD (all in ET-NY) to the last 4 trading days. One item that did affect today’s volume was the fact that today was a US Bank Holiday for Columbus Day, where the US Banks didn’t contribute their usual trading volume.

The other attached file have charts in 5 min TF’s showing the lack of range during today’s open till around 11:30 (ET-NY) for both the NASDAQ & Dow. I have a habit of drawing Horizontal lines from Market open till 10 AM (ET), looking for a brk/out or brk/down. It also helps me to identify narrow ranges (and choppiness) like we noticed till around 11:30 am (ET) today. The NASDAQ had a range between 9:30 Open till 10:00 (ET) of 6.7 points, while INDU had a range of 25 points. The choppiness is more noticeable on the NASDAQ chart.

Cheers
 

Attachments

  • NASD - Total Vol, Oct 9, US Bank Holiday.doc
    103.5 KB · Views: 29
  • Nas & Dow 5 Min Charts - Narrow Range.doc
    58 KB · Views: 21
Top