Combining Max Percent Risk and Portfolio Percentage
Author: browna3
Creation Date: 1/26/2009 7:30 PM
profile picture

browna3

#1
I have a script written that currently uses max percent risk for the position sizing. For example I have that set to 2%. However, I also want to ensure that the position size (dollar value) is less than 10% of the total portfolio. Is this possible? If it is, are there any examples that can help me do that? Please provide links if possible.

In this same script I add in to my position if it has gone in my favor far enough. I would like the add in position to be smaller than the original. Is there a way for me to control the amount of shares that are purchased outside of the 2% max percent risk setting that I have set? Additionally, the price that I would like to add in at is determined by the a couple factors, one of which is the number of shares purchased in the original position. Is there a way to determine that? The documentation mentions that the Shares property of the the Position object always returns a 1 while the strategy is executing.

Thanks!
Ames
profile picture

Eugene

#2
These days WL5 is still being rebuilt. The next version 5.4, for instance, will still be bringing some of the missing features like Optimizer, and hopefully, a SetShareSize analogue. Adding to original position i.e. pyramiding is currently not possible because of the lack of such a function.

Nonetheless, as we found out WL5 is versatile enough to get the strategy equity curve and other properties in run-time. Currently we are halfway through creating a knowledge base article that will illustrate how to build a strategy that interacts dynamically with portfolio equity.
profile picture

Cone

#3
QUOTE:
I also want to ensure that the position size (dollar value) is less than 10% of the total portfolio. Is this possible?
Although Eugene will soon have an article that demonstrates a somewhat esoteric way of accomplishing this now, later this year (could be 5.4 or 5.5) this will readily be possible with "PosSizers", the new name for SimuScripts in V5.

QUOTE:
Is there a way for me to control the amount of shares that are purchased outside of the 2% max percent risk setting that I have set?
Again, sizing outside of the basic controls will require scripting with PosSizers (or a SetShareSize function as Eugene suggested).
profile picture

browna3

#4
Would it be best for me to wait until 5.4 or 5.5 come out or should I start re-developing in version 4? How likely is a 5.4 or 5.5 release that includes the features that I need this year? Will it be early or late this year? Is there any possibility of getting an early beta version of 5.4 or 5.5?

Thanks.
profile picture

Cone

#5
The deliverable features for 5.4 and 5.5 aren't cast in stone, so I can't tell you if PosSizers are going to make it for sure this year. The coding technique that Eugene will demonstrate in a KB article should work, although it's not nearly as intuitive.