private void CreateBars(SolidColorBrush color) { //generation of 32 bar indicators for (int i = 0; i < 32; i++) { BarIndicator bar = new BarIndicator(); bar.Value = 50d; bar.Background = color; ScaleObject.SetLocation(bar, ScaleObjectLocation.Inside); GaugeMeasure offset = new GaugeMeasure(0.028 * i, GridUnitType.Star); ScaleObject.SetOffset(bar, offset); bar.StartWidth = 0.02; bar.EndWidth = 0.02; linearScale.Indicators.Add(bar); } }
private static void RunTestIndicator(BarIndicator indicator) { TestHelper.TestIndicator(indicator, "spy_natr.txt", "NATR_5", (ind, expected) => Assert.AreEqual(expected, (double)ind.Current.Value, 1e-3)); }
private static void RunTestIndicator(BarIndicator indicator) { TestHelper.TestIndicator(indicator, "frama.txt", "Filt", (actual, expected) => {AssertResult(expected, actual.Current.Value);}); }
/// <summary> /// Automatically plots each indicator when a new value is available, optionally waiting for indicator.IsReady to return true /// </summary> public void PlotIndicator(string chart, bool waitForReady, BarIndicator first, BarIndicator second = null, BarIndicator third = null, BarIndicator fourth = null) { PlotIndicator(chart, waitForReady, new[] { first, second, third, fourth }.Where(x => x != null).ToArray()); }
/// <summary> /// Plots the value of each indicator on the chart /// </summary> /// <param name="chart">The chart's name</param> /// <param name="first">The first indicator to plot</param> /// <param name="second">The second indicator to plot</param> /// <param name="third">The third indicator to plot</param> /// <param name="fourth">The fourth indicator to plot</param> /// <seealso cref="Plot(string,string,decimal)"/> public void Plot(string chart, BarIndicator first, BarIndicator second = null, BarIndicator third = null, BarIndicator fourth = null) { Plot(chart, new[] { first, second, third, fourth }.Where(x => x != null).ToArray()); }