Highest
Syntax
Description
The highest
function calculates the highest value over a specified period for a given symbol or array of numerical data. It identifies the maximum value within the specified length of time. By default, it uses the closing price, but you can specify a different property using the prop
option.
Returns
The highest
function returns a single highest value by default. If the rolling
option is specified, it returns an array of highest values for the specified rolling period.
Parameters
len
: The length of the period over which to calculate the highest value.symbol
ordata
: Either the symbol for which to calculate the highest value or an array of numerical data.options?
(optional): An object with the following optional properties:rolling
: The number of days for which to return the highest values. If specified, an array of highest values is returned.offset
: The number of days ago to start the calculation. Default is 0 (current day).prop
: The property of the data to use for calculation. Default is'close'
. This option is only applicable when using with symbol.
Examples
Using with Symbol and Length
Using with Data Array
Use Cases
Identifying Peaks in Price Data:
Setting Stop Loss Levels Based on High Price:
Notes
- The
highest
function is commonly used in technical analysis to identify peaks in price data and set stop loss levels. - By specifying a different property, such as high price, traders can analyze different aspects of price movements and make informed trading decisions.
- Traders often use the highest value in conjunction with other indicators to manage risk effectively and optimize trading strategies.