Пример #1
0
        static void Main(string[] args)
        {
            System.Console.WriteLine("=============");
            System.Console.WriteLine("This is only an example program.");
            System.Console.WriteLine();
            System.Console.WriteLine("                                                    ! ! !");
            System.Console.WriteLine("              DO NOT USE THIS ON A COMMERCIAL FIX INTERFACE!");
            System.Console.WriteLine("                                                    ! ! !");
            System.Console.WriteLine();
            System.Console.WriteLine("=============");

            try
            {
                QuickFix.SessionSettings settings = new QuickFix.SessionSettings("execution.cfg");
                TradingApp application            = new TradingApp(settings.Get().GetString("LogonName"), settings.Get().GetString("LogonPassword"));
                QuickFix.IMessageStoreFactory      storeFactory = new QuickFix.FileStoreFactory(settings);
                QuickFix.ILogFactory               logFactory   = new QuickFix.FileLogFactory(settings);
                QuickFix.Transport.SocketInitiator initiator    = new QuickFix.Transport.SocketInitiator(application, storeFactory, settings, logFactory);

                // this is a developer-test kludge.  do not emulate.
                application.MyInitiator = initiator;

                initiator.Start();
                application.Run();
                initiator.Stop();
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                System.Console.WriteLine("usage: TradeClient.exe CONFIG_FILENAME");
                System.Environment.Exit(2);
            }

            string file = args[0];

            try
            {
                QuickFix.SessionSettings settings = new QuickFix.SessionSettings(file);
                TradeClientApp application = new TradeClientApp();
                QuickFix.MessageStoreFactory storeFactory = new QuickFix.FileStoreFactory(settings);
                QuickFix.LogFactory logFactory = new QuickFix.ScreenLogFactory(settings);
                QuickFix.Transport.SocketInitiator initiator = new QuickFix.Transport.SocketInitiator(application, storeFactory, settings, logFactory);
                initiator.Start();
                application.Run();
                initiator.Stop();
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
            Environment.Exit(1);
        }
Пример #3
0
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                System.Console.WriteLine("usage: TradeClient.exe CONFIG_FILENAME");
                System.Environment.Exit(2);
            }

            string file = args[0];

            try
            {
                QuickFix.SessionSettings           settings     = new QuickFix.SessionSettings(file);
                TradeClientApp                     application  = new TradeClientApp();
                QuickFix.MessageStoreFactory       storeFactory = new QuickFix.FileStoreFactory(settings);
                QuickFix.LogFactory                logFactory   = new QuickFix.ScreenLogFactory(settings);
                QuickFix.Transport.SocketInitiator initiator    = new QuickFix.Transport.SocketInitiator(application, storeFactory, settings, logFactory);
                initiator.Start();
                application.Run();
                initiator.Stop();
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
            Environment.Exit(1);
        }
