door GM » vr 04 apr 2003, 13:50
{*******************************************************************
Description: This Function returns Pivot High Bar with variable strengths
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}
Inputs: ?Occur(Numeric), Price(NumericSeries), LStren(NumericSimple), RStren(NumericSimple), Length(Numeric);
Variables: SHBar(0), MainLoop(0), count(0), PivotFlag(False);
Array: PivotBar[50](0);
For Value1 = 0 to 50 Begin
PivotBar[Value1] = 0 ;
End;
PivotFlag = False;
For MainLoop = Length-1 DownTo Rstren Begin
Condition1 = True;
Condition2 = True;
SHBar = Price[MainLoop];
For value1 = MainLoop - RStren To MainLoop - 1 Begin
If SHBar <= Price[value1] Then
Condition1 = False;
End;
If Condition1 Then Begin
For value1 = MainLoop + 1 To MainLoop + LStren Begin
If SHBar < Price[value1] Then
Condition2 = False;
End;
End Else
Condition2 = False;
If Condition1 AND Condition2 Then Begin
For count = 50 DownTo 2 Begin
PivotBar[count] = PivotBar[count-1];
End;
PivotBar[1] = MainLoop;
PivotFlag = True;
End;
End;
If PivotFlag AND PivotBar[Occur] <> 0 Then
PivotHighVSBar = PivotBar[Occur] + CurrentBar - BarNumber
Else
PivotHighVSBar = -1;