예제 #1
0
 /// <summary>
 /// Broadcasts a change of record event.
 /// </summary>
 /// <param name="proposedOrdersEventArgs">The event argument.</param>
 public static void OnProposedOrderChanged(ProposedOrderEventArgs proposedOrdersEventArgs)
 {
     // Broadcast the event to any listeners.
     if (ProposedOrder.Changed != null)
     {
         ProposedOrder.Changed(typeof(ProposedOrder), proposedOrdersEventArgs);
     }
 }
예제 #2
0
        private static void BeginMergeHandler(object sender, EventArgs eventArgs)
        {
            if (BeginMerge != null)
            {
                BeginMerge(typeof(MarketData), new EventArgs());
            }

            ProposedOrder.OnBeginMerge();
            TaxLot.OnBeginMerge();
        }
예제 #3
0
        /// <summary>
        /// Checks to make sure that a new proposed order doesn't violate a list of restricted securities.
        /// </summary>
        /// <param name="sender">The object that originated the event (ignored).</param>
        /// <param name="proposedOrderEventArgs">A proposed order that is to be checked.</param>
        private static void ProposedOrderHandler(object sender, ProposedOrderEventArgs proposedOrderEventArgs)
        {
            // Extract the event argument.
            ProposedOrder proposedOrder = proposedOrderEventArgs.ProposedOrder;

            // There is no need to recalculate the market and sector values if the the account is not part of this compliance
            // restriction.  A quick filter should be part of all compliance checks to prevent unnecessary calculations.
            if (TelecomConcentration.betaAccountList.Contains(proposedOrder.Position.Account))
            {
                TelecomConcentration.updateAccountList.Add(proposedOrder.Position.Account);
            }
        }
예제 #4
0
        private static void EndMergeHandler(object sender, EventArgs eventArgs)
        {
            TaxLot.OnEndMerge();
            ProposedOrder.OnEndMerge();

            if (EndMerge != null)
            {
                EndMerge(typeof(MarketData), new EventArgs());
            }


            CommandBatch.Flush();
        }
예제 #5
0
 /// <summary>
 /// Constructs and argument for passing a proposed order event to a listener.
 /// </summary>
 /// <param name="action">The action taken on the proposed order.</param>
 /// <param name="proposedOrder">The proposed order record.</param>
 public ProposedOrderEventArgs(Action action, ProposedOrder proposedOrder)
 {
     // Initialize the record.
     this.action        = action;
     this.proposedOrder = proposedOrder;
 }
예제 #6
0
        /// <summary>
        /// Handles the primary Market Data events and passes the events along to the Langauge Primitives.
        /// </summary>
        /// <param name="sender">The object that originated the event.</param>
        /// <param name="proposedOrderRowChangeEvent">The record change event argument.</param>
        public static void ProposedOrderHandler(object sender, ClientMarketData.ProposedOrderRowChangeEvent proposedOrderRowChangeEvent)
        {
            // Extract the record from the event argument.
            ClientMarketData.ProposedOrderRow proposedOrderRow = proposedOrderRowChangeEvent.Row;

            // Translate the ADO.NET row states into a record state used by the Rules Engine.
            Action action = Action.Nothing;

            switch (proposedOrderRowChangeEvent.Action)
            {
            case DataRowAction.Add: action = Action.Add; break;

            case DataRowAction.Delete: action = Action.Delete; break;

            case DataRowAction.Change: action = Action.Change; break;

            case DataRowAction.Commit: return;
            }

            // Place the event into a list that will be processed when the tables are no longer locked.
            ProposedOrder.proposedOrderEventArgList.Add(new ProposedOrderEventArgs(action, ProposedOrder.Make(proposedOrderRow)));
        }