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.


HighestBar( series, bars, [offset] )





The name of the series.


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


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



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 )
' Now print the close of the highest bar:
PRINT instrument.close[ highestHighBar ]


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



Highest, Lowest, LowestBar

See Also:

Series Functions


Edit Time: 5/10/2017 10:29:34 AM

Topic ID#: 368


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