Ejemplo n.º 1
0
        public Form2()
        {
            InitializeComponent();

            price_file = new System.IO.StreamWriter("C:\\temp\\Data02.csv", true);

            m_Timer = new Timer();
            m_Timer.Interval = 20000;
            m_Timer.Tick += new EventHandler(m_Timer_Tick);
            m_Timer.Enabled = true;

            if (m_Manager == null)
            {
                m_Manager = new SystemManager02();
                m_Manager.OnSystemUpdate += new UpdateEventHandler(OnSystemUpdate);

                m_Manager.Qty = Convert.ToDouble(numericUpDown1.Value);
                m_Manager.Ticks = Convert.ToInt32(numericUpDown2.Value);
                m_Manager.TargetTicks = Convert.ToInt32(numericUpDown4.Value);
                m_Manager.StopTicks = Convert.ToInt32(numericUpDown5.Value);
            }

            dataGridView1.DataSource = m_Manager.Matcher.BuyTable;
            dataGridView2.DataSource = m_Manager.Matcher.SellTable;
            dataGridView3.DataSource = m_Manager.Matcher.RoundTurns;
        }
Ejemplo n.º 2
0
        public Form2()
        {
            InitializeComponent();

            price_file = new System.IO.StreamWriter("C:\\temp\\Data02.csv", true);

            m_Timer          = new Timer();
            m_Timer.Interval = 20000;
            m_Timer.Tick    += new EventHandler(m_Timer_Tick);
            m_Timer.Enabled  = true;

            if (m_Manager == null)
            {
                m_Manager = new SystemManager02();
                m_Manager.OnSystemUpdate += new OnSystemUpdateEventHandler(OnSystemUpdate);

                m_Manager.Qty         = Convert.ToDouble(numericUpDown1.Value);
                m_Manager.Ticks       = Convert.ToInt32(numericUpDown2.Value);
                m_Manager.TargetTicks = Convert.ToInt32(numericUpDown4.Value);
                m_Manager.StopTicks   = Convert.ToInt32(numericUpDown5.Value);
            }

            dataGridView1.DataSource = m_Manager.Matcher.BuyTable;
            dataGridView2.DataSource = m_Manager.Matcher.SellTable;
            dataGridView3.DataSource = m_Manager.Matcher.RoundTurns;
        }
Ejemplo n.º 3
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (m_Manager != null)
            {
                m_Manager.ShutDown();

                m_Manager.Matcher.WriteBuys("C:\\temp\\Trade Matching Algos\\buys02.csv");
                m_Manager.Matcher.WriteSells("C:\\temp\\Trade Matching Algos\\sells02.csv");
                m_Manager.Matcher.WriteRoundTurns("C:\\temp\\Trade Matching Algos\\roundturns02.csv");

                m_Timer.Tick -= new EventHandler(m_Timer_Tick);
                m_Timer = null;

                m_Manager = null;
                GC.Collect();
                price_file.Close();
            }
        }
Ejemplo n.º 4
0
        private void button2_Click(object sender, EventArgs e)
        {
            if (m_Manager != null)
            {
                m_Manager.ShutDown();

                m_Manager.Matcher.WriteBuys("C:\\temp\\Trade Matching Algos\\buys02.csv");
                m_Manager.Matcher.WriteSells("C:\\temp\\Trade Matching Algos\\sells02.csv");
                m_Manager.Matcher.WriteRoundTurns("C:\\temp\\Trade Matching Algos\\roundturns02.csv");

                m_Timer.Tick -= new EventHandler(m_Timer_Tick);
                m_Timer       = null;

                m_Manager = null;
                GC.Collect();
                price_file.Close();
            }
        }