本文整理汇总了C#中FreeQuant.Instruments.Instrument.AddSymbol方法的典型用法代码示例。如果您正苦于以下问题:C# Instrument.AddSymbol方法的具体用法?C# Instrument.AddSymbol怎么用?C# Instrument.AddSymbol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FreeQuant.Instruments.Instrument
的用法示例。
在下文中一共展示了Instrument.AddSymbol方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddInstrument
private bool AddInstrument(FIXSecurityDefinition securityDefinition)
{
string symbol = SecurityDefinitionHelper.GetSymbol(securityDefinition, ((IProvider) this.provider).Id);
if (InstrumentManager.Instruments.Contains(symbol))
return false;
Instrument instrument = new Instrument(symbol, securityDefinition.SecurityType);
foreach (FIXField fixField in ((FIXGroup) securityDefinition).Fields)
{
switch ((int) fixField.Tag)
{
case 320:
case 322:
case 323:
case 393:
case 55:
case 167:
goto case 320;
default:
((FIXGroup) instrument).AddField(fixField);
goto case 320;
}
}
for (int index = 0; index < securityDefinition.NoSecurityAltID; ++index)
((FIXInstrument) instrument).AddGroup(securityDefinition.GetSecurityAltIDGroup(index));
switch (((IProvider) this.provider).Id)
{
case (byte) 4:
if (((FIXInstrument) instrument).Symbol != securityDefinition.Symbol)
instrument.AddSymbol(securityDefinition.Symbol, securityDefinition.SecurityExchange, ((IProvider) this.provider).Name);
((FIXGroup) instrument).RemoveField(48);
break;
case (byte) 10:
instrument.AddSymbol(string.Format("{0}|{1}|1.0", (object) securityDefinition.Symbol, securityDefinition.SecurityID), securityDefinition.SecurityExchange, ((IProvider) this.provider).Name);
((FIXGroup) instrument).RemoveField(48);
instrument.AddSymbol(securityDefinition.Symbol, securityDefinition.SecurityExchange, "TT API");
break;
case (byte) 21:
instrument.AddSymbol(securityDefinition.SecurityID, securityDefinition.SecurityExchange, ((IProvider) this.provider).Name);
break;
case (byte) 22:
if (((FIXInstrument) instrument).Symbol != securityDefinition.Symbol)
{
instrument.AddSymbol(securityDefinition.SecurityID, securityDefinition.SecurityExchange, ((IProvider) this.provider).Name);
((FIXGroup) instrument).RemoveField(48);
break;
}
else
break;
}
if ((((FIXInstrument) instrument).SecurityType == "FUT" || ((FIXInstrument) instrument).SecurityType == "OPT" || ((FIXInstrument) instrument).SecurityType == "MLEG") && (!((FIXGroup) instrument).ContainsField(541) && ((FIXGroup) instrument).ContainsField(200)))
{
int year = int.Parse(securityDefinition.MaturityMonthYear.Substring(0, 4), (IFormatProvider) CultureInfo.InvariantCulture);
int month = int.Parse(securityDefinition.MaturityMonthYear.Substring(4, 2), (IFormatProvider) CultureInfo.InvariantCulture);
((FIXInstrument) instrument).MaturityDate = new DateTime(year, month, 1);
}
instrument.Save();
return true;
}
示例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);
}