Back Test Report After Rebalance

Hi all - after the recent rebalance of the ASX, the report function in Amibroker no longers represents my portfolio as the rebalance now includes shares that were not in my portfolio as well as excluding shares that are in my portfolio.

So we use back testing to keep a track of portfolio performance - however now with the rebalance we have the above problems meaning the report generated is meaningless.

What do others do when a rebalance occurs so that we can continue to use the Amibroker report functionality please or is there something else we can use to track the equity curve and portfolio performance based on our actual portfolio data please?

1 Like

+1 to this question because even my main local index gets rebalanced so I would like to know how users generally deal with it.

If you could explain why do you think that "backtest report is meaningless".
Backtest is rather for testing historical performance. History does not change if some index components are changed now. Only the future changes.

If you want to address survivorship bias in your backtests, you should be using
database that holds historical components of index in watch lists (at least one for year but probably more frequent) and use write backtest so it changes symbols being traded on per-year watch list basis. This can be easily done using InWatchlist function. I presented examples in Houston conference in 2006. Also you will find plenty of information on the web: survivorship bias amibroker - Google Search

2 Likes

I think you really mean "reconsituted" (which changes constituents) rather than "rebalanced" (which changes weights).

Our Norgate Data product, at higher subscription levels, offers various capabilities for tracking historical index constituents to remove survivorship bias.

Since you mentioned "ASX", we have hsitorical index constituents of the All Ordinaries, S&P/ASX 200, S&P/ASX 300 and several other indices back to 1992. Deb, it appears you're using Premium Data. It might be worth considering our newer service, Norgate Data which has much more capabilties suitable for backtesting including historical index constituents, delisted data etc.

1 Like

Thank you for your reply. What we are after is a report similar to that produced by the back test that uses our actual portfolio data to produce an equity curve and similar reporting/statistics data as is provided in the back test report - is that possible from Amibroker?

Hi again - I have been trading using Amibroker since 24 Dec 2020 - I have been using the backtest report to scan buys and sells based on my formula - each day I will go into backtest and change the today date, run the backtest report, then I action any buys and sell reports - so I could use the backtest reports to monitor portfolio performance.

On 22 Mar 2021, the ASX had a rebalance, which meant that shares I hadn't purchased appeared in my portfolio (via the backtest report), which now means when I run the above backtest, my formula is picking up sells for shares I do not have, which now means the data being produced by the backtest report is not indicative of my actual portfolio.

As a result of the rebalance of the ASX, I am now just doing a daily scan to identify buys and sells using my formula.

When I run my daily scan, is there somewhere in Amibroker where I can put the shares in my actual portfolio so I can continue to get the same reporting information as I was getting using the backtest report.

Please re-read previous answers. Backtesting is for checking historical performance.
If you are using it as "signal generator" (which is not original purpose), you have to use advice given previously:

you should be using database that holds historical components of index in watch lists (at least one for year but probably more frequent) and use write backtest so it changes symbols being traded on per-year watch list basis. This can be easily done using InWatchlist function.

So in your specific case you should:

  1. create a WATCH LIST A that contains all symbols that you wanted to trade BEFORE March 22.
  2. create a WATCH LIST B that contains all symbols that you wanted to trade AFTER March 22
  3. Set Apply To Filter to include BOTH watch lists
  4. In your code add the following (after your trading rules:
Allow = IIF( DateNum() < 1210322, 
                   InWatchListName("Watchlist A"),
                   InWatchListName("Watchlist B" ) );

Buy = Allow AND Buy;
Short = Allow AND Short;

The code will prevent buying and shorting symbols that are not in active watch list.

It is really recommended to read the following from the manual:

  1. Working with watch lists: Working with watch lists
  2. Working with new Analysis window: Using New Analysis window
  3. Entire: Tutorial

By doing that reading you would save yourself hundreds of hours of head-scratching

2 Likes

Actually, the ASX didn't change at all. The ASX is an exchange.

This is a reconstiution event - the weightings (aka balance) doesn't come into this.

I assume you actually mean "the constituents of an index that trade on the ASX changed" through reconstitution. You are probably referring to the ASX All Ordinaries index which aims to have the "top 500 shares" (but there actually additional rules relating to domicile too).

Should you want to BACKTEST on the historical index constituents of the All Ordinaries index, you'll need to subscribe to a data service (such as Norgate Data, at the Platinum subscription level) that lets you do that.

Alternatively, you can maintain those constituents yourself via watchlists as @Tomasz has mentioned).

Cheers,
Richard.

http://www.amibroker.com/kb/2014/09/30/gen-backtest-from-a-file/

Could try something like this. Keep track of the trades manually or by exporting and updating bower frequently you need, then just import and generate a backtest report whenever you want to view.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.