internal void SaveConfiguration() { SimulationExecutionServiceXmlDocument simulationExecutionServiceXmlDocument = new SimulationExecutionServiceXmlDocument(); foreach (OrderEntry entry in this.entries) { simulationExecutionServiceXmlDocument.Entries.Add(entry); } simulationExecutionServiceXmlDocument.Save(this.GetConfigurationFileName()); }
private void LoadConfiguration() { string configurationFileName = this.GetConfigurationFileName(); if (System.IO.File.Exists(configurationFileName)) { SimulationExecutionServiceXmlDocument simulationExecutionServiceXmlDocument = new SimulationExecutionServiceXmlDocument(); simulationExecutionServiceXmlDocument.Load(configurationFileName); foreach (OrderEntryXmlNode orderEntryXmlNode in simulationExecutionServiceXmlDocument.Entries) { OrderEntry orderEntry = new OrderEntry(); orderEntry.Enabled = orderEntryXmlNode.Enabled; orderEntry.DateTime = orderEntryXmlNode.DateTime.Value; orderEntry.Instrument = InstrumentManager.Instruments[orderEntryXmlNode.Symbol.Value]; orderEntry.Side = orderEntryXmlNode.Side.Value; orderEntry.OrdType = orderEntryXmlNode.OrdType.Value; orderEntry.Price = orderEntryXmlNode.Price.Value; orderEntry.StopPx = orderEntryXmlNode.StopPx.Value; orderEntry.OrderQty = orderEntryXmlNode.OrderQty.Value; orderEntry.Text = orderEntryXmlNode.Text.Value; this.entries.Add(orderEntry); } } }