/// <summary>
 /// Gets the total margin required to execute the specified order in units of the account currency including fees
 /// </summary>
 /// <param name="model">The buying power model</param>
 /// <param name="currencyConverter">The currency converter used for converting asset values into the algorithm's
 /// account currency. Common value is the portfolio's cashbook property: <see cref="SecurityPortfolioManager.CashBook"/></param>
 /// <param name="security">The security</param>
 /// <param name="order">The order being contemplated</param>
 /// <returns>The total margin in terms of the currency quoted in the order</returns>
 public static decimal GetInitialMarginRequiredForOrder(
     this IBuyingPowerModel model,
     ICurrencyConverter currencyConverter,
     Security security,
     Order order
     )
 {
     return(model.GetInitialMarginRequiredForOrder(new InitialMarginRequiredForOrderParameters(
                                                       currencyConverter, security, order
                                                       )));
 }