Finds the swing high value.  An example shows the use of a common auto indexed series.  For information on using functions with non auto indexed series, review Series Functions.

 

Syntax:

SwingHigh( series, [occurrence], [forwardStrengthBars], [backwardStrengthBars], [lookbackBars], [offsetBars] )

 

Parameter:

Description:

series

Series name to search.

[occurrence]

Occurrence to look for. Default is the first occurrence of this swing high back from the current bar. A value of 2 will find the second occurrence back, etc.

[forwardStrengthBars]

Number of bars forward to check for a given bar to determine if a swing occurred. Default is to check one bar. If all forwardStrengthBars are lower than the bar, then the swing occurred. If any are equal, then the swing did not occur. Flat tops are ignored.

[backwardStrengthBars]

Number of bars backward to check for a given bar to determine if a swing occurred. Default is to check forwardStrengthBars number of bars. If all backwardStrengthBars are lower than the bar, then the swing occurred. If any are equal, then the swing did not occur. Flat tops are ignored.

[lookbackBars]

Total number of bars to check for a swing. Default is to use all available bars.

[offsetBars]

Number of bars to offset before finding the value. The default is 0, using the current bar.

 

Example:

'  Checks the last 500 bars from the current bar location.
 

'  Find the second occurrence back where the

'  later 4 and prior 5 bar values were lower

'  than the current value.
swingValue = SwingHigh( instrument.high, 2, 4, 5, 500 )

 

Returns:

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

 

Links:

SwingHighBars, SwingLow, SwingLowBars

See Also:

Series Functions

 


Edit Time: 9/25/2017 09:09:58 AM


Topic ID#: 595

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software