/// <summary> /// Event notification for AutospreaderInstrument creation /// </summary> public void m_casReq_Completed(object sender, CreateAutospreaderInstrumentRequestEventArgs e) { if (e.Error == null) { if (e.Instrument != null) { // In this example, the AutospreaderInstrument is launched to ASE-A. // You should use the order feed that is appropriate for your purposes. OrderFeed oFeed = this.GetOrderFeedByName(e.Instrument, m_ASEGateway); if (oFeed.IsTradingEnabled) { // deploy the Autospreader Instrument to the specified ASE e.Instrument.TradableStatusChanged += new EventHandler <TradableStatusChangedEventArgs>(Instrument_TradableStatusChanged); LaunchReturnCode lrc = e.Instrument.LaunchToOrderFeed(oFeed); if (lrc != LaunchReturnCode.Success) { Console.WriteLine("Launch request was unsuccessful"); } } } } else { // AutospreaderInstrument creation failed Console.WriteLine("AutospreaderInstrument creation failed: " + e.Error.Message); } }
// // // #endregion//Public Methods #region no Private Methods // ***************************************************************** // **** Private Methods **** // ***************************************************************** // // #endregion//Private Methods #region Event Handlers // ***************************************************************** // **** Event Handlers **** // ***************************************************************** // // private void AutoSpreaderInstrumentRequest_Completed(object sender, CreateAutospreaderInstrumentRequestEventArgs autoSpreaderEventArgs) { if (autoSpreaderEventArgs.Instrument != null) { AutospreaderInstrument m_AutoSpreader = (AutospreaderInstrument)autoSpreaderEventArgs.Instrument; LaunchReturnCode launchReturnCode = m_AutoSpreader.LaunchToOrderFeed(m_AutoSpreader.GetValidOrderFeeds()[0]); // launch to whatever orderfeed we find first if (launchReturnCode == LaunchReturnCode.Success) { m_AutoSpreader.TradableStatusChanged += new EventHandler <TradableStatusChangedEventArgs>(AutoSpreaderInstrument_TradeableStatusChanged); } } }
public void casReq_Completed(object sender, CreateAutospreaderInstrumentRequestEventArgs e) { if (e.Error == null) { if (e.Instrument != null) { StartOrderSubmission((AutospreaderInstrument)e.Instrument); } } else { // Instrument was not found and TT API has given up looking for it Console.WriteLine("Autospreader Instrument creation failed: " + e.Error.Message); Dispose(); } }
/// <summary> /// Event notification for AutospreaderInstrument creation /// </summary> public void m_casReq_Completed(object sender, CreateAutospreaderInstrumentRequestEventArgs e) { if (e.Error == null) { if (e.Instrument != null) { // In this example, the AutospreaderInstrument is launched to ASE-A. // You should use the order feed that is appropriate for your purposes. OrderFeed oFeed = this.GetOrderFeedByName(e.Instrument, m_ASEGateway); if (oFeed.IsTradingEnabled) { // deploy the Autospreader Instrument to the specified ASE e.Instrument.TradableStatusChanged += new EventHandler<TradableStatusChangedEventArgs>(Instrument_TradableStatusChanged); LaunchReturnCode lrc = e.Instrument.LaunchToOrderFeed(oFeed); if (lrc != LaunchReturnCode.Success) { Console.WriteLine("Launch request was unsuccessful"); } } } } else { // AutospreaderInstrument creation failed Console.WriteLine("AutospreaderInstrument creation failed: " + e.Error.Message); } }