using System; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;namespace WealthLab.Strategies { public class LFT_demo : WealthScript { protected override void Execute() { DataSeries lftRaw = GetExternalSymbol("%LFT_DOW_30",true).Volume; DataSeries lft = GetExternalSymbol("%LFT_DOW_30",true).Close; lftRaw.Description = "Cumulative A/D (Dow 30)"; lft.Description = "1 Yr Average Cumulative A/D (Dow 30)"; HideVolume(); ChartPane lftPane = CreatePane( 70,true,true ); PlotSeries( lftPane, lftRaw, Color.DarkBlue, LineStyle.Solid, 2); PlotSeries( lftPane, lft, Color.DarkRed, LineStyle.Solid, 2); for(int bar = lft.FirstValidValue; bar < Bars.Count; bar++) { bool buy = lftRaw[bar] > lft[bar]; bool sell = lftRaw[bar] < lft[bar]; if( sell ) SetBackgroundColor( bar, Color.FromArgb( 30, Color.Red ) ); if( buy ) SetBackgroundColor( bar, Color.FromArgb( 30, Color.Green ) ); } } } }