public void AddInstrument() { if (App.CurrentStrategy == null || string.IsNullOrEmpty(Cn)) { return; } // Save to DB using (var context = new QTSDbContext()) { var strategy = context.Strategies.FirstOrDefault(s => s.Id == App.CurrentStrategy.Id); var instrument = new Instrument(); instrument.Cn = Cn; instrument.Name = Name2; instrument.Exchange = Exchange; if (strategy.Instruments == null) { strategy.Instruments = new List <Instrument>(); } strategy.Instruments.Add(instrument); context.SaveChanges(); InstrumentCollection.Add(instrument); _events.PublishOnUIThread(new ModelEvents(new List <object>(new object[] { "Add instrument to Current Strategy: name = " + Name2 }))); } }
public void StrategyCollection_SelectionChanged(DataGrid dg) { int rowindex = dg.SelectedIndex; App.CurrentStrategy = StrategyCollection[rowindex]; InstrumentCollection.Clear(); InstrumentCollection.AddRange(App.CurrentStrategy.Instruments); }
/// <summary> /// Provides methods and properties for decoding CME FIX messages. /// </summary> public Rebuilder(string instrumentConfigurationDirectory) { OrderBooks = new List<OrderBook>(); ImpliedOrderBooks = new List<OrderBook>(); ConsolidatedOrderBooks = new List<OrderBook>(); fixDecoder.HeaderParsed += OnHeaderParsed; fixDecoder.TradeParsed += OnTradeParsed; fixDecoder.QuoteParsed += OnQuoteParsed; fixDecoder.MessageParsed += OnMessageParsed; fixDecoder.DecodeComplete += OnDecodeComplete; fixDecoder.DecodeStarted += OnDecodeStarted; instrumentCollection = new InstrumentCollection(instrumentConfigurationDirectory); }
public Wimea() : base(null) { _users = new UserCollection(this); _stations = new StationCollection(this); _metars = new MetarCollection(this); _dailys = new DailyCollection(this); _syncs = new SyncsCollection(this); _synoptics = new SynopticCollection(this); _elements = new ElementCollection(this); _instruments = new InstrumentCollection(this); }