Determines whether todays price action represents an (up or down) trend, (up or down) gap, or an (inner or outer) range.
public int ClassifyMovements( doubletodaysHigh, doubletodaysLow, doubleyesterdaysHigh, doubleyesterdaysLow );
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:
Up Trend = 1
Down Trend = 2
Up Gap = 3
Down Gap = 4
Outer Range = 5
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:
Up Trend - if (todaysHigh > yesterdaysHigh) and (todaysLow > yesterdaysLow)
Down Trend - if (todaysHigh < yesterdaysHigh) and (todaysLow < yesterdaysLow)
Gap Up - if (todaysHigh > yesterdaysHigh) and (todaysLow > yesterdaysHigh)
Gap Down - if (todaysHigh < yesterdaysLow) and (todaysLow < yesterdaysLow)
Outer Range - if (todaysHigh ≥ yesterdaysHigh) and (todaysLow ≤ yesterdaysLow)
Inner Range - if (todaysHigh ≤ yesterdaysHigh) and (todaysLow ≥ yesterdaysLow)
where:
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
Remarks:
The above cases cover all possible scenarios.
This method may be applied to the calibration of the parameter of a trading
system which depends on the DMI.