Пример #1
0
        /// <summary>
        /// Stops trading.
        /// </summary>
        public void Stop()
        {
            if (Runner is null)
            {
                throw new InvalidOperationException("AutoTrader isn't running");
            }

            Manager.OrderValidated -= OnOrderValidated;
            Manager.OrderCanceled  -= OnOrderCanceled;

            Bars.ForEach((bar) => bar.Updated -= OnBarsUpdated);
            Bars   = null;
            Runner = null;
        }