Thread: [Quickfix-developers] Custom message
Brought to you by:
orenmnero
|
From: Mike S. <MS...@rj...> - 2006-03-10 16:46:48
|
Hi, =20 I'm trying to connect to an exchange and they have a custom Trader Login message with a message type of CG. Has anybody created a custom message before? If so, could you send me a code sample or give me a few tips? =20 Thanks, =20 Mike |
|
From: Joerg T. <Joe...@ma...> - 2006-03-10 17:17:22
|
Hi Mike,
> I'm trying to connect to an exchange and they have a custom Trader Logi=
n
> message with a message type of CG. Has anybody created a custom messag=
e
> before? If so, could you send me a code sample or give me a few tips?
I assume this message is outbound, ie to be sent to the exchange.
The FIX messages for QF are generated by some XSLT and Ruby scripts from =
the FIX data=20
dictionary. You could use these scripts to generate your own messages fro=
m a modified=20
FIX4*.xml file, but I do not know how much tweaking is still needed to do=
this.
If you just need one message, just copy a small message, ie NewOrderSingl=
e and adapt it to=20
your needs. I.e. for java code in quickfix/src/java/src/quickfix/fix40/Ne=
wOrderSingle.java:
package quickfix.fix40;
import quickfix.FieldNotFound;
import quickfix.Group;
import quickfix.field.*;
public class NewOrderSingle extends Message
{
public NewOrderSingle()
{
getHeader().setField(new MsgType("D"));
}
public NewOrderSingle(
quickfix.field.ClOrdID aClOrdID,
quickfix.field.HandlInst aHandlInst,
quickfix.field.Symbol aSymbol,
quickfix.field.Side aSide,
quickfix.field.OrderQty aOrderQty,
quickfix.field.OrdType aOrdType ) {
getHeader().setField(new MsgType("D"));
set(aClOrdID);
set(aHandlInst);
set(aSymbol);
set(aSide);
set(aOrderQty);
set(aOrdType);
}
public void set(quickfix.field.ClOrdID value)
{ setField(value); }
public quickfix.field.ClOrdID get(quickfix.field.ClOrdID value)
throws FieldNotFound
{ getField(value); return value; }
...
Copy this to your code tree and adapt it, eg:
package smith.mike...;
import quickfix.FieldNotFound;
import quickfix.Group;
import quickfix.field.*;
public class CustomMessage extends Message
{
public CustomMessage()
{
getHeader().setField(new MsgType("CG"));
}
public CustomMessage(
quickfix.field.XXX field1, ... ) {
getHeader().setField(new MsgType("CG"));
set(field1);
...
}
public void set(quickfix.field.XXX value)
{ setField(value); }
public quickfix.field.XXX get(quickfix.field.XXX value)
throws FieldNotFound
{ getField(value); return value; }
...
If you have repeating group, this is a bit more complicated.
Now you can say
message =3D new CustomMessage( value1, .... );
Session.sendToTarget( message, sessionId ); ...
If you want to receive such message, you have to update your data diction=
ary to include it
and create your own MessageFactory to tell QF how to messages with MsgTyp=
e=3DCG to a Java=20
object.
Please apply this to C# or C++ analogeously.
Cheers, J=F6rg
--=20
Joerg Thoennes
http://macd.com
Tel.: +49 (0)241 44597-24 Macdonald Associates GmbH
Fax : +49 (0)241 44597-10 Lothringer Str. 52, D-52070 Aachen
|
|
From: Dale W. <wil...@oc...> - 2006-03-13 18:56:46
|
Hi All, I just downloaded quickfix-1.11.1.zip (source distribution); unzipped it; and built it with VC7.1. Two of the header files are not being copied from .../src/C++/fix42 to ../include/quickfix/fix42 The "missing" files are TestReport.h and QuoteStatusRequest.h When I copy them "by hand" everything seems to work ok. Before I spend time tracking down the "why" I thought I'd ask to see if anyone knew what's going on. Dale |
|
From: Dale W. <wil...@oc...> - 2006-03-13 19:09:39
|
Dale Wilson wrote:
> Hi All,
>
> I just downloaded quickfix-1.11.1.zip (source distribution); unzipped
> it; and built it with VC7.1.
> Two of the header files are not being copied from .../src/C++/fix42 to
> ../include/quickfix/fix42
> The "missing" files are TestReport.h and QuoteStatusRequest.h
>
> When I copy them "by hand" everything seems to work ok.
>
> Before I spend time tracking down the "why" I thought I'd ask to see
> if anyone knew what's going on.
>
> Dale
I just figured it out. The post build step puts "test" in the exclude
file. xcopy /? says:
/EXCLUDE:file1[+file2][+file3]...
Specifies a list of files containing strings. Each string
should be in a separate line in the files. When any of the
strings match any part of the absolute path of the file to be
copied, that file will be excluded from being copied. For
example, specifying a string like \obj\ or .obj will exclude
all files underneath the directory obj or all files with the
.obj extension respectively.
TestReport.h is obvious: TESTreport.h
It took a moment, however to grok: quoTESTatusrequest.h
I'll do a bugreport on this one.
Dale
|
|
From: Joerg T. <Joe...@ma...> - 2006-03-14 10:30:49
|
Hi Mike,
I missed some bits below:
"extends Message" refers to the definition of Message in the _same_ packa=
ge, ie
quickfix.fix40.Message in the case below.
If you have the new message in an own package, the line
public class CustomMessage extends Message
should be
public class CustomMessage extends quickfix.fixNN.Message
where NN is the appropriate FIX version the exchange is using (40..44).
Cheers, J=F6rg
>> I'm trying to connect to an exchange and they have a custom Trader Log=
in
>> message with a message type of CG. Has anybody created a custom messa=
ge
>> before? If so, could you send me a code sample or give me a few tips?
>=20
>=20
> I assume this message is outbound, ie to be sent to the exchange.
>=20
> The FIX messages for QF are generated by some XSLT and Ruby scripts fro=
m=20
> the FIX data dictionary. You could use these scripts to generate your=20
> own messages from a modified FIX4*.xml file, but I do not know how much=
=20
> tweaking is still needed to do this.
>=20
> If you just need one message, just copy a small message, ie=20
> NewOrderSingle and adapt it to your needs. I.e. for java code in=20
> quickfix/src/java/src/quickfix/fix40/NewOrderSingle.java:
>=20
> package quickfix.fix40;
> import quickfix.FieldNotFound;
> import quickfix.Group;
> import quickfix.field.*;
>=20
> public class NewOrderSingle extends Message
> {
> public NewOrderSingle()
> {
> getHeader().setField(new MsgType("D"));
> }
> public NewOrderSingle(
> quickfix.field.ClOrdID aClOrdID,
> quickfix.field.HandlInst aHandlInst,
> quickfix.field.Symbol aSymbol,
> quickfix.field.Side aSide,
> quickfix.field.OrderQty aOrderQty,
> quickfix.field.OrdType aOrdType ) {
>=20
> getHeader().setField(new MsgType("D"));
> set(aClOrdID);
> set(aHandlInst);
> set(aSymbol);
> set(aSide);
> set(aOrderQty);
> set(aOrdType);
> }
>=20
> public void set(quickfix.field.ClOrdID value)
> { setField(value); }
> public quickfix.field.ClOrdID get(quickfix.field.ClOrdID value)
> throws FieldNotFound
> { getField(value); return value; }
>=20
> ...
>=20
> Copy this to your code tree and adapt it, eg:
>=20
> package smith.mike...;
> import quickfix.FieldNotFound;
> import quickfix.Group;
> import quickfix.field.*;
>=20
> public class CustomMessage extends Message
> {
> public CustomMessage()
> {
> getHeader().setField(new MsgType("CG"));
> }
> public CustomMessage(
> quickfix.field.XXX field1, ... ) {
>=20
> getHeader().setField(new MsgType("CG"));
> set(field1);
> ...
> }
>=20
> public void set(quickfix.field.XXX value)
> { setField(value); }
> public quickfix.field.XXX get(quickfix.field.XXX value)
> throws FieldNotFound
> { getField(value); return value; }
>=20
> ...
>=20
> If you have repeating group, this is a bit more complicated.
>=20
> Now you can say
>=20
> message =3D new CustomMessage( value1, .... );
> Session.sendToTarget( message, sessionId ); ...
>=20
> If you want to receive such message, you have to update your data=20
> dictionary to include it
> and create your own MessageFactory to tell QF how to messages with=20
> MsgType=3DCG to a Java object.
>=20
> Please apply this to C# or C++ analogeously.
>=20
> Cheers, J=F6rg
>=20
--=20
Joerg Thoennes
http://macd.com
Tel.: +49 (0)241 44597-24 Macdonald Associates GmbH
Fax : +49 (0)241 44597-10 Lothringer Str. 52, D-52070 Aachen
|
|
From: Oren M. <or...@qu...> - 2006-03-13 19:16:29
|
Yeah, it seems we should be using \test\ --oren Dale Wilson wrote: > Dale Wilson wrote: > >> Hi All, >> >> I just downloaded quickfix-1.11.1.zip (source distribution); unzipped >> it; and built it with VC7.1. >> Two of the header files are not being copied from .../src/C++/fix42 >> to ../include/quickfix/fix42 >> The "missing" files are TestReport.h and QuoteStatusRequest.h >> >> When I copy them "by hand" everything seems to work ok. >> >> Before I spend time tracking down the "why" I thought I'd ask to see >> if anyone knew what's going on. >> >> Dale > > I just figured it out. The post build step puts "test" in the exclude > file. xcopy /? says: > > /EXCLUDE:file1[+file2][+file3]... > Specifies a list of files containing strings. Each string > should be in a separate line in the files. When any of the > strings match any part of the absolute path of the file > to be > copied, that file will be excluded from being copied. For > example, specifying a string like \obj\ or .obj will exclude > all files underneath the directory obj or all files with the > .obj extension respectively. > > TestReport.h is obvious: TESTreport.h > It took a moment, however to grok: quoTESTatusrequest.h > > I'll do a bugreport on this one. > > Dale |
|
From: Caleb E. <cal...@gm...> - 2006-03-13 19:26:59
|
On 3/13/06, Oren Miller <or...@qu...> wrote: > Yeah, it seems we should be using \test\ I just fixed another include-installation bug in src/C++/Makefile.am. The Makefile should have been using $(mkdir_p) to create the $(pkgincludedir) a= s its parent directory (e.g. $(prefix)/include) doesn't necessarily exist. I run into this on every new release since I install into a new directory every time. -- Caleb Epstein caleb dot epstein at gmail dot com |