PivotReversalGen (Function)

image\trumpet2.gif Disclaimer

The PivotReversalGen series function provides a generalized approach to identifying pivot reversals.

Usage

PivotReversalGen(MinRStren, MaxRStren, LRFactor, HiLo, DrawLines, LinesColor, oPivotPrice, oPivotRStren, oPivotLStren)

Returns (Integer)

The oPivotPrice, oPivotRStren,and oPivotLStren output parameters return the price value of the pivot point along with the right and left strength values from the pivot.  The PivotReversalGen function itself returns a value of 1 if a pivot is found, and -1 if not found.

A numeric value of 1 in returned if the specified reversal pattern was found, 0 if not found.

Parameters

Name

Type

Description

MinRStren

Numeric

Sets the minimum right strength range value.

MaxRStren

Numeric

Sets the maximum right strength range value.

LRFactor

Numeric

Sets the multiplier used to calculate the left strength based on the right strength.

HiLo

Numeric

Sets the type of reversal to identify.  1=high pivot, -1=low pivot.

DrawLines

Boolean

Sets whether a horizontal line should be drawn from previous pivot lows to the current bar.  True=draw line, False=no line.

LinesColor

Numeric

Sets the color of horizontal marker lines.

oPivotPrice

Numeric

Outputs the actual price value of the pivot bar.

oPivotRStren

Numeric

Outputs the right strength value of the pivot bar.

oPivotLStren

Numeric

Outputs the left strength value of the pivot bar.

Remarks

The function identifies when any price on the current bar breaches any previously un-breached "significant"  high or low pivot reversal.  If the current bar breaches more than one previously unbreached "significant" high pivots, the outputs pertain to the first pivot breached.  The optional pointers, however, are drawn from each pivot high to the current bar.

A pivot is considered "significant" if its right strength is within the range specified by the MinRStren and MaxRStren inputs, and its left strength is greater than LRFactor times its right strength.  If LRFactor is set to 0, the pivot's left strength is required to be greater than or equal to MinRStren.

The approach used in this function may also provide a more robust alternative to analysis techniques that look for "new highs" or "new lows", since even there, the real event of interest may be the breaching of a previously un-breached significant high or low point on the chart.

Example

Assigns output values for the pivot price, right strength, and left strength if a low pivot is found based on the minimum strength inputs provided and then draws a magenta, horiztontal from the previous pivot.

Vars: oPivotPrice(0),oPivotRStren(0),oPivotLStren(0);
Value1 = PivotReversalGen(1,30,1,-1,True,Magenta,oPivotPrice,oPivotRStren,oPivotLStren);
if Value1 = 1 then
begin
 Value2 = oPivotPrice;
 Value3 = oPivotRStren;
 Value4 = oPivotLStren;
end;