When executing multiple trades from a strategy, mostly it fails at last trades due to margin shortfall and all trades getting cancelled. unnecessarily broker fee and other costs being charged for buy and sold trades through this failed execution. It would be great to have a check for available margin in account vs approximate required margin and not execute if margin shortfall is more than some percentage or amount.