I was wondering if someone could please help with the following, and/or direct me to where this has already been answered.
I am testing a system on a portfolio of just 3 ETFs. Buy and Sell signals can come on any bar. What I want to be able to do, is allocate 100% of equity irrespective of how many open positions there are, assuming there is at least 1 open position.
Meaning, when the 1st buy signal is triggered, I would use 100% of equity. If then a 2nd buy signal was triggered, the system would sell 50% of the current open position, and allocate 50% to the new trade.
It would also scale out. If say I had 3 positions open at 33.33% equity, and 1 position issued a sell. This position would be sold, and the available equity split 50/50 to the 2 remaining open positions, which would increase from 33.33% each to now 50% of equity each.
@otg many of the posts in that thread, and several of the links in that discussion thread are not related to rotational systems. Just scaling in and scaling out. I think if you go through the posts and the links carefully you may find your solution (and will certainly learn a lot about scaling in AmiBroker). Best of luck.
@OTG Since you have already dealt with this issue with rotational systems using the custom backtester, you could use a similar approach in your non-rotational system. It will be difficult to use the scale-in, scale-out approach in the phase 1 backtest because you usually do not have knowledge of the number of open positions during phase 1 when backtesting a portfolio.
Yes, I have resorted to using the custom backtester. With the rotational system, I only had to deal with open positions, and check current position size relative to the initial position size.
With this system, I need to first assess the number of open positions and new entries or exits, and then assign position size.