Beispiel #1
0
        void UpdateValues()
        {
            base.ClearValues();
            foreach (IndicatorResultSet resultSet in _indicator.Results.ResultSets)
            {
                AddValueSet(GeneralHelper.DoublesToFloats(resultSet.Values), _indicator.UI.OutputResultSetsPens[resultSet.Name]);
            }

            base.RaiseValuesUpdated(true);
        }
Beispiel #2
0
        protected void PresentDataSeries(string seriesName, double[] dataValues)
        {
            if (checkBoxShowMA.Checked)
            {// Show the MA
                double[] maValues = MathHelper.CalculateQuickMA(dataValues, (int)this.numericUpDownMAPeriods.Value);
                chartControl.MasterPane.Add(new LinesChartSeries(seriesName + "MA" + ((int)this.numericUpDownMAPeriods.Value).ToString(), LinesChartSeries.ChartTypeEnum.Line, GeneralHelper.DoublesToFloats(maValues)));
            }

            chartControl.MasterPane.Add(new LinesChartSeries(seriesName, LinesChartSeries.ChartTypeEnum.Line, GeneralHelper.DoublesToFloats(dataValues)));
        }
Beispiel #3
0
        private void buttonCalculate_Click(object sender, EventArgs e)
        {
            List <double> positiveResults = new List <double>();
            List <double> negativeResults = new List <double>();

            for (int i = 0; i < (int)numericUpDownIterations.Value; i++)
            {
                int positives, negatives;
                PerformConsecutivesIteration(out positives, out negatives);

                if (positiveResults.Count < positives + 1)
                {
                    positiveResults.AddRange(new double[positives - positiveResults.Count + 1]);
                    negativeResults.AddRange(new double[positives - negativeResults.Count + 1]);
                }

                if (negativeResults.Count < negatives + 1)
                {
                    positiveResults.AddRange(new double[negatives - positiveResults.Count + 1]);
                    negativeResults.AddRange(new double[negatives - negativeResults.Count + 1]);
                }

                positiveResults[positives] = positiveResults[positives] + 1;
                negativeResults[negatives] = negativeResults[negatives] + 1;
            }

            graphControl.Clear();
            LinesChartSeries series1 = new LinesChartSeries("+", LinesChartSeries.ChartTypeEnum.Histogram, GeneralHelper.DoublesToFloats(positiveResults.ToArray()));

            series1.DefaultPen = Pens.Green;
            graphControl.MasterPane.Add(series1);

            LinesChartSeries series2 = new LinesChartSeries("-", LinesChartSeries.ChartTypeEnum.Histogram, GeneralHelper.DoublesToFloats(negativeResults.ToArray()));

            series2.DefaultPen = Pens.Red;
            graphControl.MasterPane.Add(series2);

            graphControl.MasterPane.FitDrawingSpaceToScreen(true, true);
        }
        private void buttonShowDistribution_Click(object sender, EventArgs e)
        {
            ChartForm form = new ChartForm("Distribution of results");

            form.Show();

            Dictionary <double, double> distributedResults = MathHelper.CalculateValueDistribution(_results[listBoxResults.SelectedIndex], 256);

            double[] distributedValues   = GeneralHelper.EnumerableToArray(distributedResults.Values);
            double[] distributedValuesMA = MathHelper.CalculateQuickMA(distributedValues, 12);



            form.Chart.MasterPane.Add(new LinesChartSeries("Value distribution", LinesChartSeries.ChartTypeEnum.Histogram, GeneralHelper.DoublesToFloats(distributedValues)), true, false);
            form.Chart.MasterPane.Add(new LinesChartSeries("Value distribution MA 12", LinesChartSeries.ChartTypeEnum.Line, GeneralHelper.DoublesToFloats(distributedValuesMA)), true, false);
        }