I am well versed with using Amibroker to backtest and walk forward optimize strategies that involve a single asset.

I am now interested in performing a similar analysis using a portfolio of assets. Below, I will give an example:

Lets say I have 10 assets and 2 years of daily price series data for each of them from 2020-01-01 to 2021-12-31. The backtest I want to perform is as follows:

In-sample: 2020-01-01 to 2021-06-30 - find the top 3 securities with highest sharpe ratio

Out-sample: 2021-07-01 to 2021-12-31 - hold 3 securities with highest sharpe ratio found in previous in-sample (equal weight)

In-sample: 2021-07-01 to 2021-12-31 - find the top 3 securities with highest sharpe ratio

Out-sample: 2022-01-01 to 2022-06-30 - hold 3 securities with highest sharpe ratio found in previous in-sample (equal weight)

In-sample: 2022-01-01 to 2022-06-30 - find the top 3 securities with highest sharpe ratio

Out-sample: 2022-07-01 to 2022-12-31 - hold 3 securities with highest sharpe ratio found in previous in-sample (equal weight)

Stitch out-sample periods for final result. As one can see, this is very similar to a backtest that I have performed many times on a single asset time series but I want to extend the same idea to multiple securities such that securities are selected based on some criteria in the in-sample (Sharpe, CAR etc) and then buy and hold those securities in the out-sample.