I was looking for an EL based indicator that compared recent volume today vs an average of same time period over the last X days. I found this code on LBR's website, but I can not get it to compile in MC.
Anyone know how to solve this? This is open code so anyone welcome to it.
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;