public static ADX 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 { 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 ) ); } } }