예제 #1
0
        /// <summary>
        /// Gets the amount of buying power reserved to maintain the specified position
        /// </summary>
        /// <param name="model">The <see cref="IBuyingPowerModel"/></param>
        /// <param name="security">The security</param>
        /// <returns>The reserved buying power in account currency</returns>
        public static decimal GetReservedBuyingPowerForPosition(this IBuyingPowerModel model, Security security)
        {
            var context             = new ReservedBuyingPowerForPositionContext(security);
            var reservedBuyingPower = model.GetReservedBuyingPowerForPosition(context);

            return(reservedBuyingPower.Value);
        }
예제 #2
0
        /// <summary>
        /// Gets the amount of buying power reserved to maintain the specified position
        /// </summary>
        /// <param name="context">A context object containing the security</param>
        /// <returns>The reserved buying power in account currency</returns>
        public virtual ReservedBuyingPowerForPosition GetReservedBuyingPowerForPosition(ReservedBuyingPowerForPositionContext context)
        {
            var maintenanceMargin = GetMaintenanceMargin(context.Security);

            return(context.ResultInAccountCurrency(maintenanceMargin));
        }
예제 #3
0
 /// <summary>
 /// Gets the amount of buying power reserved to maintain the specified position
 /// </summary>
 /// <param name="context">A context object containing the security</param>
 /// <returns>The reserved buying power in account currency</returns>
 public override ReservedBuyingPowerForPosition GetReservedBuyingPowerForPosition(ReservedBuyingPowerForPositionContext context)
 {
     // Always returns 0. Since we're purchasing currencies outright, the position doesn't consume buying power
     return(context.ResultInAccountCurrency(0m));
 }