Esempio n. 1
0
        /// <summary>
        /// Subscribe to an instrument using an InstrumentDescriptor
        /// </summary>
        /// <param name="descriptor">InstrumentDescriptor containing the instrument information</param>
        public void SubscribeToInstrument(InstrumentDescriptor descriptor)
        {
            EventInstruments.Instance.SubscribeToInstrument(descriptor);

            /*InstrumentLookupSubscription req = new InstrumentLookupSubscription(apiSession, Dispatcher.Current, descriptor.ProductKey, descriptor.ContractName);
             * req.Update += new EventHandler<InstrumentLookupSubscriptionEventArgs>(instrumentLookupRequest_Update);
             * req.Start();*/
        }
Esempio n. 2
0
 private void InstrumentsPanel_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (e.AddedItems.Count > 0)
     {
         InstrumentDescriptor descriptor = (InstrumentDescriptor)e.AddedItems[0];
         this.ProvidersPanel.ItemsSource = descriptor.ChildDescriptors;
     }
 }
Esempio n. 3
0
        public void SubscribeToInstrument(InstrumentDescriptor descriptor)
        {
            if (_dispatcher.InvokeRequired())
            {
                _dispatcher.BeginInvoke(() =>
                {
                    SubscribeToInstrument(descriptor);
                });
                return;
            }

            InstrumentLookupSubscription req = new InstrumentLookupSubscription(_apiSession, Dispatcher.Current, descriptor.ProductKey, descriptor.ContractName);

            req.Update += new EventHandler <InstrumentLookupSubscriptionEventArgs>(instrumentLookupRequest_Update);
            req.Start();
        }
Esempio n. 4
0
        public void CreateInstrument(string marketName, string productTypeName, string productName, string contractName, string tag)
        {
            if (_dispatcher.InvokeRequired())
            {
                _dispatcher.BeginInvoke(() =>
                {
                    CreateInstrument(marketName, productTypeName, productName, contractName, tag);
                });
                return;
            }

            InstrumentDescriptor         descriptor = new InstrumentDescriptor(marketName, productTypeName, productName, contractName);
            InstrumentLookupSubscription req        = new InstrumentLookupSubscription(_apiSession, Dispatcher.Current, descriptor.ProductKey, descriptor.ContractName);

            req.Update += new EventHandler <InstrumentLookupSubscriptionEventArgs>(instrumentLookupRequest_Update);
            req.Tag     = tag; // Tag our request with our unique tag string
            req.Start();
            Console.WriteLine("CREATEINSTRUMENT REQUEST: " + descriptor.ToString());
        }
 protected InstrumentTick()
 {
     Instrument = new InstrumentDescriptor(int.MinValue, null);
 }
Esempio n. 6
0
 public bool Equals(InstrumentDescriptor other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return string.Equals(Identifier, other.Identifier) && MarketId == other.MarketId;
 }