当前位置: 首页>>代码示例>>C#>>正文


C# Instrument.ContainsField方法代码示例

本文整理汇总了C#中FreeQuant.Instruments.Instrument.ContainsField方法的典型用法代码示例。如果您正苦于以下问题:C# Instrument.ContainsField方法的具体用法?C# Instrument.ContainsField怎么用?C# Instrument.ContainsField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FreeQuant.Instruments.Instrument的用法示例。


在下文中一共展示了Instrument.ContainsField方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoFixRequest

 private static void DoFixRequest(IMarketDataProvider provider, Instrument instrument, MarketDataType type, char subCh, string suffix)
 {
     FIXMarketDataRequest request = new FIXMarketDataRequest();
     request.MDReqID = DataManager.GetRequestId();
     request.SubscriptionRequestType = subCh;
     switch (type)
     {
         case MarketDataType.Trade:
             request.AddGroup(new FIXMDEntryTypesGroup('2'));
             break;
         case MarketDataType.Quote:
             request.AddGroup(new FIXMDEntryTypesGroup('0'));
             request.AddGroup(new FIXMDEntryTypesGroup('1'));
             request.MarketDepth = 1;  // Top of Book
             break;
         case MarketDataType.MarketDepth:
             request.AddGroup(new FIXMDEntryTypesGroup('0'));
             request.AddGroup(new FIXMDEntryTypesGroup('1'));
             request.MarketDepth = 0;  // Full Book
             break;
     }
     if (!instrument.ContainsField(15))
         instrument.Currency = Framework.Configuration.DefaultCurrency;
     FIXRelatedSymGroup symGrp = new FIXRelatedSymGroup();
     request.AddGroup(symGrp);
     symGrp.Symbol = instrument.Symbol;
     symGrp.SecurityType = instrument.SecurityType;
     symGrp.SecurityExchange = instrument.SecurityExchange;
     symGrp.Currency = instrument.Currency;
     symGrp.SecurityID = instrument.SecurityID;
     symGrp.SecurityIDSource = instrument.SecurityIDSource;
     symGrp.MaturityDate = instrument.MaturityDate;
     symGrp.MaturityMonthYear = instrument.MaturityMonthYear;
     symGrp.StrikePrice = instrument.StrikePrice;
     symGrp.PutOrCall = ((FIXInstrument)instrument).PutOrCall;
     foreach (FIXSecurityAltIDGroup group2 in instrument.SecurityAltIDGroup)
         symGrp.AddGroup(group2);
     symGrp.SetStringValue(10001, suffix);
     if (provider == ProviderManager.MarketDataSimulator)
     {
         provider.SendMarketDataRequest(request);
     }
     else
     {
         switch (subCh)
         {
             case MARKET_DATA_SUBSCRIBE:
                 bool flag1 = false;
                 lock (DataManager.providers)
                 {
                     Hashtable local_4 = DataManager.providers[provider] as Hashtable;
                     if (local_4 == null)
                     {
                         local_4 = new Hashtable();
                         DataManager.providers.Add(provider, local_4);
                     }
                     Hashtable local_5 = local_4[instrument] as Hashtable;
                     if (local_5 == null)
                     {
                         local_5 = new Hashtable();
                         local_4.Add(instrument, local_5);
                     }
                     RequestItem local_6 = local_5[type] as RequestItem;
                     if (local_6 == null)
                     {
                         local_6 = new RequestItem(request);
                         local_5.Add(type, local_6);
                         flag1 = true;
                     }
                     RequestItem temp_91 = local_6;
                     int temp_94 = temp_91.GetRequestId() + 1;
                     temp_91.SetRequestId(temp_94);
                 }
                 if (!flag1)
                     break;
                 provider.SendMarketDataRequest(request);
                 break;
             case MARKET_DATA_UNSUBSCRIBE:
                 bool canSend = false;
                 string msg = null;
                 lock (DataManager.providers)
                 {
                     Hashtable local_10 = DataManager.providers[provider] as Hashtable;
                     if (local_10 != null)
                     {
                         Hashtable local_11 = local_10[instrument] as Hashtable;
                         if (local_11 != null)
                         {
                             RequestItem local_12 = local_11[type] as RequestItem;
                             if (local_12 != null)
                             {
                                 RequestItem temp_152 = local_12;
                                 int temp_155 = temp_152.GetRequestId() - 1;
                                 temp_152.SetRequestId(temp_155);
                                 if (local_12.GetRequestId() == 0)
                                 {
                                     local_11.Remove(type);
                                     if (local_11.Count == 0)
                                     {
                                         local_10.Remove(instrument);
//.........这里部分代码省略.........
开发者ID:heber,项目名称:FreeOQ,代码行数:101,代码来源:DataManager.cs

示例2: QmHMIFYlFO

 private void QmHMIFYlFO([In] object obj0, [In] EventArgs obj1)
 {
   this.jA3M607Con(false);
   this.Cursor = Cursors.WaitCursor;
   this.jdxMcrTVkr.Minimum = 0;
   this.jdxMcrTVkr.Value = 0;
   this.jdxMcrTVkr.Maximum = this.Av6MXcQF5Z.CheckedItems.Count;
   int num1 = 0;
   int num2 = 0;
   foreach (SecurityDefinitionViewItem definitionViewItem in this.Av6MXcQF5Z.CheckedItems)
   {
     string symbol = this.DsUMrBufkW(definitionViewItem.SecurityDefinition);
     if (!InstrumentManager.Instruments.Contains(symbol))
     {
       Instrument instrument = new Instrument(symbol, definitionViewItem.SecurityDefinition.SecurityType);
       foreach (FIXField field in definitionViewItem.SecurityDefinition.Fields)
       {
         if (field.Tag != 55 && field.Tag != 167)
           instrument.AddField(field);
       }
       if (!instrument.ContainsField(541))
       {
         DateTime result = DateTime.MinValue;
         string str = instrument.ContainsField(205) ? instrument.MaturityDay : RNaihRhYEl0wUmAftnB.aYu7exFQKN(32660);
         if (str.Length == 1)
           str = RNaihRhYEl0wUmAftnB.aYu7exFQKN(32668) + str;
         if (DateTime.TryParseExact(instrument.MaturityMonthYear + str, RNaihRhYEl0wUmAftnB.aYu7exFQKN(32674), (IFormatProvider) CultureInfo.InvariantCulture, DateTimeStyles.None, out result))
           instrument.MaturityDate = result;
       }
       if ((int) this.ElZM5QiWFt.Id == 10)
       {
         instrument.AddSymbol(definitionViewItem.SecurityDefinition.Symbol, definitionViewItem.SecurityDefinition.SecurityExchange, RNaihRhYEl0wUmAftnB.aYu7exFQKN(32694));
         instrument.AddSymbol(definitionViewItem.SecurityDefinition.Symbol, definitionViewItem.SecurityDefinition.SecurityExchange, RNaihRhYEl0wUmAftnB.aYu7exFQKN(32710));
       }
       if ((int) this.ElZM5QiWFt.Id == 21)
         instrument.AddSymbol(definitionViewItem.SecurityDefinition.SecurityID, definitionViewItem.SecurityDefinition.SecurityExchange, this.ElZM5QiWFt.Name);
       if ((int) this.ElZM5QiWFt.Id == 22)
       {
         instrument.AddSymbol(definitionViewItem.SecurityDefinition.SecurityID, definitionViewItem.SecurityDefinition.SecurityExchange, this.ElZM5QiWFt.Name);
         instrument.RemoveField(48);
       }
       instrument.Save();
       ++num1;
     }
     else
       ++num2;
     ++this.jdxMcrTVkr.Value;
     Application.DoEvents();
   }
   this.jA3M607Con(true);
   this.Cursor = Cursors.Default;
   int num3 = (int) MessageBox.Show(string.Format(RNaihRhYEl0wUmAftnB.aYu7exFQKN(32726) + Environment.NewLine + RNaihRhYEl0wUmAftnB.aYu7exFQKN(32788), (object) num1, (object) num2), RNaihRhYEl0wUmAftnB.aYu7exFQKN(32828), MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
 }
开发者ID:heber,项目名称:FreeOQ,代码行数:53,代码来源:SecurityDefinitionListForm.cs


注:本文中的FreeQuant.Instruments.Instrument.ContainsField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。