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!
Size:
Color:
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
Size:
Color:
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
Size:
Color:
In addition, where can I find an example to set the limit in strategy code?
Thank you
Size:
Color:
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.
Size:
Color:
Thank you, I found what I was looking for, it was under "Position Options".
Size:
Color: