|
From: Toli K. <to...@ma...> - 2007-03-29 00:47:34
|
Naresh,
Maybe i'm not understanding what you ultimately want to do.
> 1) Given a message name (e.g. "NewOrderSingle"), how can I get the msgTyp=
e
> (e.g. "D") using the DataDictionary? I do not readily see an method to do
> this.
The usual pattern is to use a MessageFactory to create a message:
factory.create(MsgType.ORDER_SINGLE)
> 2) Is it safe to create fields using code like new ClOrdID("321")? I see
> that the constructor of ClOrdID hard codes the field tag to "11". Are the=
se
> tags values same across all FIX versions? I am thinking of this alternate
> approach to pick up the tag value from the data dictionary =96 does it ma=
ke
> sense or is it needlessly complicated?
The ClOrdID.FIELD value is the same across all FIX versions. the
quickfix.field.xxx objects are auto-generated from the FIX4x.xml data
dictionary files so the values should be constant.
> new StringField(dd.getFieldTag("ClOrdID"), "321")
so this may be better written as: new ClOrdID("321") or new
StringField(ClOrdID.FIELD, "321") if you don't want to be specific.
If you are adding your own custom fields to the FIX4x.xml file, then
go ahead and create the objects for them - that's what we did, you can
see the example at
http://trac.marketcetera.org/trac.fcgi/browser/platform/trunk/core/src/main=
/java/org/marketcetera/quickfix/customfields/NoMarketDataSnapshots.java
hope this helps.
--=20
Toli Kuznets
http://www.marketcetera.com: Open-Source Trading Platform
download.run.trade.
|