public UnderlyingInfo.UnderlyingList this[string indexName] { [MethodImpl(MethodImplOptions.NoInlining)] get { UnderlyingInfo.UnderlyingList result; try { if (this.itemsKeySymbol.ContainsKey(indexName)) { result = this[this.itemsKeySymbol[indexName]]; } else { result = new UnderlyingInfo.UnderlyingList { Symbol = string.Empty }; } } catch (Exception ex) { throw ex; } return result; } }
private void LoadTFEXInfomation() { try { string text = ApplicationInfo.WebServiceTFEX.TFEXInformation(); if (!string.IsNullOrEmpty(text)) { using (DataSet dataSet = new DataSet()) { MyDataHelper.StringToDataSet(text, dataSet); if (dataSet.Tables.Contains("Info") && dataSet.Tables["Info"].Rows.Count > 0) { ApplicationInfo.SeriesInfo.ResetData(); foreach (DataRow dataRow in dataSet.Tables["Info"].Rows) { SeriesList.SeriesInformation seriesInformation = new SeriesList.SeriesInformation(); seriesInformation.Symbol = dataRow["sSeries"].ToString(); int num; int.TryParse(dataRow["lOrderBookId"].ToString(), out num); seriesInformation.OrderBookId = num; int.TryParse(dataRow["lUndOrderBookId"].ToString(), out num); seriesInformation.UnderOrderBookId = num; decimal num2; decimal.TryParse(dataRow["nmrCeiling"].ToString(), out num2); seriesInformation.Ceiling = num2; decimal.TryParse(dataRow["nmrFloor"].ToString(), out num2); seriesInformation.Floor = num2; decimal.TryParse(dataRow["nmrFixPrice"].ToString(), out num2); seriesInformation.FixPrice = num2; decimal.TryParse(dataRow["nmrPrevFixPrice"].ToString(), out num2); seriesInformation.PrevFixPrice = num2; int.TryParse(dataRow["iMarketNo"].ToString(), out num); seriesInformation.MarketCode = num; int.TryParse(dataRow["iSymbolTypeNo"].ToString(), out num); seriesInformation.Group = num; decimal.TryParse(dataRow["nmrContractSize"].ToString(), out num2); seriesInformation.ContractSize = num2; seriesInformation.ExpireDate = dataRow["sExpDate"].ToString(); int.TryParse(dataRow["iOpenBalance"].ToString(), out num); seriesInformation.OpenInt = num; decimal.TryParse(dataRow["nmrStrike"].ToString(), out num2); seriesInformation.StrikPrice = num2; decimal.TryParse(dataRow["nmrPrice"].ToString(), out num2); seriesInformation.LastSalePrice = num2; decimal.TryParse(dataRow["tickSize"].ToString(), out num2); seriesInformation.TickSize = num2; seriesInformation.SeriesType = dataRow["seriesType"].ToString(); int numOfDec = 0; int.TryParse(dataRow["iDecPrice"].ToString(), out numOfDec); seriesInformation.NumOfDec = numOfDec; seriesInformation.MarketId = dataRow["sMarketId"].ToString().Trim(); ApplicationInfo.SeriesInfo.AddItem(seriesInformation); } } if (dataSet.Tables.Contains("MarketInfo") && dataSet.Tables["MarketInfo"].Rows.Count > 0) { foreach (DataRow dataRow in dataSet.Tables["MarketInfo"].Rows) { long num3; long.TryParse(dataRow["TotVolume"].ToString(), out num3); long num4; long.TryParse(dataRow["TotDeal"].ToString(), out num4); long num5; long.TryParse(dataRow["oi"].ToString(), out num5); if (dataRow["iSymbolTypeNo"].ToString() == "1") { ApplicationInfo.IndexInfoTfex.OptionsVol += num3; ApplicationInfo.IndexInfoTfex.OptionsOI += num5; ApplicationInfo.IndexInfoTfex.TfexTotalDeal += num4; } else if (dataRow["iSymbolTypeNo"].ToString() == "2") { ApplicationInfo.IndexInfoTfex.OptionsVol += num3; ApplicationInfo.IndexInfoTfex.OptionsOI += num5; ApplicationInfo.IndexInfoTfex.TfexTotalDeal += num4; } else { ApplicationInfo.IndexInfoTfex.FutureVol = num3; ApplicationInfo.IndexInfoTfex.FutureOI = num5; ApplicationInfo.IndexInfoTfex.TfexTotalDeal += num4; } } ApplicationInfo.IndexInfoTfex.TfexTotalVol = ApplicationInfo.IndexInfoTfex.FutureVol + ApplicationInfo.IndexInfoTfex.OptionsVol; ApplicationInfo.IndexInfoTfex.TfexTotalOI = ApplicationInfo.IndexInfoTfex.FutureOI + ApplicationInfo.IndexInfoTfex.OptionsOI; } if (dataSet.Tables.Contains("UnderlyingInfo") && dataSet.Tables["UnderlyingInfo"].Rows.Count > 0) { ApplicationInfo.UnderlyingInfo.ResetData(); foreach (DataRow dataRow in dataSet.Tables["UnderlyingInfo"].Rows) { UnderlyingInfo.UnderlyingList underlyingList = new UnderlyingInfo.UnderlyingList(); int num; int.TryParse(dataRow["lOrderBookId"].ToString(), out num); underlyingList.OrderBookId = num; underlyingList.Symbol = dataRow["sSymbol"].ToString().Trim(); ApplicationInfo.UnderlyingInfo.AddItem(underlyingList); } } if (ApplicationInfo.BrokerId == 4 && ApplicationInfo.IsSupportTfex) { BBOTFEXCurrency bBOTFEXCurrency = new BBOTFEXCurrency(); bBOTFEXCurrency.CurrencyName = "USD"; bBOTFEXCurrency.BidPrice = 0m; bBOTFEXCurrency.AskPrice = 0m; bBOTFEXCurrency.LastTime = "00:00:00"; bBOTFEXCurrency.LastDate = "01 January 2000"; ApplicationInfo.IndexInfoTfex.BBOCurrency.Add(bBOTFEXCurrency.CurrencyName, bBOTFEXCurrency); bBOTFEXCurrency = new BBOTFEXCurrency(); bBOTFEXCurrency.CurrencyName = "THB"; bBOTFEXCurrency.BidPrice = 0m; bBOTFEXCurrency.AskPrice = 0m; bBOTFEXCurrency.LastTime = "00:00:00"; bBOTFEXCurrency.LastDate = "01 January 2000"; ApplicationInfo.IndexInfoTfex.BBOCurrency.Add(bBOTFEXCurrency.CurrencyName, bBOTFEXCurrency); } dataSet.Clear(); } } } catch (Exception ex) { throw ex; } }
public UnderlyingInfo.UnderlyingList this[int orderBookId] { [MethodImpl(MethodImplOptions.NoInlining)] get { UnderlyingInfo.UnderlyingList result; try { if (this.items.ContainsKey(orderBookId)) { result = this.items[orderBookId]; } else { result = new UnderlyingInfo.UnderlyingList { Symbol = string.Empty }; } } catch (Exception ex) { throw ex; } return result; } }