QuantStudio Financial Data Analysis and Trading Framework

ADXR Class

Average Directional Index Rating (ADXR)

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

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

[Visual Basic]
Public Class ADXR
    Inherits TIndicator
[C#]
public class ADXR : 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 Average Directional Index Rating bases its final rating factor for directional movement on a n bar distance of the Average Directional Index (ADX). The calculation of the ADXR represents the total sum of the ADX today and ADX n bars ago divided by 2. Calculating the average of the ADX n bar differential, the ADXR is attributed a good directional movement indicator that does not exceedingly fluctuate relative to equilibrium points. Equilibrium points are reached as a price tops out and begins to drop.

The ADXR is basically an average of ADX. It ranges between the values 0 and 100, measuring the market according to movement. The higher the value, the greater the movement. ADXR does not identify trends or prices; rather, like ADX, it identifies movement and the strength of that movement. Volatility can also be an indicator of movement, though movement does not necessarily imply volatility. Therefore, the ADXR has an edge, since this indicator implies the strength of the movement and can be employed in trend-following systems. It provides an analyst with both a good feel and a visual expression of the strength of a trend, and helps manage investments in volatile markets. The fundamental advantage of the ADXR is that, by being an average of ADX, it does not rise and fall in value as extremely as the ADX does.

Note, that there are two styles of indicator ADXR. Some trading systems use a bit diffrent formula to calculate this indicator. Therefore Quant Studio gives an opportunity to use two styles ADXR - classical (QuantStudio style) and little bit changed (MetaStock style.)

ADXR has QuantStudio style by Default.

Formula for Quant Studio (classical) style:

TDataManager.cd("demo");

TInstrument Instrument = TDataManager.GetInstrument("YHOO");

DateTime Date1 = DateTime.Parse("2000/01/04"); 
DateTime Date2 = DateTime.Parse("2000/12/29"); 

TDailyArray Array = Instrument.DailyArray.Clone(Date1, Date2);

TCanvas Canvas = new TCanvas("Canvas", 600, 800);

Canvas.Divide(1, 4);

Canvas.cd(1);

Array.Draw("C");
Array.SMA(14).Draw("S", Color.Red);

Canvas.Pad.LegendEnabled = true;
Canvas.Pad.SetRangeX(Date1, Date2);

Canvas.cd(2);

Array.DX (14).Draw(Color.Violet);
Array.PDI(14).Draw(Color.Red);
Array.MDI(14).Draw(Color.Blue);

Canvas.Pad.Title.Text = "+/- DI, DX";
Canvas.Pad.LegendEnabled = true;
Canvas.Pad.SetRange(Date1, Date2, 0, 100);

Canvas.cd(3);

Array.ADX (14).Draw(Color.Red);
Array.ADXR(14).Draw(Color.Blue);

Canvas.Pad.Title.Text = "ADX, ADXR";
Canvas.Pad.LegendEnabled = true;
Canvas.Pad.SetRangeX(Date1, Date2);

Canvas.cd(4);

Array.PDM().Draw(Color.Purple);
Array.MDM().Draw(Color.Green);

Canvas.Pad.Title.Text = "+/- DM";
Canvas.Pad.LegendEnabled = true;
Canvas.Pad.SetRangeX(Date1, Date2);



MetaStock formula is the same as in QuantSudio, but ADXR uses ADX indicator, which has two calculation styles in our framework.
TDataManager.cd("demo");

TInstrument Instrument = TDataManager.GetInstrument("YHOO");

DateTime Date1 = DateTime.Parse("2000/01/04"); 
DateTime Date2 = DateTime.Parse("2000/12/29"); 

TDailyArray Array = Instrument.DailyArray.Clone(Date1, Date2);

EIndicatorStyle Style = EIndicatorStyle.MetaStock;

TCanvas Canvas = new TCanvas("Canvas", 600, 800);

Canvas.Divide(1, 4);

Canvas.cd(1);

Array.Draw("C");
Array.SMA(14).Draw("S", Color.Red);

Canvas.Pad.LegendEnabled = true;
Canvas.Pad.SetRangeX(Date1, Date2);

Canvas.cd(2);

Array.DX (14, EIndicatorStyle.MetaStock).Draw(Color.Violet);
Array.PDI(14, EIndicatorStyle.MetaStock).Draw(Color.Red);
Array.MDI(14, EIndicatorStyle.MetaStock).Draw(Color.Blue);

Canvas.Pad.Title.Text = "+/- DI, DX";
Canvas.Pad.LegendEnabled = true;
Canvas.Pad.SetRange(Date1, Date2, 0, 100);

Canvas.cd(3);

Array.ADX (14, Style).Draw(Color.Red);
Array.ADXR(14, Style).Draw(Color.Blue);

Canvas.Pad.Title.Text = "ADX, ADXR";
Canvas.Pad.LegendEnabled = true;
Canvas.Pad.SetRangeX(Date1, Date2);

Canvas.cd(4);

Array.PDM().Draw(Color.Purple);
Array.MDM().Draw(Color.Green);

Canvas.Pad.Title.Text = "+/- DM";
Canvas.Pad.LegendEnabled = true;
Canvas.Pad.SetRangeX(Date1, Date2);

Requirements

Namespace: RQuant.Indicator

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

See Also

ADXR Members | RQuant.Indicator Namespace