public static void DrawLinRegChannel(this WealthScript obj, int bar, DataSeries ds, int period, double width, Color color, LineStyle style, int line) public static void DrawLinRegChannel(this WealthScript obj, int bar, DataSeries series, int period, Color color, LineStyle style, int line) public static void DrawLinRegChannel(this WealthScript obj, int bar, DataSeries series, int period, double width, Color color, LineStyle style, int line, StdDevCalculation sdCalc)public void DrawLinRegChannel( WealthScript obj, int bar, DataSeries ds, int period, double width, Color color, LineStyle style, int line) public void DrawLinRegChannel(int bar, DataSeries series, int period, Color color, LineStyle style, int line) public void DrawLinRegChannel(int bar, DataSeries series, int period, double width, Color color, LineStyle style, int line, StdDevCalculation sdCalc)
using System; using System.Drawing; using WealthLab; using WealthLab.Indicators;public class LinRegChannelsDemo: WealthScript { protected override void Execute() { Color col = new Color(); for(int bar = Bars.Count-100; bar < Bars.Count; bar++) { if( Close[bar] > Close[bar-50] ) col = Color.Green; else col = Color.Red; this.DrawLinRegChannel( bar, AveragePrice.Series(Bars), 45, 2, Color.FromArgb(30, col), LineStyle.Solid, 1 ); } } }
using System; using System.Drawing; using WealthLab; using WealthLab.Indicators; using Community.Components; // DrawLinRegChannel herepublic class LinRegChannelsDemo: WealthScript { protected override void Execute() { Calculate calc = new Calculate(this); // pass WealthScript as "this" Color col = new Color(); for(int bar = Bars.Count-100; bar < Bars.Count; bar++) { if( Close[bar] > Close[bar-50] ) col = Color.Green; else col = Color.Red; calc.DrawLinRegChannel( bar, AveragePrice.Series(Bars), 45, 2, Color.FromArgb(30, col), LineStyle.Solid, 1 ); } } }