예제 #1
0
        //
        //
        // *****************************************************************
        // ****         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"
        }
예제 #2
0
        //

        #endregion//Properties

        #region Public Methods
        // *****************************************************************
        // ****                     Public Methods                      ****
        // *****************************************************************
        //
        //
        //
        //
        public override void ProcessEvent(EventArgs e)
        {
            base.ProcessEvent(e);
            if (e is EngineEventArgs)
            {
                EngineEventArgs engineEventArg = (EngineEventArgs)e;
                if (engineEventArg.MsgType == EngineEventArgs.EventType.SyntheticOrder)
                {
                }
            }
            else if (e is CurveTraderEventArgs)
            {
                CurveTraderEventArgs curveTraderEventArg = (CurveTraderEventArgs)e;
                switch (curveTraderEventArg.MsgType)
                {
                case CurveTraderEventArgs.EventType.Launched:
                    if (curveTraderEventArg.Status == CurveTraderEventArgs.EventStatus.Confirm)
                    {       // confirmation that a curve trader has been launched fully.
                        if (m_CurveTraderPendingLaunch.Contains(curveTraderEventArg.EngineId))
                        {   // we were waiting on this to launch
                            m_CurveTraderPendingLaunch.Remove(curveTraderEventArg.EngineId);
                            if (m_CurveTraderPendingLaunch.Count == 0)
                            {       // we have no more remaining curve traders, we can launch!
                                m_ExecutionContainer.ConfirmStrategyLaunched();
                            }
                            else
                            {
                                m_Log.NewEntry(LogLevel.Minor, "CurveTraderManager: Awaiting launch of {0} CurveTraders", m_CurveTraderPendingLaunch.Count);
                            }
                        }
                    }
                    break;

                default:
                    break;
                }
            }
        }