//public System.Threading.AutoResetEvent ReEval; private void button1_Click(object sender, EventArgs e) { Contract contract = new Contract(); contract.Symbol = ContractInput.Text; contract.SecType = SecTypeInput.Text; contract.Currency = CurrencyInput.Text; contract.Exchange = ExchangeInput.Text; SecTypeInput.Text = contract.SecType; CurrencyInput.Text = contract.Currency; ExchangeInput.Text = contract.Exchange; // Create a new Instrument _Manager = new SysMan(contract); // Subscribe to the PriceUpdate event for real time data. _Manager.OnPriceUpdate += InstrUpdate; // Subscribe to the FillUpdate event for fill updates. _Manager.OnFillUpdate += FillUpdate; //dataGridView1.DataSource = _Manager.Matcher.SellTable; //dataGridView2.DataSource = _Manager.Matcher.BuyTable; //dataGridView3.DataSource = _Manager.Matcher.RoundTurnTable; //_Manager.PriceUpdate += percentDecision; }
private void button2_Click_1(object sender, EventArgs e) { if (_Manager != null) { _Manager.Matcher.WriteBuys("C:\\temp\\buys.csv"); _Manager.Matcher.WriteSells("C:\\temp\\sells.csv"); _Manager.Matcher.WriteRoundTurns("C:\\temp\\roundturns.csv"); _Manager.OnFillUpdate -= FillUpdate; _Manager.OnPriceUpdate -= InstrUpdate; _Manager = null; GC.Collect(); } }