36 foreach (var position
in parameters.PositionGroup)
38 var security = parameters.Portfolio.Securities[position.Symbol];
39 var result = security.BuyingPowerModel.GetMaintenanceMargin(
43 buyingPower += result;
55 var initialMarginRequirement = 0m;
56 foreach (var position
in parameters.PositionGroup)
58 var security = parameters.Portfolio.Securities[position.Symbol];
59 initialMarginRequirement += security.BuyingPowerModel.GetInitialMarginRequirement(
60 security, position.Quantity
64 return initialMarginRequirement;
76 var initialMarginRequirement = 0m;
77 foreach (var position
in parameters.PositionGroup)
80 var security = parameters.Portfolio.Securities[position.Symbol];
81 initialMarginRequirement += security.BuyingPowerModel.GetInitialMarginRequiredForOrder(
86 return initialMarginRequirement;
102 return parameters.
Error(
103 $
"{nameof(SecurityPositionGroupBuyingPowerModel)} only supports position groups containing exactly one position."
109 var result = security.BuyingPowerModel.GetMaximumOrderQuantityForTargetBuyingPower(
113 var quantity = result.Quantity / security.SymbolProperties.LotSize;
130 return parameters.
Error(
131 $
"{nameof(SecurityPositionGroupBuyingPowerModel)} only supports position groups containing exactly one position."
137 var result = security.BuyingPowerModel.GetMaximumOrderQuantityForDeltaBuyingPower(
143 var quantity = result.Quantity / security.SymbolProperties.LotSize;
158 return parameters.
Error(
159 $
"{nameof(SecurityPositionGroupBuyingPowerModel)} only supports position groups containing exactly one position."
165 return security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(
175 decimal availableBuyingPower
186 return security.BuyingPowerModel.HasSufficientBuyingPowerForOrder(