Log in to see Cloud of Tags

Wealth-Lab Wiki

Syntax

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

Parameter Description

bars The Bars object
period Indicator calculation period

Description

DIMinus 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 directions, as well as the overall strength of the trend. DIPlus is normally used with the DIMinus, DX and ADX indicators and typically uses 14 periods.

The DIMinus value represents downward price movement as a percentage of true range. The more each down bar's price is equal to the true range, the larger the value of the DIMinus. The DIPlus and the DIMinus are not mirror images.

Interpretation

  • DIMinus measures a market's negative directional movement. If DIMinus is greater then DIPlus, prices have a stronger negative directional movement.
  • If prices fall for the number of periods specified then the DIMinus would be a high value and the DIPlus value would be near zero.
  • If prices rise for the number of periods specified then the DIMinus value would be near zero and DIPlus would have a high value.
  • If prices fluctuate for the number of periods specified, like in a trading range, then DIPlus and DIMinus will have similar values.
  • The greater the difference between the DIPlus and DIMinus the stronger the trend. The DX indicator takes advantage of this.

Calculation

-DI = Round( ( -DM / TR )* 100 )

where,
-DI = DIMinus
TR = True Range of current bar

The -DI is then smoothed over the Period specified, the same way as a simple moving average, and, -DM is calculated as follows:

  1. For uptrending days, -DM = zero
  2. For downtrending days, -DM = yesterday's low - today's low
  3. For inside days, -DM = zero
  4. For outside days, if yesterday's low - today's low, is greater than today's high- yesterday's high, then -MD = yesterday's low - today's low, otherwise -DM = zero
  5. For upwards gap days, -DM = zero
  6. For downwards gap days, -DM = yesterday's low - today's low


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 { protected override void Execute() { // Color bars green when DI+ > DI-, otherwise color them red ChartPane ADXPane = CreatePane( 50, true, true ); PlotSeries( ADXPane, DIMinus.Series( Bars, 14 ), Color.Red, LineStyle.Solid, 2 ); PlotSeries( ADXPane, DIPlus.Series( Bars, 14 ), Color.Green, LineStyle.Solid, 2 ); // DIPlus and DIMinus require stabilizing so start the bar count 3 to 4 times their period for(int bar = 50; bar < Bars.Count; bar++) { if( DIPlus.Series( Bars, 14 )bar > DIMinus.Series( Bars, 14 )bar ) SetBarColor( bar, Color.Green ); else SetBarColor( bar, Color.Red ); } } } }

Important Disclaimer: The information provided by Wealth-Lab is strictly for informational purposes and is not to be construed as advice or solicitation to buy or sell any security.  The owner of Wealth-Lab.com assumes no liability resulting from the use of the material contained herein for investment purposes. By using this web site, you agree to the terms of this disclaimer and our Terms of Use.


ScrewTurn Wiki. Some of the icons created by FamFamFam.