Skip to main content

Rebalance logic - overview

When a portfolio is rebalanced, the trade orders are created to the portfolio(s) based on the following logic.

Step 1. Determine the available cash in the portfolio, e.g. the amount of cash available to buy securities, and what is done with this cash. This is determined based on:

  • Whether the portfolio's total account balance is positive (i.e. above the model portfolio share for cash) on the accounts that are selected to be included in available cash.

  • Which selection is made in the Cash to be used field (i.e. is available cash only the account cash balance and/or total trade amount of sells).

  • Whether rebalancing is restricted to accounts (i.e. whether at least one of the portfolio's accounts is selected) so there is a target level for the cash balance that rebalancing will try to meet without doing other changes.

Step 2. Compare each position in the investment portfolio against the positions in the model portfolio or investment plan and create buy and sell trade orders based on the comparison. Transaction types used to for Buy and Sell trade orders are defined in Rebalancing preferences, and trade orders are calculated based on:

  • Calculating the difference for each position in portfolio currency (+ or -), which determines for how much in portfolio currency you would need to buy or sell to match the model portfolio weight.

  • Calculating the number of shares you would need based on the difference and selected day’s market unit price. Number of shares is calculated with as many decimals as defined in security type preferences, or overridden in the security block size.

  • Creating buy and sell trade orders as defined in Rebalancing preferences either

    • Based on amount (fixes amount and difference, and recalculates the unit price)

    • Based on trade amount (fixes amount and unit price, and recalculates the trade amount)

Step 3. Validate each trade order and only create valid ones. Buy trade orders are created first, after which the sell trade orders are created.

  • Buy trade orders are ordered from largest to smallest, and the buy trade orders are created one by one, from largest to smallest, as long as there is excess cash in the portfolio.

  • Sell trade orders are created based on whether rebalancing is restricted to accounts: if there is no target level for the account, all sell trade orders are created, otherwise the Sell trade orders are ordered from largest to smallest, and the sell trade orders are created one by one, from largest to smallest, as long as the target cash balance is reached.

In addition to the basic rebalancing logic described above, there are additional checks that can be defined and thus affect the trade orders rebalancing creates.

  • You can restrict rebalancing to accounts, when rebalancing will only try to achieve the target level for portfolios' accounts. When only extra cash in portfolio is used, rebalancing would only buy enough to spend excess cash or only sell enough to cover insufficient cash, but not do any other buys or sells. If also cash from sells is included, then rebalancing will only sell to cover for potential buys, but not sell anything more so that there would be excess cash in the portfolio's account.

  • You can define the minimum change or minimum trade amount in the rebalancing window or in the security costs to filter out small trade orders when validating trade orders. These restrictions are applied unless you are selling an entire position away from the portfolio.

  • You can estimate the effect of fees on your trade orders when calculating your trade orders, so that the effect of upcoming fees is considered when calculating the number of shares you can buy with you available cash and the amount of money you would be getting from your sells.

  • Rebalancing considers whether a portfolio is locked when validating your trade orders, and doesn't create trade orders to locked portfolios.

  • Rebalancing also takes into account the effect existing trade orders saved in the rebalanced portfolio when validating and calculating your trade orders, so that Open trade orders are replaced with new trade orders if the portfolio is rebalanced again, and the effects of Accepted or Executable trade orders are taken into account when creating new ones, but these trade orders won't be replaced.

rebalancing_logic.png