Esempio n. 1
0
 /// <summary>
 /// Broadcasts a change of record event.
 /// </summary>
 /// <param name="allocationsEventArgs">The event argument.</param>
 public static void OnAllocationChanged(AllocationEventArgs allocationsEventArgs)
 {
     // Broadcast the event to any listeners.
     if (Allocation.Changed != null)
     {
         Allocation.Changed(typeof(Allocation), allocationsEventArgs);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Event driven handler for a change to Allocations.
 /// </summary>
 /// <param name="sender">The object that originated the event (ignored).</param>
 /// <param name="allocationEventArgs">The event argument.</param>
 private static void AllocationHandler(object sender, AllocationEventArgs allocationEventArgs)
 {
     // Extract the event argument and call a common method for testing the position against the list rule.
     if (AlphaListRule.alphaPositionTable.Contains(allocationEventArgs.Allocation.Position))
     {
         AlphaListRule.updatePositionTable.Add(allocationEventArgs.Allocation.Position);
     }
 }
Esempio n. 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="allocationEventArgs">A proposed order that is to be checked.</param>
        private static void AllocationHandler(object sender, AllocationEventArgs allocationEventArgs)
        {
            // Extract the event argument.
            Allocation allocation = allocationEventArgs.Allocation;

            // 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(allocation.Position.Account))
            {
                TelecomConcentration.updateAccountList.Add(allocation.Position.Account);
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Adds a AllocationEventArgs to the list.
 /// </summary>
 /// <param name="allocationEventArgs">The event arguments to be added to the list.</param>
 /// <returns>The index of the new value.</returns>
 public int Add(AllocationEventArgs allocationEventArgs)
 {
     // Add the event arguments to the list.
     return(base.Add(allocationEventArgs));
 }