QuantStudio Financial Data Analysis and Trading Framework

PDM Class

Plus Directional Movement (PDM)

For a list of all members of this type, see PDM Members.

System.Object
   RQuant.Indicator.TTimeArray
      RQuant.Indicator.TDoubleArray
         RQuant.Indicator.TIndicator
            RQuant.Indicator.PDM

[Visual Basic]
Public Class PDM
    Inherits TIndicator
[C#]
public class PDM : TIndicator

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The concept of Directional Movement is based on the assumption that in an upward trend today?s highest price is higher than yesterday?s highest price and in a downward trend today?s lowest price is lower than yesterday?s lowest price. If this is the case, it is a matter of the so-called Outside Days. The difference between today?s high and yesterday?s high corresponds to the Plus Directional Movement (PDI). The difference between today?s low and yesterday?s low is the Minus Directional Movement (MDM). These Outside Days consist of a PDM as well as an MDM.

Days in which yesterday?s highest price or yesterday?s lowest price are not exceeded are described as Inside Days and contain a PDM and an MDM, or zero. Do not let the plus or minus sign designation mislead you. They only indicate upward or downward movement, not values. The directional movement value is always a positive number of absolute value, regardless of upward or downward movement. In the Directional Movement calculation, Inside Days are consequently not taken into account. It is possible for the directional movement to be zero. This occurs when the current trading range is inside the previous trading range, or when the trading ranges, current versus previous, are equal.

Formula:

Example

TDataManager.cd("Demo");

TDailyArray Daily1 = TDataManager.GetStock("YHOO").DailyArray;

DateTime Date1 = DateTime.Parse("1999/02/08"); 
DateTime Date2 = DateTime.Parse("2000/12/29"); 

TDailyArray Daily = Daily1.Clone(Date1, Date2);

TCanvas Canvas = new TCanvas("Canvas","PDM DEMO",600,400);

PDM PDM = new PDM(Daily);

Canvas.cd(1);
Daily.Draw("c");

Canvas.cd(2);
PDM.Draw();    

Requirements

Namespace: RQuant.Indicator

Assembly: RQuant.Indicator (in RQuant.Indicator.dll)

See Also

PDM Members | RQuant.Indicator Namespace