|
From: Colin D. <co...@ma...> - 2019-08-22 12:34:05
|
Pavel, Still not quite there when building symbol groups. MDReqGrp isn't really a tag (field), it's a conceptual grouping of fields. For each symbol, you need to do this: - Create a new field group for your message - Add the corresponding fields to the group (55 and 167, simple case, for equities, say) - Add the group to the message You also need to set the number of groups you've added. Take a look here: https://source.marketcetera.org/root/branches/4.0.x/core/src/main/java/org/marketcetera/quickfix/FIXMessageFactory.java lines 415-444 int numSymbols = 0; if(inInstruments != null) { numSymbols = inInstruments.size(); if(numSymbols == 0){ request.setInt(quickfix.field.NoRelatedSym.FIELD, numSymbols); } for(Instrument instrument : inInstruments) { if(instrument != null) { InstrumentToMessage<?> instrumentFunction = InstrumentToMessage.SELECTOR.forInstrument(instrument); Group symbolGroup = msgFactory.create(beginString, MsgType.MARKET_DATA_REQUEST, NoRelatedSym.FIELD); instrumentFunction.set(instrument, fixDictionary, quickfix.field.MsgType.ORDER_SINGLE, symbolGroup); // some weirdness for currencies symbolGroup.removeField(quickfix.field.Currency.FIELD); symbolGroup.removeField(quickfix.field.OrdType.FIELD); if(inExchange != null && !inExchange.isEmpty()) { symbolGroup.setField(new quickfix.field.SecurityExchange(inExchange)); } request.addGroup(symbolGroup); } } } else { request.setInt(quickfix.field.NoRelatedSym.FIELD, 0); } Some of this code is idiomatic, and won't translate directly to your application, but, the generate idea is there. Create the group, set the fields in the group, add the group to the message. On 8/22/19 2:33 AM, Pavel Tashev wrote: > QuickFIX/J Documentation: http://www.quickfixj.org/documentation/ > QuickFIX/J Support: http://www.quickfixj.org/support/ > > > > cannot find symbol > symbol: class MDReqGrp > location: class quickfix.fix44.MarketDataRequest > > cannot find symbol > symbol: class MDReqGrp > location: class quickfix.fix44.MarketDataRequest > > On Thu, Aug 22, 2019 at 12:17 PM Pavel Tashev > <pav...@wh... > <mailto:pav...@wh...>> wrote: > > Ok, I change the code to this: > > charzero='0'; > charone='1'; > quickfix.fix44.MarketDataRequestmessage=newquickfix.fix44.MarketDataRequest(); > message.setField(newquickfix.field.MDReqID("EURUSD")); //262 > message.setField(newquickfix.field.SubscriptionRequestType(one)); > //263 > message.setField(newquickfix.field.MarketDepth(1)); //264 > message.setField(newquickfix.field.MDUpdateType(0)); // 265 > quickfix.fix44.MarketDataRequest.MDReqGrpgroupMDReqGrp=newquickfix.fix44.MarketDataRequest.MDReqGrp(); > groupMDReqGrp.set(newNoMDEntryTypes('2')); //267 > groupMDReqGrp.set(newMDEntryType(zero)); //269 > groupMDReqGrp.set(newMDEntryType(one)); //269 > message.addGroup(groupMDReqGrp); > quickfix.fix44.MarketDataRequest.InstrmtMDReqGrpgroupInstrmtMDReqGrp=newquickfix.fix44.MarketDataRequest.InstrmtMDReqGrp(); > groupInstrmtMDReqGrp.set(newNoRelatedSym(1)); //146 > message.addGroup(groupInstrmtMDReqGrp); > Session.sendToTarget(message, senderCompID, marketTargetCompID); > > I changed fix42 to fix44 because I use FIX.4.4. Maven now fires > this error: > > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile > (default-compile) on project automated: Compilation failure: > Compilation failure: > [ERROR] > /var/quickfixj/automated/src/main/java/com/automated/Application.java:[318,41] > cannot find symbol > [ERROR] symbol: class MDReqGrp > [ERROR] location: class quickfix.fix44.MarketDataRequest > [ERROR] > /var/quickfixj/automated/src/main/java/com/automated/Application.java:[318,103] > cannot find symbol > [ERROR] symbol: class MDReqGrp > [ERROR] location: class quickfix.fix44.MarketDataRequest > [ERROR] > /var/quickfixj/automated/src/main/java/com/automated/Application.java:[324,41] > cannot find symbol > [ERROR] symbol: class InstrmtMDReqGrp > [ERROR] location: class quickfix.fix44.MarketDataRequest > [ERROR] > /var/quickfixj/automated/src/main/java/com/automated/Application.java:[324,117] > cannot find symbol > [ERROR] symbol: class InstrmtMDReqGrp > [ERROR] location: class quickfix.fix44.MarketDataRequest > [ERROR] -> [Help 1] > > On Wed, Aug 21, 2019 at 3:24 PM <tom...@up... > <mailto:tom...@up...>> wrote: > > QuickFIX/J Documentation: http://www.quickfixj.org/documentation/ > QuickFIX/J <http://www.quickfixj.org/documentation/QuickFIX/J> > Support: http://www.quickfixj.org/support/ > > > Hi Pavel, > > You are doing repeating groups all wrong. See here for how to > supply > repeating groups: > https://www.quickfixj.org/usermanual/2.0.0/usage/repeating_groups.html > > Regards, > -- > Tom Tempelaere > > -----Original Message----- > From: Pavel Tashev <pav...@wh... > <mailto:pav...@wh...>> > Sent: Wednesday, 21 August 2019 13:34 > To: qui...@li... > <mailto:qui...@li...> > Subject: [Quickfixj-users] The order of the tags in the > message I sent is > mixed > > QuickFIX/J Documentation: http://www.quickfixj.org/documentation/ > QuickFIX/J <http://www.quickfixj.org/documentation/QuickFIX/J> > Support: http://www.quickfixj.org/support/ > > > > > --- > This email has been checked for viruses by Avast antivirus > software. > https://www.avast.com/antivirus > > > > _______________________________________________ > Quickfixj-users mailing list > Qui...@li... > <mailto:Qui...@li...> > https://lists.sourceforge.net/lists/listinfo/quickfixj-users > > > > _______________________________________________ > Quickfixj-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfixj-users -- Colin DuPlantis Chief Architect, Marketcetera Download, Run, Trade 888.868.4884 https://www.marketcetera.com |