Exemplo n.º 1
0
        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 })));
            }
        }
Exemplo n.º 2
0
        public void StrategyCollection_SelectionChanged(DataGrid dg)
        {
            int rowindex = dg.SelectedIndex;

            App.CurrentStrategy = StrategyCollection[rowindex];

            InstrumentCollection.Clear();
            InstrumentCollection.AddRange(App.CurrentStrategy.Instruments);
        }
Exemplo n.º 3
0
        /// <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);
        }
Exemplo n.º 4
0
        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);

        }