Following up on the prior Strategy Stress Testing post: with the release of AmiBroker version 6.10.0 a new Monte Carlo mode has come available for simulating portfolio equity changes. Instead of randomizing the trade list, the new mode uses bar-per-bar percent equity changes at the portfolio level to generate permutations. Consequently cross-sectional correlations are preserved. According to AmiBroker’s developer, the new method is perfectly fine for multiple overlapped positions, provided the number of bar-per-bar equity changes is sufficiently large (> 100).
The portfolio level Monte Carlo simulation is controlled by a couple of new SetOption fields which allow for AFL implementation right into the strategy code:
The Monte Carlo Portfolio Analysis code is suitable for copy/paste inside a rotational model like the familair Simple GMR code attached to the prior Monte Carlo post. However, my preferred method is to save the code as a separate file for inclusion in strategy models by calling the #include command: