Type: Function, Name: PivotPoint
Input: Method(NumericSimple);
If Method <= 1 Then
PivotPoint = (High[1] + Low[1] + Close[1]) / 3;
If Method = 2 Then
PivotPoint = (High[1] + Low[1] + Close[1] + Open) / 4;
If Method >= 3 Then
PivotPoint = (High[1] + Low[1] + Open) / 3;
Type: Indicator, Name: Pivot Point Average
Input: Method(1), Smooth(3);
Variables: Pivot(0), PivotAvg(0), Length(0);
Pivot = PivotPoint(Method);
Length = MaxList(1, Smooth);
PivotAvg = Average(Pivot, Length);
Plot1(Pivot, «Pivot»);
If CurrentBar >= Length Then
Plot2(PivotAvg, «SmoothPivot»);