Optimizing Fund Purchases: Managing Brokerage Fees Smartly