Finds the highest value of the series, then return the bars back.

 

The return value is the number of bars back from the starting index. If no starting index is used, then it is the bars back from the current bar. If a starting index offset is used, then the return value is the bars back from that offset.

 

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:

HighestBar( series, bars, [offset] )

 

Parameter:

Description:

series

The name of the series.

bars

The number of bars over which to find the highest bar value.

[offset]

The number of bars to offset back before finding the value.

 

Example:

VARIABLES: highestCloseBar, highestHighBar, lowestLowBar Type: Price
 
' Find the highest close bar of the last 50 bars
highestCloseBar = HighestBar( instrument.close, 50 )
 
' Find the lowest low bar of the last 100 bars
lowestLowBar = LowestBar( instrument.low, 100 )
 
' Find the highest high bar since the entry of the first unit of the current position
If instrument.position <> OUT THEN
  highestHighBar = HighestBar( instrument.high, instrument.unitBarsSinceEntry )
ENDIF
 
' Now print the close of the highest bar:
PRINT instrument.close[ highestHighBar ]

Returns:

Bar number of the Highest value in the series over the number of bars specified

 

Links:

Highest, Lowest, LowestBar

See Also:

Series Functions

 


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


Topic ID#: 368

 

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