/// <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> /// Add Ticker defaults for this account /// </summary> /// <param name="sExchange"></param> /// <param name="group"></param> public void AddTicker(string sExchange, IFIXGroup group) { if (!m_TickerMap.ContainsKey(sExchange)) { TickerDefaults temp = new TickerDefaults(sExchange); temp.AddDefaults(group); m_TickerMap.Add(sExchange, temp); } }
private void SetPrice(out PriceVolume thePrice, IFIXGroup singleGroup) { int iVolume = singleGroup.get_AsNumber(FIXTagConstants.esFIXTagMDEntrySize); if (iVolume == 0) { thePrice = new PriceVolume(null, null); } else thePrice = new PriceVolume(iVolume, singleGroup.get_AsDouble(FIXTagConstants.esFIXTagMDEntryPx)); }
/// <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; }
public void SetPrice(IFIXGroup FIXGroup, out double? dblPrice) { double dblValue; if (FIXGroup.GetDouble(out dblValue, FIXTagConstants.esFIXTagPosAmt)) dblPrice = dblValue; else dblPrice = null; IsDirty = true; }
public void SetPosition(IFIXGroup FIXGroup, out double? dblPosition) { double dblValue; if (FIXGroup.GetDouble(out dblValue, FIXTagConstants.esFIXTagPosQty)) dblPosition = dblValue; else dblPosition = null; IsDirty = true; }