本文整理汇总了C#中StockSharp.InteractiveBrokers.Native.IBSocket.ReadSecurityId方法的典型用法代码示例。如果您正苦于以下问题:C# IBSocket.ReadSecurityId方法的具体用法?C# IBSocket.ReadSecurityId怎么用?C# IBSocket.ReadSecurityId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StockSharp.InteractiveBrokers.Native.IBSocket
的用法示例。
在下文中一共展示了IBSocket.ReadSecurityId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadBondInfo
private void ReadBondInfo(IBSocket socket, ServerVersions version)
{
var requestId = version >= ServerVersions.V3 ? socket.ReadInt() : -1;
var secCode = socket.ReadStr();
var type = socket.ReadSecurityType();
var cusip = socket.ReadStr();
var coupon = socket.ReadDecimal();
var maturity = socket.ReadStr();
var issueDate = socket.ReadStr();
var ratings = socket.ReadStr();
var bondType = socket.ReadStr();
var couponType = socket.ReadStr();
var convertible = socket.ReadBool();
var callable = socket.ReadBool();
var putable = socket.ReadBool();
var description = socket.ReadStr();
var boardCode = socket.ReadBoardCode();
var currency = socket.ReadCurrency();
var marketName = socket.ReadStr();
var secClass = socket.ReadStr();
var contractId = socket.ReadInt();
var priceStep = socket.ReadDecimal();
var orderTypes = socket.ReadStr();
var validExchanges = socket.ReadStr();
var nextOptionDate = version >= ServerVersions.V2 ? socket.ReadStr() : null;
var nextOptionType = version >= ServerVersions.V2 ? socket.ReadStr() : null;
var nextOptionPartial = version >= ServerVersions.V2 ? socket.ReadBool() : (bool?)null;
var notes = version >= ServerVersions.V2 ? socket.ReadStr() : null;
var name = version >= ServerVersions.V4 ? socket.ReadStr() : null;
var evRule = version >= ServerVersions.V6 ? socket.ReadStr() : null;
var evMultiplier = version >= ServerVersions.V6 ? socket.ReadDecimal() : (decimal?)null;
var secId = new SecurityId
{
SecurityCode = secCode,
BoardCode = GetBoardCode(boardCode),
InteractiveBrokers = contractId,
};
if (version >= ServerVersions.V5)
socket.ReadSecurityId(secId);
var secMsg = new SecurityMessage
{
SecurityId = secId,
//Name = secName,
SecurityType = type,
Currency = currency,
Class = secClass,
PriceStep = priceStep,
};
secMsg.SetMarketName(marketName);
secMsg.SetOrderTypes(orderTypes);
secMsg.SetValidExchanges(validExchanges);
// TODO
//s.SetBondCusip(cusip);
//s.SetCoupon(coupon);
//s.SetMaturity(maturity);
//s.SetIssueDate(issueDate);
//s.SetRatings(ratings);
//s.SetBondType(bondType);
//s.SetCouponType(couponType);
//s.SetConvertible(convertible);
//s.SetCallable(callable);
//s.SetPutable(putable);
//s.SetDescription(description);
//if (nextOptionDate != null)
// s.SetNextOptionDate(nextOptionDate);
//if (nextOptionType != null)
// s.SetNextOptionType(nextOptionType);
//if (nextOptionPartial != null)
// s.SetNextOptionPartial(nextOptionPartial.Value);
//if (notes != null)
// s.SetNotes(notes);
if (evRule != null)
secMsg.SetEvRule(evRule);
if (evMultiplier != null)
secMsg.SetEvMultiplier(evMultiplier.Value);
SendOutMessage(secMsg);
}
示例2: ReadSecurityInfo
private void ReadSecurityInfo(IBSocket socket, ServerVersions version)
{
var requestId = version >= ServerVersions.V3 ? socket.ReadInt() : -1;
var secName = socket.ReadStr();
var type = socket.ReadSecurityType();
var expiryDate = socket.ReadExpiry();
var strike = socket.ReadDecimal();
var optionType = socket.ReadOptionType();
var boardCode = socket.ReadBoardCode();
var currency = socket.ReadCurrency();
var secCode = version >= ServerVersions.V2 ? socket.ReadLocalCode(secName) : null;
var marketName = socket.ReadStr();
var secClass = socket.ReadStr();
var contractId = socket.ReadInt();
var priceStep = socket.ReadDecimal();
var multiplier = socket.ReadMultiplier();
var orderTypes = socket.ReadStr();
var validExchanges = socket.ReadStr();
var priceMagnifier = version >= ServerVersions.V2 ? socket.ReadInt() : (int?)null;
var underlyingSecurityNativeId = version >= ServerVersions.V4 ? socket.ReadInt() : (int?)null;
var name = version >= ServerVersions.V4 ? socket.ReadStr() : null;
var routingExchange = version >= ServerVersions.V4 ? socket.ReadBoardCode() : null;
var contractMonth = version >= ServerVersions.V6 ? socket.ReadStr() : null;
var industry = version >= ServerVersions.V6 ? socket.ReadStr() : null;
var category = version >= ServerVersions.V6 ? socket.ReadStr() : null;
var subCategory = version >= ServerVersions.V6 ? socket.ReadStr() : null;
var timeZoneId = version >= ServerVersions.V6 ? socket.ReadStr() : null;
var tradingHours = version >= ServerVersions.V6 ? socket.ReadStr() : null;
var liquidHours = version >= ServerVersions.V6 ? socket.ReadStr() : null;
var evRule = version >= ServerVersions.V8 ? socket.ReadStr() : null;
var evMultiplier = version >= ServerVersions.V8 ? socket.ReadDecimal() : (decimal?)null;
var secId = new SecurityId
{
SecurityCode = secCode,
BoardCode = GetBoardCode(boardCode),
InteractiveBrokers = contractId,
};
if (version >= ServerVersions.V7)
socket.ReadSecurityId(secId);
var secMsg = new SecurityMessage
{
SecurityId = secId,
Name = secName,
SecurityType = type,
ExpiryDate = expiryDate,
Strike = strike,
OptionType = optionType,
Currency = currency,
Multiplier = multiplier ?? 0,
Class = secClass,
OriginalTransactionId = requestId,
PriceStep = priceStep,
};
secMsg.SetMarketName(marketName);
secMsg.SetOrderTypes(orderTypes);
secMsg.SetValidExchanges(validExchanges);
if (priceMagnifier != null)
secMsg.SetPriceMagnifier(priceMagnifier.Value);
if (!routingExchange.IsEmpty())
secMsg.SetRoutingBoard(routingExchange);
if (contractMonth != null)
secMsg.SetContractMonth(contractMonth);
if (industry != null)
secMsg.SetIndustry(industry);
if (category != null)
secMsg.SetCategory(category);
if (subCategory != null)
secMsg.SetSubCategory(subCategory);
if (timeZoneId != null)
secMsg.SetTimeZoneId(timeZoneId);
if (tradingHours != null)
secMsg.SetTradingHours(tradingHours);
if (liquidHours != null)
secMsg.SetLiquidHours(liquidHours);
if (evRule != null)
secMsg.SetEvRule(evRule);
if (evMultiplier != null)
secMsg.SetEvMultiplier(evMultiplier.Value);
// TODO
//if (underlyingSecurityNativeId != null)
// ProcessSecurityAction(null, SecurityIdGenerator.GenerateId(underlyingSecurityNativeId.Value.To<string>(), exchangeBoard), underSec => security.UnderlyingSecurityId = underSec.Id);
SendOutMessage(secMsg);
//.........这里部分代码省略.........