Typ : Function, Name : BuffAverage
Inputs: Price(Numeric), Length(Numeric);
Variables: VolSum(0), Buff(0);
VolSum = Summation(Volume, Length);
Buff = 0;
If VolSum <> 0 Then Begin
For value1 = 0 To Length — 1 Begin
Buff = Buff + ((Price[value1] * Volume[value1]) / VolSum);
End;
End;
BuffAverage = Buff;
Typ : Indicator, Name : Buff Averages
Inputs: Price(Close), FastAvg(5), SlowAvg(20);
Plot1(BuffAverage(Price, FastAvg), «FastBuff»);
Plot2(BuffAverage(Price, SlowAvg), «SlowBuff»);
If Plot1 Crosses Above Plot2 Then
Alert(«Buff Averages Bullish Crossover.»);
If Plot1 Crosses Below Plot2 Then
Alert(«Buff Averages Bearish Crossover.»);