Class BruteForceOptimizer
- Namespace
- StockSharp.Algo.Strategies.Optimization
- Assembly
- StockSharp.Algo.dll
The brute force optimizer of strategies.
public class BruteForceOptimizer : BaseOptimizer, IPersistable, ILogReceiver, ILogSource, IDisposable
- Inheritance
-
BruteForceOptimizer
- Implements
-
IPersistable
- Derived
- Inherited Members
- Extension Methods
Constructors
BruteForceOptimizer(ISecurityProvider, IPortfolioProvider, IStorageRegistry)
Initializes a new instance of the BruteForceOptimizer.
public BruteForceOptimizer(ISecurityProvider securityProvider, IPortfolioProvider portfolioProvider, IStorageRegistry storageRegistry)
Parameters
securityProvider
ISecurityProviderThe provider of information about instruments.
portfolioProvider
IPortfolioProviderThe portfolio to be used to register orders. If value is not given, the portfolio with default name Simulator will be created.
storageRegistry
IStorageRegistryMarket data storage.
BruteForceOptimizer(ISecurityProvider, IPortfolioProvider, IExchangeInfoProvider, IStorageRegistry, StorageFormats, IMarketDataDrive)
Initializes a new instance of the BruteForceOptimizer.
public BruteForceOptimizer(ISecurityProvider securityProvider, IPortfolioProvider portfolioProvider, IExchangeInfoProvider exchangeInfoProvider, IStorageRegistry storageRegistry, StorageFormats storageFormat = StorageFormats.Binary, IMarketDataDrive drive = null)
Parameters
securityProvider
ISecurityProviderThe provider of information about instruments.
portfolioProvider
IPortfolioProviderThe portfolio to be used to register orders. If value is not given, the portfolio with default name Simulator will be created.
exchangeInfoProvider
IExchangeInfoProviderExchanges and trading boards provider.
storageRegistry
IStorageRegistryMarket data storage.
storageFormat
StorageFormatsThe format of market data. Binary is used by default.
drive
IMarketDataDriveThe storage which is used by default. By default, DefaultDrive is used.
BruteForceOptimizer(IEnumerable<Security>, IEnumerable<Portfolio>, IStorageRegistry)
Initializes a new instance of the BruteForceOptimizer.
public BruteForceOptimizer(IEnumerable<Security> securities, IEnumerable<Portfolio> portfolios, IStorageRegistry storageRegistry)
Parameters
securities
IEnumerable<Security>Instruments, the operation will be performed with.
portfolios
IEnumerable<Portfolio>Portfolios, the operation will be performed with.
storageRegistry
IStorageRegistryMarket data storage.
Methods
GetProgress()
Get progress value.
protected override int GetProgress()
Returns
- int
Operation result.
Start(DateTime, DateTime, IEnumerable<(Strategy strategy, IStrategyParam[] parameters)>, int)
Start optimization.
public void Start(DateTime startTime, DateTime stopTime, IEnumerable<(Strategy strategy, IStrategyParam[] parameters)> strategies, int iterationCount)
Parameters
startTime
DateTimeDate in history for starting the paper trading.
stopTime
DateTimeDate in history to stop the paper trading (date is included).
strategies
IEnumerable<(Strategy strategy, IStrategyParam[] parameters)>The strategies and parameters used for optimization.
iterationCount
intIteration count.
Start(DateTime, DateTime, Func<IPortfolioProvider, (Strategy strategy, IStrategyParam[] parameters)?>, int)
Start optimization.
public void Start(DateTime startTime, DateTime stopTime, Func<IPortfolioProvider, (Strategy strategy, IStrategyParam[] parameters)?> tryGetNext, int iterationCount)
Parameters
startTime
DateTimeDate in history for starting the paper trading.
stopTime
DateTimeDate in history to stop the paper trading (date is included).
tryGetNext
Func<IPortfolioProvider, (Strategy strategy, IStrategyParam[] parameters)?>Handler to try to get next strategy object.
iterationCount
intIteration count.