WebCab Technical Analysis for COM v1.1

DirectionalMovementIndicator.ClassifyMovements Method 

Determines whether todays price action represents an (up or down) trend, (up or down) gap, or an (inner or outer) range.

public int ClassifyMovements(
   double todaysHigh,
   double todaysLow,
   double yesterdaysHigh,
   double yesterdaysLow
);

Parameters

todaysHigh
The highest traded value which the asset under consideration takes during todays market action.
todaysLow
The lowest traded value which the asset under consideration takes during todays market action.
yesterdaysHigh
The highest traded value which the asset under consideration takes during yesterdays market action.
yesterdaysLow
The lowest traded value which the asset under consideration takes during yesterdays market action.

Return Value

Returns an integer depending on the classification of the past two days price action. Where the integer returned is in accordance with the following key:

  1. Up Trend = 1
  2. Down Trend = 2
  3. Up Gap = 3
  4. Down Gap = 4
  5. Outer Range = 5
  6. Inner Range = 6

Remarks

The classification of the price movement will be required by the Directional Movement Indicator (DMI) approach in comparing the previous days price action to todays price action.

Trends, Gaps and Ranges

Here we detail explicitly what we mean by the terms trend, gap and range. We compare the range of the todays price with yesterdays range of prices and classify the price dynamics according to the following categories:

  1. Up Trend - if (todaysHigh > yesterdaysHigh) and (todaysLow > yesterdaysLow)
  2. Down Trend - if (todaysHigh < yesterdaysHigh) and (todaysLow < yesterdaysLow)
  3. Gap Up - if (todaysHigh > yesterdaysHigh) and (todaysLow > yesterdaysHigh)
  4. Gap Down - if (todaysHigh < yesterdaysLow) and (todaysLow < yesterdaysLow)
  5. Outer Range - if (todaysHigh ≥ yesterdaysHigh) and (todaysLow ≤ yesterdaysLow)
  6. Inner Range - if (todaysHigh ≤ yesterdaysHigh) and (todaysLow ≥ yesterdaysLow)

where:

  1. todaysHigh - the highest traded value which the asset under consideration takes during todays market action
  2. todaysLow - the lowest traded value which the asset under consideration takes during todays market action
  3. yesterdaysHigh - the highest traded value which the asset under consideration takes during yesterdays market action
  4. yesterdaysLow - the lowest traded value which the asset under consideration takes during yesterdays market action

Remarks:

  1. The above cases cover all possible scenarios.
  2. This method may be applied to the calibration of the parameter of a trading system which depends on the DMI.

Exceptions

Exception TypeCondition
ArgumentExceptionThrown if any of the parameters todaysHigh, todaysLow, yesterdaysHigh or yesterdaysLow is a strictly negative number.

See Also

DirectionalMovementIndicator Class | WebCab.COM.Finance.Trading.Indicators Namespace