Search code examples
c++financefix-protocol

FIX API of FXCM: Get the price value every T period


I am doing some tests on the FIX engine sample of FXCM. The complete code is available here. There is a function void FixApplication::SubscribeMarketData() that allow to continuously receive update of a particular symbol of the Market. Here is what it look like :

// Subscribes to the EUR/USD trading security
void FixApplication::SubscribeMarketData()
{
    // Subscribe to market data for EUR/USD
    string request_ID = "EUR_USD_Request_";
    FIX44::MarketDataRequest request;
    request.setField(MDReqID(request_ID));
    request.setField(SubscriptionRequestType(
        SubscriptionRequestType_SNAPSHOT_PLUS_UPDATES));
    request.setField(MarketDepth(0));
    request.setField(NoRelatedSym(1));

    // Add the NoRelatedSym group to the request with Symbol
    // field set to EUR/USD
    FIX44::MarketDataRequest::NoRelatedSym symbols_group;
    symbols_group.setField(Symbol("EUR/USD"));

    request.addGroup(symbols_group);

    // Add the NoMDEntryTypes group to the request for each MDEntryType
    // that we are subscribing to. This includes Bid, Offer, High, and Low
    FIX44::MarketDataRequest::NoMDEntryTypes entry_types;
    entry_types.setField(MDEntryType(MDEntryType_BID));
    request.addGroup(entry_types);
    entry_types.setField(MDEntryType(MDEntryType_OFFER));
    request.addGroup(entry_types);
    entry_types.setField(MDEntryType(MDEntryType_TRADING_SESSION_HIGH_PRICE));
    request.addGroup(entry_types);
    entry_types.setField(MDEntryType(MDEntryType_TRADING_SESSION_LOW_PRICE));
    request.addGroup(entry_types);

    Session::sendToTarget(request, sessionID(true));
}

Is there a way to tell the FIX server that I only want to receive updates every 5min ? Or should I implement a function that catch the continuous flow of data and output a data every 5 min?

I already tried to search for a parameter in the FIX engine that I could modify to return a T periodic flow of data but I didn't find anything. If it exist I prefer to use it rather than create a function to handle the ticks flow.


Solution

  • The feature you are suggesting would be have to be a counterparty-specific feature implemented with probably custom fields. I don't believe the standard FIX dictionary provides fields that would support this.

    So, yes, your hypothetical client-side solution would be the way to go.