{{Quickfixn}} Getting Acceptor Executor to send execution report to CLIENT1

Jonathan Hodgson jhodgson at temenos.com
Fri Aug 24 08:37:00 PDT 2012


Grant,

  Thanks for that, I have now managed to setup my initiator CLIENT1 and got heartbeat communication with my EXECUTOR acceptor



Acceptor Executor VB code

sub
     Dim osessionSettings As New SessionSettings("executor.cfg")
            Dim application As New Application
            Dim storeFactory As New FileStoreFactory(osessionSettings)
            Dim logFactory As New ScreenLogFactory(osessionSettings)
            Dim messageFactory As New DefaultMessageFactory
            Dim acceptor As New ThreadedSocketAcceptor _
                (application, storeFactory, osessionSettings, logFactory)
            acceptor.Start()
            Console.WriteLine("press <enter> to quit")
            Console.Read()
            Do
                Call SendExecutionReport()
            Loop While LoggedOn = False
End sub

Private Sub SendExecutionReport()
        Dim sSenderCompID, sTargetCompID As String
        Dim symbol As New Symbol
        Dim side As New Symbol
        Dim ordType As New OrdType
        Dim orderQty As New OrderQty
        Dim price As New Price
        Dim clOrdID As New ClOrdID
        Dim mySessionID As QuickFix.SessionID

Dim executionReport As New QuickFix.FIX44.ExecutionReport(genOrderID(), genExecID(), New ExecType(ExecType.FILL), New OrdStatus(OrdStatus.FILLED), New Symbol, New Side, New LeavesQty(0), New CumQty(orderQty.getValue()), New AvgPx(price.getValue()))

        executionReport.Set(clOrdID)
        executionReport.Set(orderQty)
        executionReport.Set(New LastQty(orderQty.getValue()))
        executionReport.Set(New LastPx(price.getValue()))
        sSenderCompID = "EXECUTOR"
        sTargetCompID = "CLIENT1"
        mySessionID = New SessionID("FIX.4.4", sSenderCompID, sTargetCompID)

        Try
            Debug.Print("Sending Execution Report")
            Session.SendToTarget(executionReport, mySessionID)
        Catch ee As SessionNotFound
        End Try
    End Sub

Acceptor EXECUTOR - Config
ConnectionType=acceptor
SocketAcceptPort=5001
SocketReuseAddress=Y
StartTime=00:00:00
EndTime=00:00:00
FileLogPath=C:\fixfiles\logs
UseDataDictionary=Y
ResetOnLogon=Y
ResetOnLogout=Y
ResetOnDisconnect=Y

[SESSION]
BeginString=FIX.4.4
SenderCompID=EXECUTOR
TargetCompID=CLIENT1
FileStorePath=c:\fixfiles\
DataDictionary=C:\fixfiles\Spec\FIX44.xml




Once I add the SendExecutionReport code it appears to work with no exception being generated, in debug the
Public Sub toApp(ByVal message As QuickFix.Message, ByVal sessionID As QuickFix.SessionID) Implements QuickFix.Application.ToApp
End Sub



ToApp got invoked (in executor) after the Session.SendToTarget is run but I am not getting any response in the CLIENT

Initiator CLIENT1 VB code
Sub Main()
        mySessionSettings = New SessionSettings("myconfig.cfg")
        myApplication = New Application
        myStoreFactory = New FileStoreFactory(mySessionSettings)
        myMessageFactory = New DefaultMessageFactory
        myLogFactory = New ScreenLogFactory(True, True, True)
        myInitiator = New QuickFix.Transport.SocketInitiator(myApplication, myStoreFactory, mySessionSettings, myLogFactory)
        myInitiator.start()

        Do
        Loop While LoggedOn = False
    End Sub
I was expecting to get a response in OnMessage for my 44 execution report
Public Overloads Sub onMessage(ByVal message As QuickFix.FIX44.ExecutionReport, ByVal Param As QuickFix.SessionID)
        System.Console.WriteLine()
        MsgBox("mesaage received")
    End Sub

Initiator CLIENT1 - myconfig.cfg
[DEFAULT]
ConnectionType=initiator
ReconnectInterval=2
FileStorePath=c:\fixfiles
StartTime=00:00:00
EndTime=00:00:00
UseDataDictionary=N
DataDictionary=C:\fixfiles\Dictionary\
HttpAcceptPort=9911
SocketConnectHost=127.0.0.1
SocketConnectPort=5001
FileLogPath=C:\fixfiles\logs
LogoutTimeout=5
ResetOnLogon=Y
# standard config elements
[SESSION]
# inherit ConnectionType, ReconnectInterval and SenderCompID from default
BeginString=FIX.4.4
SenderCompID=CLIENT1
TargetCompID=EXECUTOR
HeartBtInt=30



Any suggestions would be appreciated

Thanks

Jonathan



Message: 2

Date: Tue, 14 Aug 2012 09:43:58 -0500

From: Grant Birchmeier <gbirchmeier at connamara.com<mailto:gbirchmeier at connamara.com>>

To: "Mailing list for QuickFIX/n" <quickfixn at lists.quickfixn.com<mailto:quickfixn at lists.quickfixn.com>>

Subject: Re: {{Quickfixn}} re question RE: Quickfixn Digest, Vol 10,

                Issue 23

Message-ID:

                <CAMq4opNqfiKxx85-S5QuHoyeDFp7syzg-YLs5h8N=g7XvbXVnQ at mail.gmail.com<mailto:CAMq4opNqfiKxx85-S5QuHoyeDFp7syzg-YLs5h8N=g7XvbXVnQ at mail.gmail.com>>

Content-Type: text/plain; charset="windows-1252"



Your Initiator code looks alright at a glance.  (I don't know VB, but it seems obvious enough.)



Looks like you want to write an Acceptor to test your app against.  I don't recommend using SimpleAcceptor.  Instead, I'd look at Executor.  It's a simple app that responds to every NewOrderSingle message with an ExecutionReport message (it does this in the OnMessage/NewOrderSingle handler).  I think you'll see how it works fairly quickly.  (For your purposes, you can cut out all the non-FIX4.4 functions.)



Since you're not sending NewOrder messages, you'll want to trigger to the ExecReport some other way.  You can easily move that ExecReport creation/sending code into a standalone function, and maybe you can trigger that on-demand via, say, a button or command-line command.



You can use the same config for both Init and Acc, but each will need it's own [SESSION] section with ConnectionType specified.  The TargetCompID for one should be the SenderCompID for the other.



One last detail: Do you have a specification for Bloomberg's ExecReport interface?



FIX is a very slippery protocol, and no counterparty I've ever worked with uses the default vanilla message formats.  I'd guess that Bloomberg has added or altered fields, and they should have documentation detailing that.

In that case, you'll need to update the DataDictionary to match Bloomberg.



Also, Bloomberg's config might require you to change some settings in your config.  You should review the options in the QF/n config doc page.

http://quickfixn.org/tutorial/configuration



-Grant





The information in this e-mail and any attachments is confidential and may be legally privileged. 
It is intended solely for the addressee or addressees. Any use or disclosure of the contents 
of this e-mail/attachments by a not intended recipient is unauthorized and may be unlawful. 
If you have received this e-mail in error please notify the sender. 
Please note that any views or opinions presented in this e-mail are solely those of the author and 
do not necessarily represent those of TEMENOS. 
We recommend that you check this e-mail and any attachments against viruses. 
TEMENOS accepts no liability for any damage caused by any malicious code or virus transmitted by this e-mail.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20120824/08459295/attachment-0001.htm>


More information about the Quickfixn mailing list