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.
profile picture

rbryant

#6
Hi
I would like to do the exact same thing: Use RiskStopLevel for risk sizing, but with a max percent of account. I looked up the Pos Sizers and didn't see anything relevant. Any tips please?

Thanks and best regards
Rod
profile picture

Eugene

#7
Hi Rod,

Based on your description, it sounds like Constant Risk will fit the bill. And with Position Options you should also be able to limit total invested amount ($ or %).
profile picture

rbryant

#8
Such a fast answer! Yet again!

I will try those this weekend, thanks. The latter looks ideal.

PS: How do you know when someone has asked a question - do you get an alert? (as you always answer quickly).

Thanks
Rod

profile picture

Eugene

#9
Cannot imagine my workflow and digital life in general without at least partial automation of their many aspects. So yes, I get notified. There's even an auto-responder for certain kind of support requests which triggers from time to time. For example, it makes suggestions when Wealth-Lab crashes or can even get another free trial to a returning user upon request.
profile picture

rbryant

#10
Nice work
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).