// ***************************************************************** // **** Event Handler **** // ***************************************************************** // // // // ***************************************************************** // **** ExecutionListener_InstrumentsFound() **** // ***************************************************************** /// <summary> /// Called when our execution listener has found a new instrument. This means that it has also created /// a market for this instrument which we can now have a pointer to in the quoter leg, as well as subscribe /// to the MarketChanged events. /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> private void ExecutionListener_InstrumentsFound(object sender, EventArgs eventArgs) { // // Gather and save pertinent information about the Instrument found. // InstrumentsFoundEventArgs instrEventArgs = (InstrumentsFoundEventArgs)eventArgs; InstrumentDetails instrDetails = instrEventArgs.InstrumentDetails; int internalId = m_CurveTrader.m_InstrumentToInternalId[instrDetails.InstrumentName]; m_Scratchers[internalId].m_Market = m_ExecutionContainer.m_Markets[instrDetails.InstrumentName]; // keep a pointer to the market m_Scratchers[internalId].m_InstrumentDetails = instrDetails; }
// private void OnInstrumentsFound() { if (this.InstrumentsFound != null) { InstrumentsFoundEventArgs e = new InstrumentsFoundEventArgs(); foreach (MistyProd.InstrumentName name in m_InstrumentDetails.Keys) { //e.Instruments.Add(m_Instruments[name]); //e.InstrumentDetails.Add(m_InstrumentDetails[name]); e.InstrumentDetails.Add(name, m_InstrumentDetails[name]); } this.InstrumentsFound(this, e); } }
// // // ***************************************************************** // **** ExecutionListener_InstrumentsFound() **** // ***************************************************************** /// <summary> /// Called when our execution listener has found a new instrument. This means that it has also created /// a market for this instrument which we can now have a pointer to in the quoter leg, as well as subscribe /// to the MarketChanged events. /// </summary> /// <param name="sender"></param> /// <param name="eventArgs"></param> private void ExecutionListener_InstrumentsFound(object sender, EventArgs eventArgs) { // // Gather and save pertinent information about the Instrument found. // InstrumentsFoundEventArgs instrEventArgs = (InstrumentsFoundEventArgs)eventArgs; m_InstrumentDetails = instrEventArgs.InstrumentDetails; m_FillBook = new FillBook(m_PriceLeg.InstrumentName.ToString(), m_InstrumentDetails.Multiplier); if (double.IsNaN(m_QuoteTickSize)) // if our user hasn't defined this yet { m_QuoteTickSize = m_InstrumentDetails.TickSize; // set it to the default tick size here } m_IsLegSetUpComplete = true; m_RiskManager.Start(); m_ExecutionContainer.ConfirmStrategyLaunched(); // confirm we are "launched" }