コード例 #1
0
        void backtestComplete()
        {
            string[] r = _messageBuilder.ToString().Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
            foreach (string l in r)
            {
                //_activityModel.Messages.Add(new ObservableMessage {Message = l});
                Messages.Add(new ObservableMessage {
                    Message = l
                });
            }

            IndicatorTable = _indicatorTable;
            TickTable      = _tickCollection;
            OrderTable     = _orderCollection;
            FillTable      = _fillCollection;
            PositionTable  = _positionCollection;

            Plots = new ObservableCollection <TimePlot>(_plotMap.Values);
            //_updatePlots();

            //ResultsTable = _resultsModel.RunResults(_responseName + "." + _prettyTickDataFiles, _tradeList);

            var name           = _responseName + "." + _prettyTickDataFiles;
            var resultInstance = DarkLightResults.GetDarkLightResults(name, _tradeList, PublishMessage, 0.0001m, 0.0012m);

            ResultsList = new ObservableCollection <KeyValuePair <string, string> >(PlottingUtilities.GetFieldAndPropertyValueList(resultInstance));
            Results     = resultInstance;

            var de = new DarkLightEventArgs(EventType.SessionEnd);

            _publish(de);

            _activityModel.NumberTestsCompleted = _activityModel.NumberTestsCompleted + 1;
        }
コード例 #2
0
        public void PopulateDescriptiveStatistics(PlottableProperty plottableProperty)
        {
            var plottableValues = SampleInstances.Select(i => new PlottableValue <T> {
                X = SampleInstances.IndexOf(i), Value = i
            }).ToList();
            var plottablePoints = PlottingUtilities.ToPlottable <T>(plottableValues, plottableProperty).Select(p => p.Y).ToArray();

            if (plottablePoints.Count() != 0)
            {
                PopulateBins(plottablePoints, _numberBins, plottableProperty.PropertyName);
                Descriptive descriptiveStats = new Descriptive(plottablePoints);
                descriptiveStats.Analyze();
                Statistics     = descriptiveStats.Result;
                StatisticsList = new ObservableCollection <KeyValuePair <string, string> >(PlottingUtilities.GetFieldAndPropertyValueList(descriptiveStats.Result));
            }
        }
コード例 #3
0
        public void PopulateDescriptiveStatistics(PlottableProperty plottableProperty)
        {
            var plottableValues = Array.ConvertAll(SampleInstances[plottableProperty.PropertyName].ToArray(), input => Convert.ToDouble(input));

            if (plottableValues.Count() != 0)
            {
                PopulateBins(plottableValues, _numberBins, plottableProperty.PropertyName);
                Descriptive descriptiveStats = new Descriptive(plottableValues);
                descriptiveStats.Analyze();
                Statistics     = descriptiveStats.Result;
                StatisticsList = new ObservableCollection <KeyValuePair <string, string> >(PlottingUtilities.GetFieldAndPropertyValueList(descriptiveStats.Result));
            }
        }