{{Quickfixn}} Custom Messages

Roger Hunter rhh.invest at gmail.com
Fri Mar 29 13:29:46 PDT 2013


Hi,

The change from m.SetField to m.Header.SetField for setting the message
type did the trick and things are now working.

However, you should be aware that the reason I used m.SetField was because
of the message in the archives to Felipe on July 31, 2012.
Here's the relevant portion:

Problem 3: You were not using the correct message constructor. (The first

parameter to Message(string,bool) is an entire FIX message string, not just
the 35 field.)

To construct your message with generic methods, it should look like this:

            QuickFix.Message m = new Message();
            m.Header.SetField(new BeginString("FIX.4.4"));
            m.SetField(new QuickFix.Fields.StringField(35, "BW"));
<==== This appears to be incorrect


Expanding the tutorial section on custom messages with some sample
code for constructing messages generically, and for receiving them,
would be a helpful addition. My solution to receiving the response to
this "U1" message (CITI Tradestream) is:

        public void FromApp(Message message, SessionID sessionID)

        {

            try

            {

                Crack(message, sessionID);

            }

            catch (Exception ex)

            {

                string msgType = message.Header.GetField(35);

                if (msgType == "U2")

                {

                    OnAccountDetailsMessage(message, sessionID);

                }

                else

                {

                    string msg = "Tradestream Cracker exception: " +
ex.ToString() + " StackTrace: " + ex.StackTrace;

                    Parent.FIX_RaiseErrorEvent(new
ErrorEventArgs(ErrorType.Exception, 0, msg, 0, null));

                }

            }

        }

Is there a different recommended way to handle this? There is only one
custom message I need to handle.


Of course, I would prefer to build a system using Rudy that handles
this correctly, as you recommend. I know this is not the right forum
for this, but perhaps you can help with my problem installing Ruby so
that I can run "gem install nokogiri" successfully. Here are the steps
I took (my system is Windows 7):

1. Install 64 bit Ruby using rubyinstaller-2.0.0-p0-x64.exe (it ends
up in c:\Ruby200-x64)

2. Install the dev kit DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe
(extract into :\Ruby200-x64\DevKit, then follow the instructions
through to jason, which was successful). There are three choices for
the DevKit, but I could find no guidance as to which one to use so I
chose the one with two occurrences of 64 in its name.

3. Run "gem install nokogiri".  This results in:

c:\Ruby200-x64\DevKit>gem install nokogiri

Temporarily enhancing PATH to include DevKit...

Building native extensions.  This could take a while...

ERROR:  Error installing nokogiri:

        ERROR: Failed to build gem native extension.


    C:/Ruby200-x64/bin/ruby.exe extconf.rb

The system cannot find the path specified.

checking for libxml/parser.h... no

-----

libxml2 is missing.  please visit
http://nokogiri.org/tutorials/installing_nokogiri.html for help with
installing dependencies.

-----

*** extconf.rb failed ***

Could not create Makefile due to some reason, probably lack of necessary

libraries and/or headers.  Check the mkmf.log file for more details.  You may

need configuration options.


Provided configuration options:

        --with-opt-dir

        --without-opt-dir

        --with-opt-include

        --without-opt-include=${opt-dir}/include

        --with-opt-lib

        --without-opt-lib=${opt-dir}/lib

        --with-make-prog

        --without-make-prog

        --srcdir=.

        --curdir

        --ruby=C:/Ruby200-x64/bin/ruby

        --with-zlib-dir

        --without-zlib-dir

        --with-zlib-include

        --without-zlib-include=${zlib-dir}/include

        --with-zlib-lib

        --without-zlib-lib=${zlib-dir}/lib

        --with-iconv-dir

        --without-iconv-dir

        --with-iconv-include

        --without-iconv-include=${iconv-dir}/include

        --with-iconv-lib

        --without-iconv-lib=${iconv-dir}/lib

        --with-xml2-dir

        --without-xml2-dir

        --with-xml2-include

        --without-xml2-include=${xml2-dir}/include

        --with-xml2-lib

        --without-xml2-lib=${xml2-dir}/lib

        --with-xslt-dir

        --without-xslt-dir

        --with-xslt-include

        --without-xslt-include=${xslt-dir}/include

        --with-xslt-lib

        --without-xslt-lib=${xslt-dir}/lib

        --with-libxslt-config

        --without-libxslt-config

        --with-pkg-config

        --without-pkg-config

        --with-libxml-2.0-config

        --without-libxml-2.0-config

        --with-pkg-config

        --without-pkg-config

        --with-libiconv-config

        --without-libiconv-config

        --with-pkg-config

        --without-pkg-config



Gem files will remain installed in
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/nokogiri-1.5.9 for inspection.

Results logged to
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/nokogiri-1.5.9/ext/nokogiri/gem_make.out


c:\Ruby200-x64\DevKit>


The tutorials referenced here are no help --- the implication is that "gem
install nokogiri" will not fail on Windows.
Searching the web provided many wild and wonderful suggestions, none of
which worked. I did try "gem install nokogiri -- --with-xml2-lib
--with-xslt-lib --platform=ruby" to no avail.
I am a total novice with Ruby, so I could be missing something simple.

Thanks
Roger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20130329/8e837b6d/attachment-0002.htm>


More information about the Quickfixn mailing list