public void ThrowIfNotInitialized()
        {
            var strategy = new GridSearchOptimizationStrategy();

            Assert.Throws <InvalidOperationException>(() =>
            {
                strategy.PushNewResults(OptimizationResult.Initial);
            });
        }
            public void SinglePoint(decimal step)
            {
                var args = new HashSet <OptimizationParameter>()
                {
                    new OptimizationStepParameter("ema-fast", 0, 0, step),
                    new OptimizationStepParameter("ema-slow", 0, 0, step),
                    new OptimizationStepParameter("ema-custom", 1, 1, step)
                };

                _strategy.Initialize(new Target("Profit", new Maximization(), null), new List <Constraint>(), args, new StepBaseOptimizationStrategySettings());

                _strategy.NewParameterSet += (s, parameterSet) =>
                {
                    Assert.AreEqual(0, parameterSet.Value["ema-fast"].ToDecimal());
                    Assert.AreEqual(0, parameterSet.Value["ema-slow"].ToDecimal());
                    Assert.AreEqual(1, parameterSet.Value["ema-custom"].ToDecimal());
                };

                _strategy.PushNewResults(OptimizationResult.Initial);
            }