using QuickFix; using QuickFix.Fields; SessionID sessionId = new SessionID("FIX.4.4", "SENDER", "TARGET"); Message message = new Message(); message.Header.SetField(new MsgType("D")); message.SetField(new Symbol("AAPL")); message.SetField(new Side(Side.BUY)); Session.SendToTarget(message, sessionId);
using QuickFix; using QuickFix.FIX44; public class MyApplication : MessageCracker, IApplication { public void FromApp(Message message, SessionID sessionId) { Crack(message, sessionId); } public void OnMessage(ExecutionReport message, SessionID sessionId) { // process execution report message } } SessionSettings settings = new SessionSettings("config.cfg"); MyApplication myApplication = new MyApplication(); IMessageStoreFactory storeFactory = new FileStoreFactory(settings); ILogFactory logFactory = new FileLogFactory(settings); IInitiator initiator = new SocketInitiator(myApplication, storeFactory, settings, logFactory); initiator.Start();This example receives a FIX message (in this case, an execution report) and processes it using the `OnMessage()` method. The `MessageCracker` class automatically routes the message to the appropriate `OnMessage()` method based on the message type. Package library: QuickFix.NET