コード例 #1
0
        public OrigSpreadForm(InstrInfo[] inst) : this()
        {
            _instruments = inst;
            Text         = Utilities.InstrArrayToOldOMSString(_instruments);
            Level2PanelControl l2Form = new Level2PanelControl();

            l2Form.orderEntryControl.Initialize(_instruments);
            Level2Forms.Add(l2Form);

            if (inst.Length > 1)
            {
                for (int i = 0; i < inst.Length; i++)
                {
                    InstrInfo[]        legInfo = inst.Skip(i).Take(1).ToArray();
                    Level2PanelControl legForm = new Level2PanelControl();
                    legForm.orderEntryControl.Initialize(legInfo);
                    Level2Forms.Add(legForm);
                    legs.Add(legForm.MostRecentQuote);
                }
            }

            for (int i = 0; i < Level2Forms.Count; i++)
            {
                Level2PanelControl legForm = Level2Forms[i];

                LayoutControlItem layoutItem = layoutControl1.Root.AddItem();
                layoutItem.Name        = "LayoutItem" + i;
                layoutItem.Control     = legForm;
                layoutItem.TextVisible = false;
            }
            layoutControl1.BestFit();
            Size = new System.Drawing.Size(Size.Width * Level2Forms.Count, Size.Height);
            StartImpliedMarkets();
        }
コード例 #2
0
        public SpreadForm(InstrInfo[] instruments, Guid groupGuid)
        {
            InitializeComponent();
            spreadLevel2PanelControl.instrumentArray = instruments;
            spreadLevel2PanelControl.ControlID       = groupGuid;
            spreadLevel2PanelControl.InitializeAllChildControls(groupGuid, instruments);
            Hub._marketDataFeed.AddQuoteConsumer(instruments, spreadLevel2PanelControl);

            for (int i = 0; i < instruments.Length; i++)
            {
                Level2PanelControl newPanel = new Level2PanelControl(groupGuid, new InstrInfo[] { instruments[i] });
                newPanel.InitializeAllChildControls(groupGuid, new InstrInfo[] { instruments[i] });
                spreadDockPanel1.DockLevel2PanelControl(newPanel);
                Hub._marketDataFeed.AddQuoteConsumer(new InstrInfo[] { instruments[i] }, newPanel);
                Hub._marketDataFeed.AddTradeConsumer(new InstrInfo[] { instruments[i] }, newPanel);
            }

            InfraConnector <Data_Structures.QuoteBook> cnct = new InfraConnector <Data_Structures.QuoteBook>(
                spreadDockPanel1, spreadLevel2PanelControl);


            Text        = Utilities.InstrToStr(instruments);
            Instruments = instruments;

            Utilities.log.Info("Spread Form Created: " + Utilities.InstrToStr(instruments));
        }