Exemplo n.º 1
0
        public override void Save(SettingsStorage storage)
        {
            if (Strategy != null)
            {
                storage.SetValue("StrategyContainerId", Strategy.Id);
                storage.SetValue("StrategyInfoId", StrategyInfo.Id);

                if (Strategy.Security != null)
                {
                    storage.SetValue("security", _strategy.Security.Id);
                }

                if (Strategy.Portfolio != null)
                {
                    storage.SetValue("portfolio", _strategy.Portfolio.Name);
                }

                Strategy.Save(storage);
            }
            else if (_storage != null)
            {
                _storage.ForEach(pair => storage.SetValue(pair.Key, pair.Value));
            }

            if (MarketDataSettings != null)
            {
                storage.SetValue("MarketDataSettings", MarketDataSettings.Id.To <string>());
            }

            storage.SetValue("HistoryDaysCount", HistoryDaysCount);
        }