コード例 #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 ReservedBuyingPowerForPositionParameters(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="parameters">A parameters object containing the security</param>
        /// <returns>The reserved buying power in account currency</returns>
        public virtual ReservedBuyingPowerForPosition GetReservedBuyingPowerForPosition(ReservedBuyingPowerForPositionParameters parameters)
        {
            var maintenanceMargin = GetMaintenanceMargin(parameters.Security);

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