maxindex
MAXINDEX
Type:
maxindex
• Category:indicators
Description
Index of highest value over a specified period
Parameters
Name | Type | Description | Required | Default |
---|---|---|---|---|
real | string | Input array | no | |
timeperiod | number | no | 30 |
Help
MAXINDEX
Description
The MAXINDEX worker calculates the index of the highest value over a specified period, providing an indicator for financial markets.
What does this worker do?
This worker takes an input array and a specified time period, then returns the index of the highest value within that period. It helps in identifying the position of the maximum value in the given array over a certain time frame.
How to interpret the results
The result from the MAXINDEX worker is the index position of the highest value in the input array over the specified period. A higher index value indicates that the maximum value occurred later in the period, while a lower index value means it occurred earlier.
Parameters
The MAXINDEX worker accepts the following parameters:
real
- Type: string
- Description: Input array for which the index of the highest value is to be determined.
timeperiod
- Type: number
- Description: The specified period over which the highest value's index is calculated.
- Default: 30
Example Usage
To use the MAXINDEX worker, provide the input array and optionally specify the time period. If the time period is not provided, it defaults to 30.
{
"real": [10, 20, 30, 40, 50],
"timeperiod": 5
}
This example calculates the index of the highest value in the array [10, 20, 30, 40, 50]
over a period of 5. The highest value is 50, and its index is 4. Therefore, the worker would return 4
.