/// <summary> /// Retrieve ticker information from FIX message /// </summary> /// <param name="group"></param> public void AddDefaults(IFIXGroup group) { IFIXGroup defaultGroup = group.GetGroupByTag(FIXTagConstants.esFIXTagESNoDefaultFields, null); int nDefaultCount = defaultGroup.get_NumberOfGroups(null); for (int j = 0; j < nDefaultCount; j++) { IFIXGroup singleDefaultGroup = defaultGroup.GetGroupByIndex(j); //get the defaults //ESDefaultFieldFIXTag=1 //ESDefaultFieldName=Account //ESDefaultFieldValue=xxx //ESDefaultFieldEdit=Y //ESDefaultFieldDisplay=Account Code //ESDefaultFieldInputStyle=String string sTag = singleDefaultGroup.get_AsString(FIXTagConstants.esFIXTagESDefaultFieldFIXTag); int nTag = int.Parse(sTag); string sValue = singleDefaultGroup.get_AsString(FIXTagConstants.esFIXTagESDefaultFieldValue); Add(nTag, sValue); //System.Diagnostics.Debug.Print("TICKER DEFAULTS [{0}] = [{1}] [{2}]", m_sExchange, nTag, sValue); } }
/// <summary> /// Decode position FIX message /// </summary> /// <param name="FIXGroup"></param> /// <returns></returns> public bool DecodeFIXGroup(IFIXGroup fixRptGroup) { //-----------Security Level Positions----------------------------------------- IFIXGroup fixPosCountGroup = fixRptGroup.GetGroupByTag(FIXTagConstants.esFIXTagNoPositions,null); if (fixPosCountGroup!=null) { for (int i = 0; i < fixPosCountGroup.get_NumberOfGroups(null); i++) { IFIXGroup fixPosRptGroup = fixPosCountGroup.GetGroupByIndex(i); switch (fixPosRptGroup.get_AsChar(FIXTagConstants.esFIXTagPosType)) { case FIXPosTypeConstants.esFIXPositionTypeFilled: SetPosition (fixPosRptGroup, out m_dNetPos); break; case FIXPosTypeConstants.esFIXPositionTypeRoundTrips: { double dblLongPos, dblShortPos, dblTotalPos; if (fixPosRptGroup.GetDouble(out dblLongPos, FIXTagConstants.esFIXTagLongQty) && fixPosRptGroup.GetDouble(out dblShortPos, FIXTagConstants.esFIXTagShortQty)) { m_iRoundTrips = Int32.Parse(Math.Min(dblLongPos, dblShortPos).ToString()); dblTotalPos = dblLongPos + dblShortPos; m_iNoFills = Int32.Parse(dblTotalPos.ToString()); } else m_iRoundTrips = null; break; } } } } IFIXGroup fixPosAmountGroup = fixRptGroup.GetGroupByTag(FIXTagConstants.esFIXTagNoPosAmt, null); if (fixPosAmountGroup!=null) { for (int i = 0; i < fixPosAmountGroup.get_NumberOfGroups(null); i++) { IFIXGroup fixAmtRptGroup = fixPosAmountGroup.GetGroupByIndex(i); switch (fixAmtRptGroup.get_AsChar(FIXTagConstants.esFIXTagPosAmtType)) { case FIXPosAmtTypeConstants.esFIXPosAmtTypePAL: SetPrice (fixAmtRptGroup, out m_dPAL); break; } } } return true; }