How can we apply a filter in quick consumer application in RFA.net to get only Ask/Bid Prices.

Sample code:

FieldList fieldList = payload as FieldList;
///Console.WriteLine("FieldList's entry count: " + fieldList.StandardDataCount);
short fieldId;
foreach (FieldEntry fieldEntry in fieldList)
{

fieldId = fieldEntry.FieldID;
try
{

RDMFidDef fidDef = rdmFieldDictionary.GetFidDef(fieldId);

}

moragodkrit

Best Answer

  • Gurpreet
    Answer ✓

    There are two ways to do this:

    a. In the foreach iterator, compare each fieldId to the one you desire (BID, ASK) and ignore others.

    b. Send a view request, whereby only the fids that are requested are returned in the update messages. This capability is a licenseable feature, and has to be enabled on your ADS. Look at StarterConsumer_BatchView example for details.

Answers

  • Currently i am using first approach only. I am filtering out based on the Field names like BID or ASK but i am filtering after information coming from server.

    Can i do the filtering before sending the request like based on Field ID (22 or 25) for Ask or BID? Will this number be changed or it will remain same?

  • >> Can i do the filtering before sending the request ...

    This is the View feature, presented in the option (b) above.