Ejemplo n.º 1
0
        public override void OnOrderEvent(OrderEvent orderEvent)
        {
            if (_immediateCancellations.Contains(orderEvent.OrderId))
            {
                _immediateCancellations.Remove(orderEvent.OrderId);
                Transactions.CancelOrder(orderEvent.OrderId);
            }

            if (orderEvent.Status == OrderStatus.Filled)
            {
                Log("FILLED:: " + Transactions.GetOrderById(orderEvent.OrderId) + " FILL PRICE:: " + orderEvent.FillPrice.SmartRounding());
            }
            else
            {
                Log(orderEvent.ToString());
            }
        }
Ejemplo n.º 2
0
        void Consolidator_DataConsolidated(object sender, Data.Market.QuoteBar e)
        {
            Console.WriteLine("PRICE=" + e.Price);

            if (Portfolio.GetHoldingsQuantity(_Symbol) == 0)
            {
                if (_pendingEntry != null)
                {
                    Transactions.CancelOrder(_pendingEntry.OrderId);
                    _pendingEntry = null;
                }

                Console.WriteLine("dev=" + _devIndicator.Current.Value);
                if (_devIndicator.Current.Value < 10)
                {
                    this.SetupOrder(e);
                }
            }
        }