コード例 #1
0
        public Response GetFreshResponseInstance()
        {
            var freshResponse = ResponseLoader.FromDLL(ResponseName, ResponsePath);

            PlottingUtilities.CopyParameters(SelectedResponse, freshResponse);
            return(freshResponse);
        }
コード例 #2
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;
        }
コード例 #3
0
        public ComplexTypeStatisticsModel(IEnumerable <T> sampleInstances)
        {
            var viewableType       = typeof(T);
            var viewableProperties = PlottingUtilities.GetAllPlottableValues(viewableType);

            ViewableProperties = new ObservableCollection <PlottableProperty>(viewableProperties);
            _sampleInstances   = new ObservableCollection <T>(sampleInstances);
        }
コード例 #4
0
        public void PopulatePlottableValues()
        {
            PlottableValues.Clear();
            var plottableType = typeof(DarkLightResults);
            var plottableList = PlottingUtilities.GetAllPlottableValues(plottableType);

            foreach (var plottableValue in plottableList)
            {
                PlottableValues.Add(plottableValue);
            }
        }
コード例 #5
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));
            }
        }
コード例 #6
0
        private void Setup()
        {
            _time = 0;

            var _colors = PlottingUtilities.GetLegacyColorList(_symbols.Count);

            for (int i = 0; i < _symbols.Count; i++)
            {
                _symbolColorMap.Add(_symbols[i], _colors[i]);
            }

            _barListTracker            = new BarListTracker();
            _barListTracker            = new BarListTracker(_intervalValues, _intervalTypes);
            _barListTracker.GotNewBar += _barListTracker_GotNewBar;
            isValid = true;
        }
コード例 #7
0
 public void PopulateAdjustableProperties()
 {
     if (_selectedResponse != null)
     {
         _adjustableProperties.Clear();
         var responseType           = _selectedResponse.GetType();
         var adjustablePropertyList = PlottingUtilities.GetAllAdjustableProperties(responseType);
         var headerItem             = new AdjustableProperty
         {
             PropertyName = AdjustableProperty._header,
         };
         AdjustableProperty1 = headerItem;
         AdjustableProperties.Add(headerItem);
         foreach (var adjustableProperty in adjustablePropertyList)
         {
             AdjustableProperties.Add(adjustableProperty);
         }
     }
 }
コード例 #8
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));
            }
        }