Log in to see Cloud of Tags

**Main Page**- Category List
- Knowledge Base
- Traders Tips
- Indicator documentation
- Addin examples

Log in to search

`public static DIPlus Series(Bars bars, int period)`

bars |
The Bars object |

period |
Indicator calculation period |

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

- DIPlus measures a market's positive directional movement. If DIPlus is greater then DIMinus, prices have a stronger positive directional movement.
- If prices rise for the number of periods specified then the DIPlus would be a high value and the DIMinus value would be near zero.
- If prices fall for the number of periods specified then the DIPlus value would be near zero and DIMinus 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.

where,

DI+ = DIPlus

TR = TrueRange 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:

- For up trending days, +DM = today's high - yesterday's high
- For down trending days, +DM = zero
- For inside days, +DM = zero
- For outside days, if today's high - yesterday's high, is greater than yesterday's low- today's low, then +DM = today's high - yesterday's high, otherwise +DM = zero
- For upwards gap days, +DM = today's high - yesterday's high
- For downwards gap days, +DM = zero

```
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()
{
// Flag bars with dotted lines when DI+ is above 40
ChartPane ADXPane = CreatePane( 50, true, true );
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] > 40 )
DrawLine( PricePane, bar, Low[bar], bar, 0, Color.Green, LineStyle.Dotted, 2 );
}
}
}
}