Using ActivePositions.Count as a qualifier
Author: sktrades
Creation Date: 1/11/2013 1:31 PM
profile picture

sktrades

#1
I'm trying to run a backtest of a modification of the ConnorRSI strategy. But I'd like to limit the number of positions active to a max of 3. I modified the code to use ActivePositions.Count to qualify a new position:

CODE:
Please log in to see this code.


But when I run a backtest, I still get more than 3 active positions simultanoeuly taken. What am I doing wrong?

thanks,
Steve
profile picture

Eugene

#2
Due to the way Wealth-Lab's backtest works (executing all signals in Raw Profit mode first and then applying a position sizing overlay), the number of active positions in a portfolio backtest is under PosSizer's control.

To control the maximum number of open positions across the portfolio, you can use the Position Options PosSizer from MS123 PosSizer library (for example).
profile picture

sktrades

#3
Thanks.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).