Tweaked Rotational Trading Strategy

I am facing difficulty in developing the AFL for a portfolio backtest, for a tweaked Rotational Trading strategy. My Exit depends on relative Position Score, but may not necessarily be the Worst Rank of my open positions. I would also like to have Exit based on Stop Loss or Target. Further, I do not necessarily want to add a new position, simultaneously while Exiting an existing position.

  1. During backtest, at any bar, I want to know the number of Open Positions (Long or Short), so that I can increase or decrease my position based on the number of my open positions.

  2. I also want to know, at any bar, the Symbols in which I have a position (Long or Short), along with their Ranks.

Can you please guide me how to do this? If you could also shed some light on the internal working of the Enable Rotational Trading feature, it would be great.

Thank you.