|
From: Matyas B. <ma...@ba...> - 2006-11-23 08:00:28
|
Hi!
Sorry, we provide the MarketData, so at first I thougth that you need
the construction of this message. But, here is the read example from our
tester...
quickfix.fix42.MarketDataIncrementalRefresh.NoMDEntries noMd = new
quickfix.fix42.MarketDataIncrementalRefresh.NoMDEntries();
int entriesCount = mdIncRefresh.getNoMDEntries().getValue();
for (int i = 1; i < entriesCount + 1; i++)
{
mdIncRefresh.getGroup(i, noMd);
cData = noMd.getSymbol().getValue();
if(noMd.getMDEntryType().getValue() == MDEntryType.BID)
{
tester.getMarketViewPane().setValueAt(Double.toString(noMd.getMDEntryPx().getValue()),row,1);
}
if(noMd.getMDEntryType().getValue() == MDEntryType.OFFER)
{
tester.getMarketViewPane().setValueAt(Double.toString(noMd.getMDEntryPx().getValue()),row,2);
}
tester.getMarketViewPane().setValueAt(noMd.getSecurityType().getValue(),row,3);
tester.getMarketViewPane().setValueAt((noMd.isSetMDEntryID()) ?
noMd.getMDEntryID().getValue() : "-",row,4);
if (noMd.isSetMDUpdateAction())
{
if (noMd.getMDUpdateAction().getValue() ==
noMd.getMDUpdateAction().NEW)
tester.getMarketViewPane().setValueAt("New",row,5);
else if (noMd.getMDUpdateAction().getValue() ==
noMd.getMDUpdateAction().CHANGE)
tester.getMarketViewPane().setValueAt("Change",row,5);
else if (noMd.getMDUpdateAction().getValue() ==
noMd.getMDUpdateAction().DELETE)
tester.getMarketViewPane().setValueAt("Delete",row,5);
else
tester.getMarketViewPane().setValueAt("Unknown",row,5);
}
else
tester.getMarketViewPane().setValueAt("-",row,5);
}
try
{
// Here we just get the timestamp from the message - it has
a better way....
String asd = ((Header)mdIncRefresh.getHeader()).getString(52);
tester.getMarketViewPane().setValueAt(asd.substring(9),row,6);
}
catch (FieldNotFound ex)
{
tester.appendLog("!!! Error: " + ex);
category.error("!!! Error: " + ex);
ex.printStackTrace();
}
category.debug("onMessage(MarketDataIncrementalRefresh): " +
mdIncRefresh);
if(showMVMessage)
System.out.println("onMessage(MarketDataIncrementalRefresh):
(MarketView) " + mdIncRefresh);
}
}
Regards,
Matyas
Hristo Katsarski wrote:
>QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
>QuickFIX/J Support: http://www.quickfixj.org/support/
>Hi Matyas,
>
>Thank you for the example. I was actually looking for the proper way of how to programmatically read the repeating NoMDEntries groups, from an incoming message(I don't need to compose messages for now).
>
>I came to this solution:
>1. get the total number of NoMDEntries groups in a message;
>2. for each number (got in 1.) create a new NoMDEntries(), then fill it from the message, and finally fill-in each specific field in the current 'mdEntry'.
>
>
>Anyway, thanks a lot for your response, it might come handy to me at a later stage!
>
>best regards,
>Hristo
>
>
>----------------------------------------------------------------------
>
>
>>Message: 1
>>Date: Wed, 22 Nov 2006 16:37:16 +0200
>>From: Hristo Katsarski <hr...@ri...>
>>Subject: [Quickfixj-users] Reading MarketDataIncrementalRefresh
>> message
>>To: qui...@li...
>>Message-ID: <456...@ri...>
>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>>Hi,
>>
>>I am new to QuickFix/J and have difficulties reading a FIX 4.4
>>"MarketDataIncrementalRefresh" message.
>>Could somebody post a code snippet, showing how to do this?
>>
>>many thanks,
>>Hristo
>>
>>
>>
>>------------------------------
>>
>>Message: 2
>>Date: Wed, 22 Nov 2006 15:53:00 +0100
>>From: Matyas Barakonyi <ma...@ba...>
>>Subject: Re: [Quickfixj-users] Reading MarketDataIncrementalRefresh
>> message
>>To: qui...@li...
>>Message-ID: <456...@ba...>
>>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>>
>>Hi!
>>
>>This is from our code... The difficult part could be the repeating
>>group. But in the quickfixj webpage there are a good examples...
>>
>> MarketDataIncrementalRefresh mdIncrRefresh = new
>>MarketDataIncrementalRefresh();
>> mdIncrRefresh.set(mdReq.getMDReqID());
>> mdIncrRefresh.set(NO_MD_ENTRIES_1);
>> //Here we create a NoMDEntries group
>> MarketDataIncrementalRefresh.NoMDEntries noMdEntries = new
>>MarketDataIncrementalRefresh.NoMDEntries();
>> noMdEntries.set(new MDUpdateAction(mdUpdateAction));
>> noMdEntries.set(MD_ENTRY_TYPE_INDEX_VALUE);
>> //mdEntryId
>> //mdEntryRefId
>> noMdEntries.set(new Symbol(getSymbolFromReutersCode(rtCode,
>>category)));
>> noMdEntries.set(PRODUCT_CURRENCY);
>> noMdEntries.set(SECURITY_TYPE_FOR);
>> noMdEntries.set(new MDEntryPx(midPrice));
>> //currency
>> //MDEntryDate
>> //MDEntryTime
>> //TickDirection
>> //MDMkt
>> noMdEntries.set(tradSessID);
>> //text
>> //Here we add the group to the message! You can create more than
>>one group...
>> mdIncrRefresh.addGroup(noMdEntries);
>> sendMessage(mdIncrRefresh, sessionID);
>>
>>Regards,
>>Matyas
>>
>>Hristo Katsarski wrote:
>>
>>
>>
>>
>>>QuickFIX/J Documentation: http://www.quickfixj.org/documentation/
>>>QuickFIX/J Support: http://www.quickfixj.org/support/
>>>Hi,
>>>
>>>I am new to QuickFix/J and have difficulties reading a FIX 4.4
>>>"MarketDataIncrementalRefresh" message.
>>>Could somebody post a code snippet, showing how to do this?
>>>
>>>many thanks,
>>>Hristo
>>>
>>>-------------------------------------------------------------------------
>>>Take Surveys. Earn Cash. Influence the Future of IT
>>>Join SourceForge.net's Techsay panel and you'll get the chance to share your
>>>opinions on IT & business topics through brief surveys - and earn cash
>>>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>>>_______________________________________________
>>>Quickfixj-users mailing list
>>>Qui...@li...
>>>https://lists.sourceforge.net/lists/listinfo/quickfixj-users
>>>
>>>
>>>
>>>
>>>
>>
>>
>>------------------------------
>>
>>-------------------------------------------------------------------------
>>Take Surveys. Earn Cash. Influence the Future of IT
>>Join SourceForge.net's Techsay panel and you'll get the chance to share your
>>opinions on IT & business topics through brief surveys - and earn cash
>>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>>
>>------------------------------
>>
>>_______________________________________________
>>Quickfixj-users mailing list
>>Qui...@li...
>>https://lists.sourceforge.net/lists/listinfo/quickfixj-users
>>
>>
>>End of Quickfixj-users Digest, Vol 6, Issue 23
>>**********************************************
>>
>>
>>
>
>
>-------------------------------------------------------------------------
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share your
>opinions on IT & business topics through brief surveys - and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>_______________________________________________
>Quickfixj-users mailing list
>Qui...@li...
>https://lists.sourceforge.net/lists/listinfo/quickfixj-users
>
>
|