Exemple #1
0
        public OptimizerMaster()
        {
            _log = new Log("OptimizerLog", StartProgram.IsOsOptimizer);
            _log.Listen(this);

            _threadsCount = 1;
            _startDepozit = 100000;

            Storage = new OptimizerDataStorage("Prime");
            Storage.SecuritiesChangeEvent += _storage_SecuritiesChangeEvent;
            Storage.TimeChangeEvent       += _storage_TimeChangeEvent;

            _filterProfitValue       = 10;
            _filterProfitIsOn        = false;
            _filterMaxDrowDownValue  = -10;
            _filterMaxDrowDownIsOn   = false;
            _filterMiddleProfitValue = 0.001m;
            _filterMiddleProfitIsOn  = false;
            _filterProfitFactorValue = 1;
            _filterProfitFactorIsOn  = false;

            _percentOnFilration = 30;

            Load();

            _optimizerExecutor = new OptimizerExecutor(this);
            _optimizerExecutor.LogMessageEvent            += SendLogMessage;
            _optimizerExecutor.TestingProgressChangeEvent += _optimizerExecutor_TestingProgressChangeEvent;
            _optimizerExecutor.PrimeProgressChangeEvent   += _optimizerExecutor_PrimeProgressChangeEvent;
            _optimizerExecutor.TestReadyEvent             += _optimizerExecutor_TestReadyEvent;
            _optimizerExecutor.NeadToMoveUiToEvent        += _optimizerExecutor_NeadToMoveUiToEvent;
            ProgressBarStatuses    = new List <ProgressBarStatus>();
            PrimeProgressBarStatus = new ProgressBarStatus();
        }
        public OptimizerMaster()
        {
            _log = new Log("OptimizerLog", StartProgram.IsOsOptimizer);
            _log.Listen(this);

            _threadsCount = 1;
            _startDepozit = 100000;

            Storage = new OptimizerDataStorage();
            Storage.SecuritiesChangeEvent += _storage_SecuritiesChangeEvent;
            Storage.TimeChangeEvent       += _storage_TimeChangeEvent;

            _filterProfitValue       = 10;
            _filterProfitIsOn        = false;
            _filterMaxDrowDownValue  = -10;
            _filterMaxDrowDownIsOn   = false;
            _filterMiddleProfitValue = 0.001m;
            _filterMiddleProfitIsOn  = false;
            _filterWinPositionValue  = 40;
            _filterWinPositionIsOn   = false;
            _filterProfitFactorValue = 1;
            _filterProfitFactorIsOn  = false;

            _percentOnFilration = 30;

            Load();

            _fazeCount = 1;

            SendLogMessage("Начинаем проверку всех стратегий в системе на наличие параметров", LogMessageType.System);

            for (int i = 0; i < 3; i++)
            {
                Thread worker = new Thread(GetNamesStrategyToOptimization);
                worker.Name         = i.ToString();
                worker.IsBackground = true;
                worker.Start();
            }

            _optimizerExecutor = new OptimizerExecutor(this);
            _optimizerExecutor.LogMessageEvent            += SendLogMessage;
            _optimizerExecutor.TestingProgressChangeEvent += _optimizerExecutor_TestingProgressChangeEvent;
            _optimizerExecutor.PrimeProgressChangeEvent   += _optimizerExecutor_PrimeProgressChangeEvent;
            _optimizerExecutor.TestReadyEvent             += _optimizerExecutor_TestReadyEvent;
            _optimizerExecutor.NeadToMoveUiToEvent        += _optimizerExecutor_NeadToMoveUiToEvent;
            ProgressBarStatuses    = new List <ProgressBarStatus>();
            PrimeProgressBarStatus = new ProgressBarStatus();
        }