public RainbowOsc(DataSeries ds, int period, int levels, string description): base(ds, description) public static RainbowOsc Series (DataSeries ds, int period, int levels )
using System; using System.Collections.Generic; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators; using TASCIndicators;namespace WealthLab.Strategies { public class MyStrategy : WealthScript { Random r = new Random(); private Color RandomColor() { Color randomColor = Color.FromArgb(r.Next(255), r.Next(255), r.Next(255)); return randomColor; } protected override void Execute() { DataSeries Price = Close; int Length = 2, Level = 10; List lst = new List(); lst.Add( SMA.Series(Price, Length) ); // Rainbow Charts for( int i = 1; i < Level; i++ ) { DataSeries ds = SMA.Series( lstlst.Count - 1, Length ); ds.Description = string.Format( "Rainbow({0})", i ); lst.Add( ds ); PlotSeries( PricePane, ds, RandomColor(), LineStyle.Solid, 1 ); } // Rainbow Oscillator DataSeries RO = RainbowOsc.Series( Price, Length, Level ); ChartPane roPane = CreatePane( 30,true,true ); PlotSeries( roPane, RO, Color.Blue, LineStyle.Histogram, 3 ); } } }