﻿ SwingLow

# SwingLow

Finds the swing low value.

This example shows the use of the common auto indexed series.

For information on using functions with non auto indexed series review Series Functions.

Syntax:

swingValue = SwingLow( series, [occurrence], [forwardStrengthBars], [backwardStrengthBars], [lookbackBars], [offsetBars] )

Parameter:

Description:

series

Series to search for Swing-Low.

occurrence

Swing-Low occurrence to locate.

Default is to enter 1 for the most recent Swing-Low location.  First occurrence of a Swing-Low return value is the count of bars back from the current bar's location.

A value of 2 will locate the second occurrence back, etc.

forwardStrengthBars

Value entered determines how many bars forward to check to determine if a Swing-Low occurred.  Default value is to check 1 bar.

If all forwardStrengthBars are higher than the bar, then the Swing-Low occurred.

If any are equal, then the Swing-Low did not occur.

Flat bottoms are ignored.

backwardStrengthBars

Number of bars backward to check for a given bar to determine if a Swing-Low occurred.

Default is to check forwardStrengthBars number of bars.

If all backwardStrengthBars are higher than the bar, then the swing occurred.

If any are equal, then the swing did not occur. Flat bottoms are ignored.

lookbackBars

Number of bars to offset before searching the data.

Default is 0 to start the search using the current bar.

offset

Number of bars back from the offset value to start-value to search for a Swing-Low.

Example:

'  Checks the last 500 bars.

'  Find the second occurrence back
'  where the later 4 and prior 5 bar
'  values were higher than the current value.
swingValue = SwingLow( instrument.low, 2, 4, 5, 500 )

'  This example shows the use of the
'  common auto indexed series.
'
'  For information on using functions
'  with non auto indexed series review Series Functions.

Returns:

Value returns the Low price found when  Swing-Low price is found.  When a Swing-Low price is not found, function returns a -1.