chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using QuantConnect.Optimizer.Objectives;
|
||||
using QuantConnect.Optimizer.Parameters;
|
||||
|
||||
namespace QuantConnect.Optimizer.Strategies
|
||||
{
|
||||
/// <summary>
|
||||
/// Advanced brute-force strategy with search in-depth for best solution on previous step
|
||||
/// </summary>
|
||||
public class EulerSearchOptimizationStrategy : StepBaseOptimizationStrategy
|
||||
{
|
||||
private object _locker = new object();
|
||||
private readonly HashSet<ParameterSet> _runningParameterSet = new HashSet<ParameterSet>();
|
||||
private int _segmentsAmount = 4;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the strategy using generator, extremum settings and optimization parameters
|
||||
/// </summary>
|
||||
/// <param name="target">The optimization target</param>
|
||||
/// <param name="constraints">The optimization constraints to apply on backtest results</param>
|
||||
/// <param name="parameters">Optimization parameters</param>
|
||||
/// <param name="settings">Optimization strategy settings</param>
|
||||
public override void Initialize(Target target, IReadOnlyList<Constraint> constraints, HashSet<OptimizationParameter> parameters, OptimizationStrategySettings settings)
|
||||
{
|
||||
var stepSettings = settings as StepBaseOptimizationStrategySettings;
|
||||
if (stepSettings == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(settings),
|
||||
"EulerSearchOptimizationStrategy.Initialize: Optimizations Strategy settings are required for this strategy");
|
||||
}
|
||||
|
||||
if (stepSettings.DefaultSegmentAmount != 0)
|
||||
{
|
||||
_segmentsAmount = stepSettings.DefaultSegmentAmount;
|
||||
}
|
||||
|
||||
base.Initialize(target, constraints, parameters, settings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether new lean compute job better than previous and run new iteration if necessary.
|
||||
/// </summary>
|
||||
/// <param name="result">Lean compute job result and corresponding parameter set</param>
|
||||
public override void PushNewResults(OptimizationResult result)
|
||||
{
|
||||
if (!Initialized)
|
||||
{
|
||||
throw new InvalidOperationException($"EulerSearchOptimizationStrategy.PushNewResults: strategy has not been initialized yet.");
|
||||
}
|
||||
|
||||
lock (_locker)
|
||||
{
|
||||
if (!ReferenceEquals(result, OptimizationResult.Initial) && string.IsNullOrEmpty(result?.JsonBacktestResult))
|
||||
{
|
||||
// one of the requested backtests failed
|
||||
_runningParameterSet.Remove(result.ParameterSet);
|
||||
return;
|
||||
}
|
||||
|
||||
// check if the incoming result is not the initial seed
|
||||
if (result.Id > 0)
|
||||
{
|
||||
_runningParameterSet.Remove(result.ParameterSet);
|
||||
ProcessNewResult(result);
|
||||
}
|
||||
|
||||
if (_runningParameterSet.Count > 0)
|
||||
{
|
||||
// we wait till all backtest end during each euler step
|
||||
return;
|
||||
}
|
||||
|
||||
// Once all running backtests have ended, for the current collection of optimization parameters, for each parameter we determine if
|
||||
// we can create a new smaller/finer optimization scope
|
||||
if (Target.Current.HasValue && OptimizationParameters.OfType<OptimizationStepParameter>().Any(s => s.Step > s.MinStep))
|
||||
{
|
||||
var boundaries = new HashSet<OptimizationParameter>();
|
||||
var parameterSet = Solution.ParameterSet;
|
||||
foreach (var optimizationParameter in OptimizationParameters)
|
||||
{
|
||||
var optimizationStepParameter = optimizationParameter as OptimizationStepParameter;
|
||||
if (optimizationStepParameter != null && optimizationStepParameter.Step > optimizationStepParameter.MinStep)
|
||||
{
|
||||
var newStep = Math.Max(optimizationStepParameter.MinStep.Value, optimizationStepParameter.Step.Value / _segmentsAmount);
|
||||
var fractal = newStep * ((decimal)_segmentsAmount / 2);
|
||||
var parameter = parameterSet.Value.First(s => s.Key == optimizationParameter.Name);
|
||||
boundaries.Add(new OptimizationStepParameter(
|
||||
optimizationParameter.Name,
|
||||
Math.Max(optimizationStepParameter.MinValue, parameter.Value.ToDecimal() - fractal),
|
||||
Math.Min(optimizationStepParameter.MaxValue, parameter.Value.ToDecimal() + fractal),
|
||||
newStep,
|
||||
optimizationStepParameter.MinStep.Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
boundaries.Add(optimizationParameter);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var staticParam in OptimizationParameters.OfType<StaticOptimizationParameter>())
|
||||
{
|
||||
boundaries.Add(staticParam);
|
||||
}
|
||||
OptimizationParameters = boundaries;
|
||||
}
|
||||
else if (!ReferenceEquals(result, OptimizationResult.Initial))
|
||||
{
|
||||
// we ended!
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var parameterSet in Step(OptimizationParameters))
|
||||
{
|
||||
OnNewParameterSet(parameterSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles new parameter set
|
||||
/// </summary>
|
||||
/// <param name="parameterSet">New parameter set</param>
|
||||
protected override void OnNewParameterSet(ParameterSet parameterSet)
|
||||
{
|
||||
_runningParameterSet.Add(parameterSet);
|
||||
base.OnNewParameterSet(parameterSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace QuantConnect.Optimizer.Strategies
|
||||
{
|
||||
/// <summary>
|
||||
/// Find the best solution in first generation
|
||||
/// </summary>
|
||||
public class GridSearchOptimizationStrategy : StepBaseOptimizationStrategy
|
||||
{
|
||||
private object _locker = new object();
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether new lean compute job better than previous and run new iteration if necessary.
|
||||
/// </summary>
|
||||
/// <param name="result">Lean compute job result and corresponding parameter set</param>
|
||||
public override void PushNewResults(OptimizationResult result)
|
||||
{
|
||||
if (!Initialized)
|
||||
{
|
||||
throw new InvalidOperationException($"GridSearchOptimizationStrategy.PushNewResults: strategy has not been initialized yet.");
|
||||
}
|
||||
|
||||
lock (_locker)
|
||||
{
|
||||
if (!ReferenceEquals(result, OptimizationResult.Initial) && string.IsNullOrEmpty(result?.JsonBacktestResult))
|
||||
{
|
||||
// one of the requested backtests failed
|
||||
return;
|
||||
}
|
||||
|
||||
// check if the incoming result is not the initial seed
|
||||
if (result.Id > 0)
|
||||
{
|
||||
ProcessNewResult(result);
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (var parameterSet in Step(OptimizationParameters))
|
||||
{
|
||||
OnNewParameterSet(parameterSet);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using QuantConnect.Optimizer.Objectives;
|
||||
using QuantConnect.Optimizer.Parameters;
|
||||
|
||||
namespace QuantConnect.Optimizer.Strategies
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the optimization settings, direction, solution and exit, i.e. optimization strategy
|
||||
/// </summary>
|
||||
public interface IOptimizationStrategy
|
||||
{
|
||||
/// <summary>
|
||||
/// Fires when new parameter set is retrieved
|
||||
/// </summary>
|
||||
event EventHandler<ParameterSet> NewParameterSet;
|
||||
|
||||
/// <summary>
|
||||
/// Best found solution, its value and parameter set
|
||||
/// </summary>
|
||||
OptimizationResult Solution { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the strategy using generator, extremum settings and optimization parameters
|
||||
/// </summary>
|
||||
/// <param name="target">The optimization target</param>
|
||||
/// <param name="constraints">The optimization constraints to apply on backtest results</param>
|
||||
/// <param name="parameters">optimization parameters</param>
|
||||
/// <param name="settings">optimization strategy advanced settings</param>
|
||||
void Initialize(Target target, IReadOnlyList<Constraint> constraints, HashSet<OptimizationParameter> parameters, OptimizationStrategySettings settings);
|
||||
|
||||
/// <summary>
|
||||
/// Callback when lean compute job completed.
|
||||
/// </summary>
|
||||
/// <param name="result">Lean compute job result and corresponding parameter set</param>
|
||||
void PushNewResults(OptimizationResult result);
|
||||
|
||||
/// <summary>
|
||||
/// Estimates amount of parameter sets that can be run
|
||||
/// </summary>
|
||||
int GetTotalBacktestEstimate();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
namespace QuantConnect.Optimizer.Strategies
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the specific optimization strategy settings
|
||||
/// </summary>
|
||||
public class OptimizationStrategySettings
|
||||
{
|
||||
/// <summary>
|
||||
/// TODO: implement
|
||||
/// </summary>
|
||||
public TimeSpan MaxRuntime { get; set; } = TimeSpan.MaxValue;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,253 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using QuantConnect.Optimizer.Objectives;
|
||||
using QuantConnect.Optimizer.Parameters;
|
||||
|
||||
namespace QuantConnect.Optimizer.Strategies
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class for any optimization built on top of brute force optimization method
|
||||
/// </summary>
|
||||
public abstract class StepBaseOptimizationStrategy : IOptimizationStrategy
|
||||
{
|
||||
private int _i;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates was strategy initialized or no
|
||||
/// </summary>
|
||||
protected bool Initialized { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optimization parameters
|
||||
/// </summary>
|
||||
protected HashSet<OptimizationParameter> OptimizationParameters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optimization target, i.e. maximize or minimize
|
||||
/// </summary>
|
||||
protected Target Target { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Optimization constraints; if it doesn't comply just drop the backtest
|
||||
/// </summary>
|
||||
protected IEnumerable<Constraint> Constraints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Keep the best found solution - lean computed job result and corresponding parameter set
|
||||
/// </summary>
|
||||
public OptimizationResult Solution { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Advanced strategy settings
|
||||
/// </summary>
|
||||
public OptimizationStrategySettings Settings { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Fires when new parameter set is generated
|
||||
/// </summary>
|
||||
public event EventHandler<ParameterSet> NewParameterSet;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the strategy using generator, extremum settings and optimization parameters
|
||||
/// </summary>
|
||||
/// <param name="target">The optimization target</param>
|
||||
/// <param name="constraints">The optimization constraints to apply on backtest results</param>
|
||||
/// <param name="parameters">Optimization parameters</param>
|
||||
/// <param name="settings">Optimization strategy settings</param>
|
||||
public virtual void Initialize(Target target, IReadOnlyList<Constraint> constraints, HashSet<OptimizationParameter> parameters, OptimizationStrategySettings settings)
|
||||
{
|
||||
if (Initialized)
|
||||
{
|
||||
throw new InvalidOperationException($"GridSearchOptimizationStrategy.Initialize: can not be re-initialized.");
|
||||
}
|
||||
|
||||
Target = target;
|
||||
Constraints = constraints;
|
||||
OptimizationParameters = parameters;
|
||||
Settings = settings;
|
||||
|
||||
foreach (var optimizationParameter in OptimizationParameters.OfType<OptimizationStepParameter>())
|
||||
{
|
||||
// if the Step optimization parameter does not provide a step to use, we calculate one based on settings
|
||||
if (!optimizationParameter.Step.HasValue)
|
||||
{
|
||||
var stepSettings = Settings as StepBaseOptimizationStrategySettings;
|
||||
if (stepSettings == null)
|
||||
{
|
||||
throw new ArgumentException($"OptimizationStrategySettings is not of {nameof(StepBaseOptimizationStrategySettings)} type", nameof(settings));
|
||||
}
|
||||
CalculateStep(optimizationParameter, stepSettings.DefaultSegmentAmount);
|
||||
}
|
||||
}
|
||||
|
||||
Initialized = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether new lean compute job better than previous and run new iteration if necessary.
|
||||
/// </summary>
|
||||
/// <param name="result">Lean compute job result and corresponding parameter set</param>
|
||||
public abstract void PushNewResults(OptimizationResult result);
|
||||
|
||||
/// <summary>
|
||||
/// Calculate number of parameter sets within grid
|
||||
/// </summary>
|
||||
/// <returns>Number of parameter sets for given optimization parameters</returns>
|
||||
public int GetTotalBacktestEstimate()
|
||||
{
|
||||
var total = 1;
|
||||
foreach (var arg in OptimizationParameters)
|
||||
{
|
||||
total *= Estimate(arg);
|
||||
}
|
||||
|
||||
return total;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates number od data points for step based optimization parameter based on min/max and step values
|
||||
/// </summary>
|
||||
private int Estimate(OptimizationParameter parameter)
|
||||
{
|
||||
if (parameter is StaticOptimizationParameter)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
var stepParameter = parameter as OptimizationStepParameter;
|
||||
if (stepParameter == null)
|
||||
{
|
||||
throw new InvalidOperationException($"Cannot estimate parameter of type {parameter.GetType().FullName}");
|
||||
}
|
||||
|
||||
if (!stepParameter.Step.HasValue)
|
||||
{
|
||||
throw new InvalidOperationException("Optimization parameter cannot be estimated due to step value is not initialized");
|
||||
}
|
||||
|
||||
return (int)Math.Floor((stepParameter.MaxValue - stepParameter.MinValue) / stepParameter.Step.Value) + 1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles new parameter set
|
||||
/// </summary>
|
||||
/// <param name="parameterSet">New parameter set</param>
|
||||
protected virtual void OnNewParameterSet(ParameterSet parameterSet)
|
||||
{
|
||||
NewParameterSet?.Invoke(this, parameterSet);
|
||||
}
|
||||
|
||||
protected virtual void ProcessNewResult(OptimizationResult result)
|
||||
{
|
||||
// check if the incoming result is not the initial seed
|
||||
if (result.Id > 0)
|
||||
{
|
||||
if (Constraints?.All(constraint => constraint.IsMet(result.JsonBacktestResult)) != false)
|
||||
{
|
||||
if (Target.MoveAhead(result.JsonBacktestResult))
|
||||
{
|
||||
Solution = result;
|
||||
Target.CheckCompliance();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Enumerate all possible arrangements
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
/// <returns>Collection of possible combinations for given optimization parameters settings</returns>
|
||||
protected IEnumerable<ParameterSet> Step(HashSet<OptimizationParameter> args)
|
||||
{
|
||||
foreach (var step in Recursive(new Queue<OptimizationParameter>(args)))
|
||||
{
|
||||
yield return new ParameterSet(
|
||||
++_i,
|
||||
step.ToDictionary(kvp => kvp.Key, kvp => kvp.Value));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculate step and min step values based on default number of fragments
|
||||
/// </summary>
|
||||
private void CalculateStep(OptimizationStepParameter parameter, int defaultSegmentAmount)
|
||||
{
|
||||
if (defaultSegmentAmount < 1)
|
||||
{
|
||||
throw new ArgumentException($"Number of segments should be positive number, but specified '{defaultSegmentAmount}'", nameof(defaultSegmentAmount));
|
||||
}
|
||||
|
||||
parameter.Step = Math.Abs(parameter.MaxValue - parameter.MinValue) / defaultSegmentAmount;
|
||||
parameter.MinStep = parameter.Step / 10;
|
||||
}
|
||||
|
||||
private IEnumerable<Dictionary<string, string>> Recursive(Queue<OptimizationParameter> args)
|
||||
{
|
||||
if (args.Count == 1)
|
||||
{
|
||||
var optimizationParameterLast = args.Dequeue();
|
||||
using (var optimizationParameterLastEnumerator = GetEnumerator(optimizationParameterLast))
|
||||
{
|
||||
while (optimizationParameterLastEnumerator.MoveNext())
|
||||
{
|
||||
yield return new Dictionary<string, string>()
|
||||
{
|
||||
{optimizationParameterLast.Name, optimizationParameterLastEnumerator.Current}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
yield break;
|
||||
}
|
||||
|
||||
var optimizationParameter = args.Dequeue();
|
||||
using (var optimizationParameterEnumerator = GetEnumerator(optimizationParameter))
|
||||
{
|
||||
while (optimizationParameterEnumerator.MoveNext())
|
||||
{
|
||||
foreach (var inner in Recursive(new Queue<OptimizationParameter>(args)))
|
||||
{
|
||||
inner.Add(optimizationParameter.Name, optimizationParameterEnumerator.Current);
|
||||
|
||||
yield return inner;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator<string> GetEnumerator(OptimizationParameter parameter)
|
||||
{
|
||||
var staticOptimizationParameter = parameter as StaticOptimizationParameter;
|
||||
if (staticOptimizationParameter != null)
|
||||
{
|
||||
return new List<string> { staticOptimizationParameter.Value }.GetEnumerator();
|
||||
}
|
||||
|
||||
var stepParameter = parameter as OptimizationStepParameter;
|
||||
if (stepParameter == null)
|
||||
{
|
||||
throw new InvalidOperationException("");
|
||||
}
|
||||
|
||||
return new OptimizationStepParameterEnumerator(stepParameter);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
|
||||
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace QuantConnect.Optimizer.Strategies
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the specific optimization strategy settings
|
||||
/// </summary>
|
||||
public class StepBaseOptimizationStrategySettings : OptimizationStrategySettings
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the default number of segments for the next step
|
||||
/// </summary>
|
||||
[JsonProperty("default-segment-amount")]
|
||||
public int DefaultSegmentAmount { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user