{{Quickfixn}} How to write execution report to store file

vishvesh raval vishveshraval at hotmail.com
Thu Jan 30 22:57:29 PST 2014


Hello,     I have created a
application to send messages between client-server and I am having a problem on
server side.I want to write the incoming NewOrderSingle message( .body
extension file) files in store folder on server side.The newordersingle message
along with executionreport message get written into store file on client side.
but on server side I don’t get application messages(file with .body extension)
in store file. How to write the incoming application messages to the file and
not the admin messages. My sample code is as follows.

 

public class clsFIXServer : QuickFix.MessageCracker, QuickFix.IApplication

 {

                 public void
FromApp(QuickFix.Message message, QuickFix.SessionID sessionID)

        {

            Console.WriteLine("IN:  "
+ message);

            Crack(message, sessionID);

        }

                 public void
OnCreate(QuickFix.SessionID sessionID)

        {

            

        }

 

        public void OnLogon(QuickFix.SessionID
sessionID)

        {

            

        }

 

        public void OnLogout(QuickFix.SessionID
sessionID)

        {

            

        }

 

        public void ToAdmin(QuickFix.Message
message, QuickFix.SessionID sessionID)

        {

            

        }

 

        public void ToApp(QuickFix.Message
message, QuickFix.SessionID sessionId)

        {

            Console.WriteLine("OUT: " + message);

        }

 

      QuickFix.FIX44.ExecutionReport
exReport = new QuickFix.FIX44.ExecutionReport(

                new
OrderID(GenOrderID()),

                new
ExecID(GenExecID()),

                new
ExecType(ExecType.FILL),

                new
OrdStatus(OrdStatus.FILLED),

                symbol, 

                side,

                new
LeavesQty(0),

                new
CumQty(orderQty.getValue()),

                new
AvgPx(price.getValue()));

 

            exReport.Set(clOrdID);

            exReport.Set(symbol);

            exReport.Set(orderQty);

            exReport.Set(new LastQty(orderQty.getValue()));

            exReport.Set(new LastPx(price.getValue()));

 

            if
(n.IsSetAccount())

                exReport.SetField(n.Account);

 

            try

            {

                Session.SendToTarget(exReport,
s);

            }

            catch
(SessionNotFound ex)

            {

                Console.WriteLine("==session not found exception!==");

                Console.WriteLine(ex.ToString());

            }

            catch
(Exception ex)

            {

                Console.WriteLine(ex.ToString());

            }

        }

}

 

                

 

My client side function
that creates the newordersingle message :-

 

 

 

public void Run()

{

objEMSOrder =
((FIXFormatter.EMSOrder)messageQueue.Receive().Body);

if
(this._session.SessionID.BeginString == "FIX.4.4")

 {

  QuickFix.FIX44.NewOrderSingle m = objMessageCreator.NewOrderSingle44MessageCreator(objEMSOrder);


                           //DLL FUNCTION THAT CREATES MESSAGE                          

       if
(m != null)

         {

             m.Header.GetField(Tags.BeginString);

 

             SendMessage(m);

         }

  }

} 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20140131/1ffbb88d/attachment-0001.htm>


More information about the Quickfixn mailing list