Ejemplo n.º 1
0
        public void AddRawInstrument(RawInstrument ri, InstrumentShared ins)
        {
            ProductSymbol ps;

            if (this.productSymbolList.ContainsKey(ri.productCode))
            {
                ps = this.productSymbolList[ri.productCode];
            }
            else
            {
                ps = new ProductSymbol(ri.productCode);
                this.productSymbolList.Add(ri.productCode, ps);
            }
            ps.AddRawInstrument(ri, ins);
        }
Ejemplo n.º 2
0
        public void AddRawInstrument(RawInstrument ri, InstrumentShared ins)
        {
            InstrumentType insType;

            if (instrumentTypeCache.ContainsKey(ri.strategyType))
            {
                insType = instrumentTypeCache[ri.strategyType];
            }
            else
            {
                insType = new InstrumentType(ri.strategyType);
                this.instrumentTypeCache.Add(ri.strategyType, insType);
            }

            insType.AddRawInstrument(ri, ins);
        }
Ejemplo n.º 3
0
        public void AddRawInstrument(RawInstrument ri, InstrumentShared ins)
        {
            ExchangeInfo ei;

            if (exchanges.ContainsKey(ri.exchange))
            {
                ei = this.exchanges[ri.exchange];
            }
            else
            {
                ei = new ExchangeInfo(ri.exchange);
                this.exchanges.Add(ri.exchange, ei);
            }

            ei.AddRawInstrument(ri, ins);
        }
Ejemplo n.º 4
0
        public void AddRawInstrument(RawInstrument ri, InstrumentShared ins)
        {
            ProductClassType pi;

            if (this.productClass.ContainsKey(ri.productFamily))
            {
                pi = this.productClass[ri.productFamily];
            }
            else
            {
                pi = new ProductClassType(ri.productFamily);
                this.productClass.Add(ri.productFamily, pi);
            }

            pi.AddRawInstrument(ri, ins);
        }
Ejemplo n.º 5
0
        public void AddRawInstrument(RawInstrument ri, InstrumentShared ins)
        {
            ProductClassType pi;

            if (this.productClass.ContainsKey(ri.productFamily))
            {
                pi = this.productClass[ri.productFamily];
            }
            else
            {
                pi = new ProductClassType(ri.productFamily);
                this.productClass.Add(ri.productFamily, pi);
            }

            pi.AddRawInstrument(ri, ins);
        }
Ejemplo n.º 6
0
        public void AddRawInstrument(RawInstrument ri, InstrumentShared ins)
        {
            this.instrumentList.Add(ins);

            string leadingMonth = " ";

            if (ri.symbol.IndexOf("-") > 0)
            {
                string[] tStr = ri.symbol.Split('-');
                if (tStr.Length > 1)
                {
                    leadingMonth = tStr[0];
                }
            }
            else if (this.instType == "DF" || this.instType == "CF")
            {
                if (ri.symbol.IndexOf(" ") > 0)
                {
                    string[] tStr = ri.symbol.Split(' ');
                    if (tStr.Length > 1)
                    {
                        leadingMonth = tStr[0] + " " + tStr[1].Substring(0, 2);
                    }
                }
            }

            if (leadingMonth != "")
            {
                if (splitList.ContainsKey(leadingMonth) == false)
                {
                    SplitInstrument spIns = new SplitInstrument();
                    spIns.expirationDate = ins.expiry;
                    spIns.name           = leadingMonth + "...";
                    spIns.instrumentList = new List <InstrumentShared>();
                    spIns.instrumentList.Add(ins);
                    this.splitList.Add(leadingMonth, spIns);
                }
                else
                {
                    SplitInstrument spIns = splitList[leadingMonth];
                    spIns.instrumentList.Add(ins);
                }
            }
        }
Ejemplo n.º 7
0
        public void AddRawInstrument(RawInstrument ri, InstrumentShared ins)
        {
            this.instrumentList.Add(ins);

            string leadingMonth = " ";
            if (ri.symbol.IndexOf("-") > 0)
            {
                string[] tStr = ri.symbol.Split('-');
                if (tStr.Length > 1)
                {
                    leadingMonth = tStr[0];
                }
            }
            else if (this.instType == "DF" || this.instType == "CF")
            {
                if (ri.symbol.IndexOf(" ") > 0)
                {
                    string[] tStr = ri.symbol.Split(' ');
                    if (tStr.Length > 1)
                    {
                        leadingMonth = tStr[0] + " " + tStr[1].Substring(0, 2);
                    }
                }
            }

            if (leadingMonth != "")
            {
                if (splitList.ContainsKey(leadingMonth) == false)
                {
                    SplitInstrument spIns = new SplitInstrument();
                    spIns.expirationDate = ins.expiry;
                    spIns.name = leadingMonth + "...";
                    spIns.instrumentList = new List<InstrumentShared>();
                    spIns.instrumentList.Add(ins);
                    this.splitList.Add(leadingMonth, spIns);
                }
                else
                {
                    SplitInstrument spIns = splitList[leadingMonth];
                    spIns.instrumentList.Add(ins);
                }
            }
        }
Ejemplo n.º 8
0
 public void AddRawInstrument(RawInstrument ri, InstrumentShared ins)
 {
     ProductSymbol ps;
     if (this.productSymbolList.ContainsKey(ri.productCode))
     {
         ps = this.productSymbolList[ri.productCode];
     }
     else
     {
         ps = new ProductSymbol(ri.productCode);
         this.productSymbolList.Add(ri.productCode, ps);
     }
     ps.AddRawInstrument(ri, ins);
 }
Ejemplo n.º 9
0
        public void AddRawInstrument(RawInstrument ri, InstrumentShared ins)
        {
            InstrumentType insType;
            if (instrumentTypeCache.ContainsKey(ri.strategyType))
            {
                insType = instrumentTypeCache[ri.strategyType];
            }
            else
            {
                insType = new InstrumentType(ri.strategyType);
                this.instrumentTypeCache.Add(ri.strategyType, insType);
            }

            insType.AddRawInstrument(ri, ins);
        }
Ejemplo n.º 10
0
        public void AddRawInstrument(RawInstrument ri, InstrumentShared ins)
        {
            ExchangeInfo ei;
            if (exchanges.ContainsKey(ri.exchange))
            {
                ei = this.exchanges[ri.exchange];
            }
            else
            {
                ei = new ExchangeInfo(ri.exchange);
                this.exchanges.Add(ri.exchange, ei);
            }

            ei.AddRawInstrument(ri, ins);
        }