Visual Basic (Declaration) | |
---|---|
Overloads Public Shared Function DMISignal( _ ByVal sc As SeriesCollection, _ ByVal method As Integer, _ ByVal lengthOfMA As Integer _ ) As SeriesCollection |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public static SeriesCollection DMISignal( SeriesCollection sc, int method, int lengthOfMA ) |
Parameters
- sc
- A collection of financial series objects. For example, to evaluate this indicator for two series you will need to pass a series collection containing this two series.Please note that in order to calculate this indicator the elements of the financial series must contain High, Low and Close values.
- method
- Determines the methods used for the evaluation of the moving average in accordance
with the following key:
- 1 = Simple moving average
- 2 = Geometric moving average
- 3 = Linearly weighted moving average
- 4 = Exponentially Weighted Moving average within smoothing fact set to be 0.5.
For further details concerning the definition of these moving averages please see the accompanying PDF documentation or the API documentation for SimpleMovingAverage.
- lengthOfMA
- The number of periods over which the moving average is considered.
Return Value
Returns-1
, 0
, or 1
respectively according to whether a sell, no action
or buy signal is generated.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.