Thursday, February 21, 2008

Intraday Volume Indicator

Ever wondered how volume is doing so far compared to x number of days at any given period of time? I found this indicator on the TS forums and thought was really nifty.
I use it on Standard Session and minute charts.
Note: DaysToAvg i am using 7 days. That can be customizable and is an indicator. Place it on TS and have fun.
--Raj
<<>>

Input: DaysToAvg(7), AlertPct(150); Vars: LenOfDay(0), BPD(0), BarsPerDay(0), VolSumToAvg(0), VolSum(0), VolSumAvg(0), VolSumPct(0); If BarType = 1 then begin LenOfDay = TimeToMinutes(Sess1EndTime) - TimeToMinutes(Sess1StartTime); BPD = LenOfDay/BarInterval; If FracPortion(BPD) = 0 then BarsPerDay = BPD else BarsPerDay = BPD + 1 - FracPortion(BPD); VolSumToAvg = 0; If Date <> Date[1] then VolSum = Ticks else VolSum = VolSum + Ticks; For Value1 = 1 to DaysToAvg begin VolSumToAvg = VolSumToAvg + VolSum[BarsPerDay*Value1]; end; VolSumAvg = VolSumToAvg / DaysToAvg; If VolSumAvg > 0 then VolSumPct = VolSum / VolSumAvg * 100; Plot1(VolSumPct, "VolSumPct"); // If VolSumPct > AlertPct then // Alert ( "Intraday Volume exceeds" + Spaces(1) + NumToStr(AlertPct,0) + Spaces(1) + "percent of average." ); end;

No comments: