using System; using System.Text; using System.Drawing; using WealthLab; using WealthLab.Indicators;namespace WealthLab.Strategies { public class JKHiLoIndex : WealthScript { protected override void Execute() { DataSeries J = GetExternalSymbol("%JKHL",true).Close; //Adaptive thresholds for the JK HiLo Index BBandUpper bbu = BBandUpper.Series( J, 100, 2.0 ); BBandLower bbl = BBandLower.Series( J, 100, 2.0 ); // Plotting JK HiLo Index HideVolume(); ChartPane jPane = CreatePane(45,true,true); PlotSeries( jPane, J, Color.DarkBlue, LineStyle.Solid, 2); PlotSeriesFillBand( jPane, bbu, bbl, Color.Blue, Color.FromArgb( 30, Color.Blue ), LineStyle.Solid, 1 ); for(int bar = bbu.FirstValidValue; bar < Bars.Count; bar++) { bool sellZone = J[bar] >= bbu[bar]; bool buyZone = J[bar] <= bbl[bar]; if( sellZone ) SetBackgroundColor( bar, Color.FromArgb( 30, Color.Green ) ); if( buyZone ) SetBackgroundColor( bar, Color.FromArgb( 30, Color.Red ) ); } } } }