Example #1
0
        private void main_Load(object sender, EventArgs e)
        {
            log.CreateLog(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.ToString(), this.listBox1);

            this.Text            += " v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
            this.cbxGateways.Text = _gw;
            this.txtTicker.Text   = _product;
            this.txtAccount.Text  = _account;

            //Required Code to have application automatically initiate a connection.
            try
            {
                _qf = new QuickFix.QFApplication();
                _qf.registerFormController(log.WriteLog);
                _qf.registerFormDataController(updateParameters);

                _qf.initiate("ini.cfg", "12345678", true, this);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
        }
        private void mainForm_Load(object sender, EventArgs e)
        {
            try
            {
                TT.SendMsg.initializeLog();

                log.CreateLog("AUTOFLAT", this.listBox1);
                this.Text += " v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString();
                //log.WriteLog(this.Text);

                _qf = new QuickFix.QFApplication();

                _LoadINI();
                _LoadMGT();
                _LoadCurrency();

                #region Register Delegates for passing data between threads
                //these calls are registering local methods for updating the gui
                //the _qf. methods are delegates that pass the data from the QuickFix thread
                //to the Gui thread.
                _qf.registerLogUpdater(log.WriteList);
                _qf.registerGatewayUpdater(UpdateGateway);
                _qf.registerPositionUpdater(UpdatePosition);
                _qf.registerSecurityUpdater(UpdateSecurity);
                _qf.registerPriceUpdater(UpdatePrices);
                _qf.registerOrderCanceler(orderCancel);
                _qf.registerOnOff(activateOnOff);
                _qf.registerOrderMgmt(updateOrderMgmt);
                _qf.registerClearPOS(ClearPositions);
                #endregion

                _qf.initiate("ini.cfg", "12345678", true, this);

            }
            catch (Exception ex)
            {   log.WriteList(ex.ToString()); }
        }