public static DIMinus Series(WealthLab.Bars bars, int period)
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 ); } } } }