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); }
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); }
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); }
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); }
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); } } }
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); } } }