Max number of open position
Author: CarmaAdvisory
Creation Date: 2/19/2016 11:52 AM
profile picture

CarmaAdvisory

#1
Hi all, I'd like to test strategies in Portfolio Simulation Mode, with a fixed amount per position. In addition (and this is why I need your help) I'd like to set a limit to number of open positions.
Is it possible? If so, how can I set this kind of constraint?

Thank you in advance!
profile picture

Eugene

#2
Hi,

Sure it's possible. You can either set this in strategy code (on a per strategy basis) or simply use the Position Options PosSizer. It lets you limit the number of open positions across the portfolio (in a single instrument, max. long and/or short positions, combined with other options etc.) Here's direct installation link:

MS123 PosSizer Library
profile picture

CarmaAdvisory

#3
Thank you Eugene, I've already installed PosSizer but I'm not able to find this limit...

Can you tell me where it is?

thanks
profile picture

CarmaAdvisory

#4
In addition, where can I find an example to set the limit in strategy code?

Thank you
profile picture

Eugene

#5
QUOTE:
Can you tell me where it is?

Perhaps you've overlooked the Wiki link above, Max Open Positions is even highlighted there:



Every option is either a button (that you have to press to activate) or a dropdown.

QUOTE:
In addition, where can I find an example to set the limit in strategy code?

Try searching our forum.

Note, however, that due to the way Wealth-Lab's backtest works (executing all signals in Raw Profit mode first and then applying a position sizing overlay), in strategy code you can set this only for the current stock being processed, not for the entire portfolio. To achieve that on a portfolio basis you'd have to rewrite the script to loop by DataSetSymbols. Your best bet is this PosSizer.
profile picture

CarmaAdvisory

#6
Thank you, I found what I was looking for, it was under "Position Options".