ADX

Modified on 2008/04/13 14:56 by Administrator — Categorized as: Standard Indicators

Syntax

public static ADX Series(WealthLab.Bars bars, int period)

Parameter Description

Bars The Bars object
period Indicator period

Description

ADX stands for Average Directional movement Index and is used to measure the overall strength of the trend. The ADX indicator is an average of DX values. The ADX is a component of the Directional Movement System developed by Welles Wilder. This system attempts to measure the strength of price movement in positive and negative direction using the DIPlus and DIMinus indicators along with the ADX.

Interpretation

The ADX is an excellent indicator for showing trend strength. The larger its value the stronger the current trend. A value above 25 is considered to be a trending market.

Calculation

ADX is equivalent to the Wilder's moving average (see WilderMA) of the direction movement (DX) over the specified Period.

Example

using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;

namespace WealthLab.Strategies { public class MyStrategy : WealthScript { private StrategyParameter paramPeriod; public MyStrategy() { paramPeriod = CreateParameter("ADX Period", 10, 10, 30, 1); } // Thank you fundtimer public Color WS4ColorToNET( double WS4Color ) { return Color.FromArgb( (int)Math.Floor( ( WS4Color % 1000 ) / 100 * 28.4 ), (int)Math.Floor( ( WS4Color % 100 ) / 10 * 28.4 ), (int)Math.Floor( WS4Color % 10 * 28.4 ) ); } protected override void Execute() { // Use ADX to determine how much prices are trending, color bars accordingly int period = paramPeriod.ValueInt;

// ADX is one of "unstable" indicators, see Language Guide for information for(int bar = period*3; bar < Bars.Count; bar++) SetBarColor( bar, WS4ColorToNET( Math.Round( ADX.Series( Bars, period )bar / 5 )*100 ) ); } } }