Exemple #1
0
        private void ClearOrderBooks(List <int> pertinentContracts)
        {
            OrderBooks.Clear();
            ImpliedOrderBooks.Clear();
            ConsolidatedOrderBooks.Clear();

            int contractCount = pertinentContracts.Count;

            for (int i = 0; i < contractCount; i++)
            {
                int instrument = pertinentContracts[i];

                AddNewOrderBooksFor(instrument);
            }
        }
Exemple #2
0
        private void ReconcileExpiredContracts()
        {
            for (int i = 0; i < ConsolidatedOrderBooks.Count; i++)
            {
                bool matchFound = false;
                foreach (int pertinentContract in pertinentContracts)
                {
                    if (ConsolidatedOrderBooks[i].InstrumentId == pertinentContract)
                    {
                        matchFound = true;
                        break;
                    }
                }

                if (!matchFound)
                {
                    OrderBooks.RemoveAt(i);
                    ImpliedOrderBooks.RemoveAt(i);
                    ConsolidatedOrderBooks.RemoveAt(i);
                }
            }
        }
Exemple #3
0
 private void AddNewOrderBooksFor(int instrumentId)
 {
     OrderBooks.Add(new OrderBook(OUTRIGHT_DEPTH, instrumentId));
     ImpliedOrderBooks.Add(new OrderBook(IMPLIED_DEPTH, instrumentId));
     ConsolidatedOrderBooks.Add(new OrderBook(OUTRIGHT_DEPTH, instrumentId));
 }