コード例 #1
0
        /// <summary>
        /// Gets the total margin required to execute the specified order in units of the account currency including fees
        /// </summary>
        /// <param name="parameters">An object containing the portfolio, the security and the order</param>
        /// <returns>The total margin in terms of the currency quoted in the order</returns>
        public override InitialMargin GetInitialMarginRequiredForOrder(
            PositionGroupInitialMarginForOrderParameters parameters
            )
        {
            var initialMarginRequirement = 0m;

            foreach (var position in parameters.PositionGroup)
            {
                // TODO : Support combo order by pull symbol-specific order
                var security = parameters.Portfolio.Securities[position.Symbol];
                initialMarginRequirement += security.BuyingPowerModel.GetInitialMarginRequiredForOrder(
                    new InitialMarginRequiredForOrderParameters(parameters.Portfolio.CashBook, security, parameters.Order)
                    );
            }

            return(initialMarginRequirement);
        }
コード例 #2
0
 /// <summary>
 /// Gets the total margin required to execute the specified order in units of the account currency including fees
 /// </summary>
 /// <param name="parameters">An object containing the portfolio, the security and the order</param>
 /// <returns>The total margin in terms of the currency quoted in the order</returns>
 public abstract InitialMargin GetInitialMarginRequiredForOrder(PositionGroupInitialMarginForOrderParameters parameters);