WebCab Technical Analysis for COM v1.1

Momentum.Highest Method 

Returns the highest value of all prices within a given look back period.

public double Highest(
   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 previous periods over which the highest value is found (i.e. the look back period).

Return Value

The highest value of the specified (look back) period.

Remarks

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 value of the highest value is 103, which is the highest 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 | WebCab.COM.Finance.Trading.Indicators Namespace | HighestPeriod