public Form6() { InitializeComponent(); price_file = new System.IO.StreamWriter("C:\\temp\\Data06.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 SystemManager06(); 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; }
private void button2_Click(object sender, EventArgs e) { if (m_Manager != null) { m_Manager.ShutDown(); m_Manager.Matcher.WriteBuys("C:\\temp\\Trade Matching Algos\\buys06.csv"); m_Manager.Matcher.WriteSells("C:\\temp\\Trade Matching Algos\\sells06.csv"); m_Manager.Matcher.WriteRoundTurns("C:\\temp\\Trade Matching Algos\\roundturns06.csv"); m_Timer.Tick -= new EventHandler(m_Timer_Tick); m_Timer = null; m_Manager = null; GC.Collect(); price_file.Close(); } }