WebCab Technical Analysis Web Services for Delphi v1.1

Momentum.LowestPosition Method 

Returns the position in which lowest value of the prices array for the specified period was recorded.

public int LowestPosition(
   double[] prices,
   int noOfPeriods
);

Parameters

prices
An array of length equal to the number of periods considered in the indicator evaluation where the first element is the price in the last trading period, the second term is the price in the previous trading period and so on.
noOfPeriods
The number of periods before to which the price is compared.

Return Value

An integer which represent the number of periods before the lowest value was registered.

Remarks

If there are two prices with the same lowest value over the period considered then the position of the most recent lowest price is returned.

Example

We illustrate the application of this method with the following example. If the prices over the past five periods are: { 102, 101, 100, 103, 102 }, and the look back period has 3 periods, then the position of the lowest is 2, corresponding to 100, which is the lowest value within { 101, 100, 103, 102 }.

Exceptions

Exception TypeCondition
ArgumentExceptionThrown if prices array has strictly negative elements or if the noOfPeriods argument is greater then the length of prices array.

See Also

Momentum Class | Indicators Namespace