本文整理汇总了C#中Wombat.MamaMsg.tryPrice方法的典型用法代码示例。如果您正苦于以下问题:C# MamaMsg.tryPrice方法的具体用法?C# MamaMsg.tryPrice怎么用?C# MamaMsg.tryPrice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wombat.MamaMsg
的用法示例。
在下文中一共展示了MamaMsg.tryPrice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getLevelInfoAndEntries
private void getLevelInfoAndEntries(
MamdaSubscription subscription,
MamaMsg msg,
MamaMsg plMsg,
bool isRecap)
{
double priceLevelSizeChange = 0.0;
int priceLevelActionInt = 0;
int priceLevelSideInt = 0;
MamaMsg entMsg = null;
plMsg.tryPrice(MamdaOrderBookFields.PL_PRICE, ref mPriceLevelPrice);
plMsg.tryF64(MamdaOrderBookFields.PL_SIZE, ref mPriceLevelSize);
plMsg.tryF64(MamdaOrderBookFields.PL_NUM_ENTRIES, ref mPriceLevelNumEntries);
if (plMsg.tryI32(MamdaOrderBookFields.PL_ACTION, ref priceLevelActionInt))
{
mPriceLevelAction = (sbyte) priceLevelActionInt;
}
if (plMsg.tryI32(MamdaOrderBookFields.PL_SIDE, ref priceLevelSideInt))
{
mPriceLevelSide = (sbyte) priceLevelSideInt;
}
// Optional order book fields:
mPriceLevelTime = plMsg.getDateTime (MamdaOrderBookFields.PL_TIME, mEventTime);
if ( plMsg.tryF64(MamdaOrderBookFields.PL_SIZE_CHANGE, ref priceLevelSizeChange) )
{
mPriceLevelSizeChange = (long) priceLevelSizeChange;
}
// Call the Price Level Handler if set
if (mLevelHandler!=null)
{
if (isRecap)
{
mLevelHandler.onBookAtomicLevelRecap (
subscription, this, msg, this);
}
else
{
mLevelHandler.onBookAtomicLevelDelta (
subscription, this, msg, this);
}
}
// Handle entries.
//
// Note: the number of entries actually present may well
// not add up to the PL_NUM_ENTRIES; it may be more than,
// less than or equal to PL_NUM_ENTRIES. For example, if
// the delta is a price level update then PL_NUM_ENTRIES
// indicates the total number of remaining entries whereas
// the array of entries in the message will only contain
// those that are being added/deleted/updated. Only if the
// price level action is an add should the number of
// entries match.
//
if (mLevelEntryHandler!=null)
{
// clear entry cache
clearLevelEntryFields();
// First try a single vector.
int numEntriesInMsg = 0;
MamaMsg[] msgEntries = null;
/* We won't have PL_ENTRIES if FieldAttrsOrderBookWombatMsg
* is not specified in the data dictionary */
if (MamdaOrderBookFields.PL_ENTRIES != null)
{
/* null is passed as default value otherwise
* getVectorMsg throws an exception if not found */
msgEntries = plMsg.getVectorMsg(MamdaOrderBookFields.PL_ENTRIES, null);
if (msgEntries != null)
{
numEntriesInMsg = msgEntries.Length;
}
}
if (numEntriesInMsg > 0)
{
mPriceLevelActNumEntries = numEntriesInMsg;
for (int j = 0; j < numEntriesInMsg; j++)
{
entMsg = msgEntries[j];
getEntriesInfo(entMsg);
if (isRecap)
{
mLevelEntryHandler.onBookAtomicLevelEntryRecap (
subscription, this, msg, this);
}
//.........这里部分代码省略.........