Пример #4
0
        static void Main(string[] args)
        {
            Console.WriteLine("=============");
            Console.WriteLine();
            Console.WriteLine("                                                    ! ! !");
            Console.WriteLine("              Test for NASDAQ UMS");
            Console.WriteLine("                                                    ! ! !");
            Console.WriteLine();
            Console.WriteLine("=============");

            string file = "./tradeclient.cfg";

            try
            {
                QuickFix.SessionSettings           settings     = new QuickFix.SessionSettings(file);
                TradeClientApp                     application  = new TradeClientApp();
                QuickFix.IMessageStoreFactory      storeFactory = new QuickFix.FileStoreFactory(settings);
                QuickFix.ILogFactory               logFactory   = new QuickFix.ScreenLogFactory(settings);
                QuickFix.Transport.SocketInitiator initiator    = new QuickFix.Transport.SocketInitiator(application, storeFactory, settings, logFactory);

                application.Initiator = initiator;

                initiator.Start();
                application.Run();
                initiator.Stop();
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
            Environment.Exit(1);
        }
Пример #5
0
 private void disconnectToolStripMenuItem_Click(object sender, EventArgs e)
 {
     Cursor.Current = Cursors.WaitCursor;
     if (!initiator.IsStopped)
     {
         initiator.Stop();
         textBox1.AppendText(@"Connection stopped manually!!!" + "\r\n");
         textBox2.AppendText(@"Connection stopped mannally!!!" + "\r\n");
         button2.Enabled = true;
         Cursor.Current  = Cursors.Default;
     }
     else
     {
         textBox1.AppendText(@"Connection is not running!!!" + "\r\n");
         textBox2.AppendText(@"Connection is not running!!!" + "\r\n");
         Cursor.Current = Cursors.Default;
     }
 }
Пример #6
0
 // Used to stop the client
 private void bStop_Click(object sender, EventArgs e)
 {
     try
     {
         timer1.Enabled = false;
         timer3.Enabled = false;
         timer4.Enabled = false;
         if (initiator.IsLoggedOn)
         {
             application.CloseExcel();
         }
         initiator.Stop();
     }
     catch (Exception error)
     {
         logger.Error(error.Message);
         logger.Error(error.StackTrace);
     }
 }
Пример #7
0
        public void Stop()
        {
            try
            {
                _initiator.Stop();
                _initiator = null;
            }
            catch (Exception ex)
            {
                logger.Error("Stop():" + ex.Message, ex);
            }

            logger.Info("Stop(): Sessao FIX finalizado!");
        }
Пример #8
0
        public virtual void Stop()
        {
            try
            {
                _initiator.Stop();
                _initiator = null;
                _session   = null;
            }
            catch (Exception ex)
            {
                logger.Error("Stop():" + ex.Message, ex);
            }

            _logonEfetuado = false;
            logger.Info("Stop(): Sessao FIX finalizado!");
        }
Пример #9
0
        static void Main(string[] args)
        {
            Console.WriteLine("=============");
            Console.WriteLine("This is only an example program, meant to run against the Executor or SimpleAcceptor example programs.");
            Console.WriteLine();
            Console.WriteLine("                                                    ! ! !");
            Console.WriteLine("              DO NOT USE THIS ON A COMMERCIAL FIX INTERFACE!  It won't work and it's a bad idea!");
            Console.WriteLine("                                                    ! ! !");
            Console.WriteLine();
            Console.WriteLine("=============");

            if (args.Length != 1)
            {
                System.Console.WriteLine("usage: TradeClient.exe CONFIG_FILENAME");
                System.Environment.Exit(2);
            }

            string file = args[0];

            try
            {
                QuickFix.SessionSettings settings    = new QuickFix.SessionSettings(file);
                TradeClientApp           application = new TradeClientApp();

                QuickFix.IMessageStoreFactory storeFactory = new QuickFix.ODBCStoreFactory(settings);
                QuickFix.ILogFactory          logFactory   = new QuickFix.ScreenLogFactory(settings);

                //QuickFix.IMessageStoreFactory storeFactory = new QuickFix.FileStoreFactory(settings);
                //QuickFix.ILogFactory logFactory = new QuickFix.ScreenLogFactory(settings);


                QuickFix.Transport.SocketInitiator initiator = new QuickFix.Transport.SocketInitiator(application, storeFactory, settings, logFactory);

                // this is a developer-test kludge.  do not emulate.
                application.MyInitiator = initiator;

                initiator.Start();
                application.Run();
                initiator.Stop();
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
            Environment.Exit(1);
        }
Пример #10
0
        static void Main(string[] args)
        {
            Console.WriteLine("=============");
            Console.WriteLine("This is only an example program, meant to run against the Executor or SimpleAcceptor example programs.");
            Console.WriteLine();
            Console.WriteLine("                                                    ! ! !");
            Console.WriteLine("              DO NOT USE THIS ON A COMMERCIAL FIX INTERFACE!  It won't work and it's a bad idea!");
            Console.WriteLine("                                                    ! ! !");
            Console.WriteLine();
            Console.WriteLine("=============");

            if (args.Length != 1)
            {
                System.Console.WriteLine("usage: TradeClient.exe CONFIG_FILENAME");
                System.Environment.Exit(2);
            }

            string file = args[0];

            try
            {
                QuickFix.SessionSettings settings = new QuickFix.SessionSettings(file);
                TradeClientApp application = new TradeClientApp();
                QuickFix.IMessageStoreFactory storeFactory = new QuickFix.FileStoreFactory(settings);
                QuickFix.ILogFactory logFactory = new QuickFix.ScreenLogFactory(settings);
                QuickFix.Transport.SocketInitiator initiator = new QuickFix.Transport.SocketInitiator(application, storeFactory, settings, logFactory);

                // this is a developer-test kludge.  do not emulate.
                application.MyInitiator = initiator;

                initiator.Start();
                application.Run();
                initiator.Stop();
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
            Environment.Exit(1);
        }
Пример #11
0
 static void Main(string[] args)
 {
     try
     {
         QuickFix.SessionSettings           settings     = new QuickFix.SessionSettings("config/quickfix-client.cfg");
         MyQuickFixApp                      application  = new MyQuickFixApp();
         QuickFix.IMessageStoreFactory      storeFactory = new QuickFix.FileStoreFactory(settings);
         QuickFix.ILogFactory               logFactory   = new QuickFix.ScreenLogFactory(settings);
         QuickFix.Transport.SocketInitiator initiator    = new QuickFix.Transport.SocketInitiator(application, storeFactory, settings, logFactory);
         initiator.Start();
         Console.ReadKey();
         initiator.Stop();
     }
     catch (System.Exception e)
     {
         Console.WriteLine(e.Message);
         Console.WriteLine(e.StackTrace);
         Console.ReadKey();
     }
     Environment.Exit(1);
 }
Пример #12
0
        static void Main(string[] args)
        {
            try
            {

                QuickFix.SessionSettings settings = new QuickFix.SessionSettings("config/quickfix-client.cfg");
                MyQuickFixApp application = new MyQuickFixApp();
                QuickFix.IMessageStoreFactory storeFactory = new QuickFix.FileStoreFactory(settings);
                QuickFix.ILogFactory logFactory = new QuickFix.ScreenLogFactory(settings);
                QuickFix.Transport.SocketInitiator initiator = new QuickFix.Transport.SocketInitiator(application, storeFactory, settings, logFactory);
                initiator.Start();
                Console.ReadKey();
                initiator.Stop();
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
                Console.ReadKey();
            }
            Environment.Exit(1);
        }
Пример #13
0
        static void Main(string[] args)
        {
            string file = "client.cfg";

            try {
                QuickFix.SessionSettings settings = new QuickFix.SessionSettings(file);
                Client application = new Client();
                QuickFix.IMessageStoreFactory storeFactory = new QuickFix.FileStoreFactory(settings);
                //QuickFix.ILogFactory logFactory = new QuickFix.ScreenLogFactory(settings);
                QuickFix.Transport.SocketInitiator initiator = new QuickFix.Transport.SocketInitiator(application, storeFactory, settings);

                // this is a developer-test kludge.  do not emulate.
                application.MyInitiator = initiator;

                initiator.Start();
                application.Run();
                initiator.Stop();
            } catch (System.Exception e) {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
            Environment.Exit(1);
        }
Пример #14
0
        static void Main(string[] args)
        {
            string file = "client.cfg";

            try {
                QuickFix.SessionSettings settings = new QuickFix.SessionSettings(file);
                Client application = new Client();
                QuickFix.IMessageStoreFactory storeFactory = new QuickFix.FileStoreFactory(settings);
                //QuickFix.ILogFactory logFactory = new QuickFix.ScreenLogFactory(settings);
                QuickFix.Transport.SocketInitiator initiator = new QuickFix.Transport.SocketInitiator(application, storeFactory, settings);

                // this is a developer-test kludge.  do not emulate.
                application.MyInitiator = initiator;

                initiator.Start();
                application.Run();
                initiator.Stop();
            } catch (System.Exception e) {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
            Environment.Exit(1);
        }
Пример #15
0
        static void Main(string[] args)
        {
            Console.WriteLine("== CharEncoding Initiator startup");

            try
            {
                SessionSettings settings = new QuickFix.SessionSettings("initiator.cfg");
                CEInitiatorApp application = new CEInitiatorApp();
                IMessageStoreFactory storeFactory = new QuickFix.FileStoreFactory(settings);
                ILogFactory logFactory = new QuickFix.ScreenLogFactory(settings);
                QuickFix.Transport.SocketInitiator initiator = new QuickFix.Transport.SocketInitiator(application, storeFactory, settings, logFactory);

                initiator.Start();
                application.ListenOnConsole();
                initiator.Stop();
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.StackTrace);
            }
            Environment.Exit(1);
        }
Пример #16
0
        public virtual void Stop()
        {
            try
            {
                _bKeepRunning = false;

                _initiator.Stop();
                _initiator = null;
                _session   = null;

                while (thSplitProc.IsAlive)
                {
                    logger.Info("Aguardando finalizar thread splitter");
                    Thread.Sleep(250);
                }

                while (thQueueProc.IsAlive)
                {
                    logger.Info("Aguardando finalizar thread de processamento da fila de mensagens FIX");
                    Thread.Sleep(250);
                }

                if (machineGun != null)
                {
                    machineGun.Stop();
                }
            }
            catch (Exception ex)
            {
                logger.Error("Stop():" + ex.Message, ex);
            }

            _logonEfetuado = false;

            logger.Info("Stop(): Sessao FIX finalizado!");
        }
Пример #17
0
 public void Close()
 {
     Initiator.Stop();
     Initiator.Dispose();
 }
 private void stopButton_Click(object sender, EventArgs e)
 {
     _Initiator.Stop();
 }
Пример #19
0
 public void closeFix()
 {
     initiator.Stop();
 }