Example #1
0
        static void Main()
        {
            try
            {
                ClientInitiator      app            = new ClientInitiator();
                SessionSettings      settings       = new SessionSettings(@"C:\Users\anhtv\Desktop\QuickFix\QuickFix\initiator.cfg");
                QuickFix.Application application    = new ClientInitiator();
                FileStoreFactory     storeFactory   = new FileStoreFactory(settings);
                ScreenLogFactory     logFactory     = new ScreenLogFactory(settings);
                MessageFactory       messageFactory = new DefaultMessageFactory();

                SocketInitiator initiator = new SocketInitiator(application, storeFactory, settings, logFactory, messageFactory);
                initiator.start();
                Thread.Sleep(3000);
                System.Collections.ArrayList list = initiator.getSessions();
                SessionID sessionID = (SessionID)list[0];
                Console.WriteLine("Press any key: ");
                string x = Console.ReadLine();
                QuickFix42.NewOrderSingle order = new QuickFix42.NewOrderSingle(new ClOrdID("Hello"), new HandlInst(HandlInst.AUTOMATED_EXECUTION_ORDER_PRIVATE), new Symbol("ABC"), new Side(Side.SELL), new TransactTime(DateTime.Now), new OrdType(OrdType.MARKET));
                bool sent = Session.sendToTarget(order, sessionID);
                Console.ReadLine();
                initiator.stop();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                Console.ReadLine();
            }
        }
Example #2
0
        static SocketInitiator StartSocketInitiator(String configFile)
        {
            ClientInitiator app      = new ClientInitiator();
            SessionSettings settings = new SessionSettings(configFile);

            QuickFix.Application application    = new ClientInitiator();
            FileStoreFactory     storeFactory   = new FileStoreFactory(settings);
            ScreenLogFactory     logFactory     = new ScreenLogFactory(settings);
            MessageFactory       messageFactory = new DefaultMessageFactory();

            SocketInitiator initiator = new SocketInitiator(application, storeFactory, settings, logFactory, messageFactory);

            initiator.start();
            Thread.Sleep(3000);
            return(initiator);
        }
Example #3
0
        static SocketInitiator StartSocketInitiator(String configFile)
        {
            ClientInitiator app = new ClientInitiator();
            SessionSettings settings = new SessionSettings(configFile);
            QuickFix.Application application = new ClientInitiator();
            FileStoreFactory storeFactory = new FileStoreFactory(settings);
            ScreenLogFactory logFactory = new ScreenLogFactory(settings);
            MessageFactory messageFactory = new DefaultMessageFactory();

            SocketInitiator initiator = new SocketInitiator(application, storeFactory, settings, logFactory, messageFactory);
            initiator.start();
            Thread.Sleep(3000);
            return initiator;
        }