本文整理汇总了C#中Service.CreateRequest方法的典型用法代码示例。如果您正苦于以下问题:C# Service.CreateRequest方法的具体用法?C# Service.CreateRequest怎么用?C# Service.CreateRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Service
的用法示例。
在下文中一共展示了Service.CreateRequest方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToRequest
internal Request ToRequest(Service refDataService)
{
var request = refDataService.CreateRequest(OperationNames.IntradayBarRequest);
request.Set(ElementNames.Security, Ticker);
request.Set(ElementNames.StartDateTime, new Datetime(StartDateTime.Year, StartDateTime.Month, StartDateTime.Day, StartDateTime.Hour, StartDateTime.Minute, StartDateTime.Second, StartDateTime.Millisecond));
request.Set(ElementNames.EndDateTime, new Datetime(EndDateTime.Year, EndDateTime.Month, EndDateTime.Day, EndDateTime.Hour, EndDateTime.Minute, EndDateTime.Second, EndDateTime.Millisecond));
request.Set(ElementNames.EventType, EventType.ToString());
if (Interval.HasValue)
request.Set(ElementNames.Interval, Interval.Value);
if (GapFillInitialBar.HasValue)
request.Set(ElementNames.GapFillInitialBar, GapFillInitialBar.Value);
if (ReturnEids.HasValue)
request.Set(ElementNames.ReturnEids, ReturnEids.Value);
if (ReturnRelativeDate.HasValue)
request.Set(ElementNames.ReturnRelativeDate, ReturnRelativeDate.Value);
if (AdjustmentNormal.HasValue)
request.Set(ElementNames.AdjustmentNormal, AdjustmentNormal.Value);
if (AdjustmentAbnormal.HasValue)
request.Set(ElementNames.AdjustmentAbnormal, AdjustmentAbnormal.Value);
if (AdjustmentSplit.HasValue)
request.Set(ElementNames.AdjustmentSplit, AdjustmentSplit.Value);
if (AdjustmentFollowDPDF.HasValue)
request.Set(ElementNames.AdjustmentFollowDPDF, AdjustmentFollowDPDF.Value);
return request;
}
示例2: ToRequest
internal Request ToRequest(Service refDataService)
{
var request = refDataService.CreateRequest(OperationNames.HistoricalDataRequest);
foreach (var ticker in Tickers)
request.Append(ElementNames.Securities, ticker);
foreach (var field in Fields)
request.Append(ElementNames.Fields, field);
request.Set(ElementNames.StartDate, StartDate.ToString("yyyyMMdd"));
request.Set(ElementNames.EndDate, EndDate.ToString("yyyyMMdd"));
request.Set(ElementNames.PeriodicitySelection, PeriodicitySelection.ToString());
request.Set(ElementNames.PeriodicityAdjustment, PeriodicityAdjustment.ToString());
if (!string.IsNullOrEmpty(Currency))
request.Set(ElementNames.Currency, Currency);
if (OverrideOption.HasValue)
request.Set(ElementNames.OverrideOption, OverrideOption.Value.ToString());
if (PricingOption.HasValue)
request.Set(ElementNames.PricingOption, PricingOption.Value.ToString());
if (NonTradingDayFillOption.HasValue)
request.Set(ElementNames.NonTradingDayFillOption, NonTradingDayFillOption.Value.ToString());
if (NonTradingDayFillMethod.HasValue)
request.Set(ElementNames.NonTradingDayFillMethod, NonTradingDayFillMethod.Value.ToString());
if (MaxDataPoints.HasValue)
request.Set(ElementNames.MaxDataPoints, MaxDataPoints.Value);
if (ReturnEids.HasValue)
request.Set(ElementNames.ReturnEids, ReturnEids.Value);
if (ReturnRelativeDate.HasValue)
request.Set(ElementNames.ReturnRelativeDate, ReturnRelativeDate.Value);
if (AdjustmentNormal.HasValue)
request.Set(ElementNames.AdjustmentNormal, AdjustmentNormal.Value);
if (AdjustmentAbnormal.HasValue)
request.Set(ElementNames.AdjustmentAbnormal, AdjustmentAbnormal.Value);
if (AdjustmentSplit.HasValue)
request.Set(ElementNames.AdjustmentSplit, AdjustmentSplit.Value);
if (AdjustmentFollowDpdf.HasValue)
request.Set(ElementNames.AdjustmentFollowDPDF, AdjustmentFollowDpdf.Value);
if (CalendarCodeOverride.HasValue)
request.Set(ElementNames.CalendarCodeOverride, CalendarCodeOverride.Value);
if (Overrides != null)
{
foreach (var pair in Overrides)
{
var requestOverride = request[ElementNames.Overrides].AppendElement();
requestOverride.SetElement(ElementNames.FieldId, pair.Key);
requestOverride.SetElement(ElementNames.Value, pair.Value);
}
}
return request;
}
示例3: ToRequest
internal Request ToRequest(Service refDataService)
{
var request = refDataService.CreateRequest(OperationNames.IntradayTickRequest);
request.Set(ElementNames.Security, Ticker);
foreach (var eventType in EventTypes)
request.Append(ElementNames.EventTypes, eventType.ToString());
request.Set(ElementNames.StartDateTime, new Datetime(StartDateTime.Year, StartDateTime.Month, StartDateTime.Day, StartDateTime.Hour, StartDateTime.Minute, StartDateTime.Second, StartDateTime.Millisecond));
request.Set(ElementNames.EndDateTime, new Datetime(EndDateTime.Year, EndDateTime.Month, EndDateTime.Day, EndDateTime.Hour, EndDateTime.Minute, EndDateTime.Second, EndDateTime.Millisecond));
if (IncludeBrokerCodes.HasValue)
request.Set(ElementNames.IncludeBrokerCodes, IncludeBrokerCodes.Value);
if (IncludeConditionCodes.HasValue)
request.Set(ElementNames.IncludeConditionCodes, IncludeConditionCodes.Value);
if (IncludeExchangeCodes.HasValue)
request.Set(ElementNames.IncludeExchangeCodes, IncludeExchangeCodes.Value);
if (IncludeNonPlottableEvents.HasValue)
request.Set(ElementNames.IncludeNonPlottableEvents, IncludeNonPlottableEvents.Value);
if (IncludeRpsCodes.HasValue)
request.Set(ElementNames.IncludeRpsCodes, IncludeRpsCodes.Value);
if (ReturnEids.HasValue)
request.Set(ElementNames.ReturnEids, ReturnEids.Value);
return request;
}
示例4: Button1_Click
protected void Button1_Click(object sender, EventArgs e)
{
string filename = TextBox1.Text;
Service mysr = new Service();
Label9.Text = mysr.CreateRequest(filename);
}
示例5: OpenSession
/// <summary>
/// Etablie la connection avec Bloomberg
/// </summary>
private void OpenSession()
{
sessionOptions = new SessionOptions();
sessionOptions.ServerHost = "localhost";
sessionOptions.ServerPort = 8194;
session = new Session(sessionOptions);
l_title = new List<Title>();
if (!session.Start())
{
System.Console.WriteLine("Could not start session.");
Console.WriteLine(session.ToString());
Remplissage_Non_connection();
return;
}
if (!session.OpenService("//blp/refdata"))
{
System.Console.WriteLine("Could not open service " +
"//blp/refdata");
return;
}
refDataSvc = session.GetService("//blp/refdata");
if (refDataSvc == null)
{
Console.WriteLine("Cannot get service");
return;
}
else
{
request = refDataSvc.CreateRequest("ReferenceDataRequest");
}
}