Beispiel #1
0
 private void button3_Click(object sender, EventArgs e)
 {
     OportunityMonitor.sendCancelAll2Transaq();
     if (checkBox1.Checked == true)
     {
         MamuschkaRepeater.cancellAll();
     }
 }
Beispiel #2
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (currentPosition != null)
     {
         OportunityMonitor.sendOrder2Transaq(currentPosition);
         if (checkBox1.Checked == true)
         {
             MamuschkaRepeater.forwardPosition(currentPosition);
         }
     }
 }
Beispiel #3
0
 private void checkBox1_CheckedChanged(object sender, EventArgs e)
 {
     if (checkBox1.Checked == true)
     {
         checkBox1.Text = "да  ";
         MamuschkaRepeater.connect();
     }
     else
     {
         checkBox1.Text = "нет ";
         MamuschkaRepeater.disconnect();
     }
 }
Beispiel #4
0
        //================================================================================
        void MainFormFormClosing(object sender, FormClosingEventArgs e)
        {
            MamuschkaRepeater.stopMonitoringMamuschkaServer();
            TXmlConnector.FormReady = false;

            if (bConnected || bConnecting)
            {
                Transaq_Disconnect();
            }

            TXmlConnector.ConnectorUnInitialize();

            log.StopLogging();

            Environment.Exit(Environment.ExitCode);
            Application.Exit();
        }
Beispiel #5
0
 //================================================================================
 // если подключен или подключается
 void btn_Connect_Click(object sender, EventArgs e)
 {
     if (bConnected || bConnecting)
     {
         Transaq_Disconnect();
         if (checkBox1.Checked == true)
         {
             MamuschkaRepeater.disconnect();
         }
     }
     else
     {
         if (!bConnecting)
         {
             Transaq_Connect();
             if (checkBox1.Checked == true)
             {
                 MamuschkaRepeater.connect();
             }
         }
     }
 }
Beispiel #6
0
        //================================================================================
        void MainFormLoad(object sender, EventArgs e)
        {
            ctl_Tabs.SelectTab("tab_Param");

            // параметры по умолчанию
            ServerIP   = "tr1.finam.ru";
            ServerPort = "3900";

            loadLogginDetails();

            session_timeout = 25;
            request_timeout = 10;

            comboBox1.Items.Add(new ComboboxItem()
            {
                Text = "FORTS", Value = 4
            });
            comboBox1.Items.Add(new ComboboxItem()
            {
                Text = "ММВБ", Value = 1
            });
            comboBox1.Items.Add(new ComboboxItem()
            {
                Text = "SPBEX", Value = 7
            });
            comboBox1.Items.Add(new ComboboxItem()
            {
                Text = "INF", Value = 8
            });
            comboBox1.Items.Add(new ComboboxItem()
            {
                Text = "MMA", Value = 14
            });
            comboBox1.Items.Add(new ComboboxItem()
            {
                Text = "ETS", Value = 8
            });

            comboBox1.SelectedIndex = 0;


            edt_Login.Text    = sLogin;
            edt_Password.Text = sPassword;
            edt_IP.Text       = ServerIP;
            edt_Port.Text     = ServerPort;

            bConnected  = false;
            bConnecting = false;

            Enable_Password_Controls(false);

            Init_Data();

            // открытие лог-файла
            log.StartLogging(AppDir + "log" + DateTime.Now.ToString("yyMMdd") + ".txt");

            TXmlConnector.statusTimeout = session_timeout * 1000;

            TXmlConnector.ConnectorSetCallback(OnNewFormData, OnNewSecurity, OnNewTimeframe, OnNewStatus);

            this.onNewFormDataEvent  += new NewStringDataHandler(Add_FormData);
            this.onNewSecurityEvent  += new NewStringDataHandler(Add_Security);
            this.onNewTimeframeEvent += new NewStringDataHandler(Add_Timeframe);
            this.onNewStatusEvent    += new NewBoolDataHandler(ConnectionStatusReflect);

            TXmlConnector.Orders4HMISubscribe(OrdersSubscriber);
            this.onOrdersPublished += new NewStringDataHandler(processOrdersDistribution);


            OportunityMonitor.init();

            TXmlConnector.FormReady = true;

            string LogPath = AppDir + "\0";

            if (TXmlConnector.ConnectorInitialize(LogPath, 3))
            {
                TXmlConnector.statusDisconnected.Set();
            }

            OportunityMonitor.subscribeQuotationUpdate(quotationCall);
            this.onQuotation += new quotationDelegate(setQuotationPrice);

            OportunityMonitor.PositionPublisherCallback(PositionPublisherCall);
            onPositionSuscriber += new PositionDelegate(setTakingClosingPosition);

            MamuschkaRepeater.mamushkaStatusSubscribe(mamuschkaStatusCall);
            onMamushkaStatusResponse += new NewStringDataHandler(setMamushkaServerStatus);
            MamuschkaRepeater.monitorMamuschkaServer();
        }