title: quickfix python marketdatarequest
body: <p>Im trying to replicate a MarketDataRequest in Python that I have in Java but cant find any code example.  Has anyone any experience with Python and Quickfix</p>
  
  <p>The Java code looks like this:</p>
  
  <pre><code>MarketDataRequest mdr = new MarketDataRequest();
  
  if (subscribed)
  {
      mdr.set(new SubscriptionRequestType(SubscriptionRequestType.DISABLE_PREVIOUS_SNAPSHOT_PLUS_UPDATE_REQUEST));
      Session.sendToTarget(mdr, sessionId);
  }
  
  mdr.set(new MDReqID("1"));
  mdr.set(new SubscriptionRequestType(SubscriptionRequestType.SNAPSHOT_PLUS_UPDATES));
  mdr.set(new MarketDepth(0));
  mdr.set(new MDUpdateType(MDUpdateType.INCREMENTAL_REFRESH));
  
  mdr.set(new NoMDEntryTypes(2));
  
  MarketDataRequest.NoMDEntryTypes entries = new MarketDataRequest.NoMDEntryTypes();
  entries.set(new MDEntryType(MDEntryType.BID));
  mdr.addGroup(entries);
  entries.set(new MDEntryType(MDEntryType.OFFER));
  mdr.addGroup(entries);
  
  mdr.set(new NoRelatedSym(pairs.size()));
  
  MarketDataRequest.NoRelatedSym symbols = new MarketDataRequest.NoRelatedSym();
  
  for (String pair : pairs)
  {
      symbols.set(new Instrument(new Symbol(pair)));
      mdr.addGroup(symbols);
  }
  
  Session.sendToTarget(mdr, sessionId);
  </code></pre>
  
  <p>So far in Python I have this:</p>
  
  <pre><code>mdr = fix.Message()
  mdr.getHeader().setField(fix.BeginString(fix.BeginString_FIX44))
  mdr.getHeader().setField(fix.MsgType(fix.MsgType_MarketDataRequest))
  
  mdr.setField(fix.MDReqID('1'))
  mdr.setField(fix.SubscriptionRequestType(fix.SubscriptionRequestType_SNAPSHOT_PLUS_UPDATES))
  mdr.setField(fix.MarketDepth(0))
  mdr.setField(fix.NoMDEntryTypes(2))
  mdr.setField(fix.MDUpdateType(fix.MDUpdateType_INCREMENTAL_REFRESH))
  </code></pre>