An array of the previous values of the positive directional indicator (PDI), where the length of the array is ONE MORE than the number of periods used within the moving average. Where pdi[0] is the latest value of the PDI indicator, pdi[1] is the previous value and so on. Note that the length of the array pdi and mdi, must be identical.
mdi
An array of the previous values of the minus directional indicator (MDI), where the length of the array is one more than the number of periods used within the moving average. Where mdi[0] is the latest value of the MDI indicator, mdi[0] is the previous value and so on. Note that the length of the array pdi and mdi, must be identical.
method
An integer which determines the method used in the evaluation of the moving average in accordance with the following key:
Simple Moving Average
Geometric Moving Average
Linearly Weighted Moving Average
Exponentially Weighted Moving Average with a smoothing weight of 0.5
.
Return Value
Returns -1, 0, or 1 respectively according to whether a sell, no action or buy signal is generated.
Remarks
This signal determines whether a given asset or index should be sold, brought or no
action should be taken for a given asset under consideration. This trading signal
forms the basis of the DMI Trading System which was developed by Welles Wilder.
At its simplest level to DMI system states that when the PDI crosses above the MDI a
buy signal is generated and when the MDI crosses above the PMI then a sell signal is
generated. This however may generate an excessive number of signals and hence we offer
the possibility to smooth out these indicators according to a moving average which will
help to reduce to sensitivity of the trading system.
Advantages to this Approach
This trading approach will reveal a trend before it is detected by most market
participants. Once the trend becomes more widely recognized other market participants
will tend to buy the tend and hence re-enforcing the trend dynamics. Hence the DMI
system offers a good risk/reward trend following system.