Using different Risk % for Different Symbols
Author: tradertabb
Creation Date: 10/10/2011 8:40 PM
profile picture

tradertabb

#1
I would like to see if there is a way to risk more when a "good" market signals (one that has historically done well relative to others). I would like to trade it with a little more weighting.

In WL4 we could do it in a Simuscript and reference the symbol. How is it done best in WL6?
profile picture

Eugene

#2
In a PosSizer.

The PosSizer would get the % risk for a symbol either from your Strategy (e.g. via an object attached to the Bars.Tag property and then unboxed in PosSizer, via Position.EntrySignal property etc.) or via direct input in PosSizer's GUI (e.g. text box).
profile picture

tradertabb

#3
Thank you. Any links to examples?
profile picture

Cone

#4
If by "risk" you just mean "larger size", then you could use the Position Priority PosSizer. However, using Position.Priority this way also has the effect of, well, prioritizing trades.

Another way is to use the standard Max Risk % sizer. Although the sizer will always use a fixed risk %, you could play with it in your strategy code by adjusting the RiskStopLevel closer for a larger position. Essentially, you'd just create a routine to reverse engineer the sizer to control the size.

For example, say you wanted to risk 2% per position, or $2,000 for $100K of equity. If a stock were trading at 50 and your stop level was 40, then the position sizing would be 2000 / (50 - 40) = 200 shares. However, you could effectively double the size of the position by assigning RiskStopLevel = 45 instead of 40. The sizer would create a 400 share position, but you could still use 40 as the position's stop value. Understand?
profile picture

Eugene

#5
A working example is just where one expects it to be -- in the Wealth-Lab Wiki, home of open source:

Home - MS123.PosSizers > Download attachment (create new ticket if downloads are unavailable) > see "Random PosSizer" code
profile picture

Eugene

#6
P.S. tradertabb, my initial reply relates to a custom variation of Max % Risk position sizing - if you meant that.
profile picture

tradertabb

#7
I downloaded the MS123.PosSizers. Hate to be such a bother, but I can't figure out how to get the position sizers in 6.1 - I've extracted them, but don't see them showing up in WL (like they did with 6.2), plus I still haven't figured out how to see the code to modify it to exactly what I want.

I want to take advantage of (or at least test) the bias towards the long side of most futures trades and the better trending nature of some markets;

I'm happy to pay for the work I need (just let me know rate and how to pay):

Example:

If symbol = JY and position is long then risk = 1.5%; else risk = 1.0%(on shorts);
If symbol = C_ and position is long then risk = 1.5%; else risk = 1.0%(on shorts);
If symbol = anything else and position is long then risk = 1.0%; else risk = 0.5%(on shorts);

Thanks!

profile picture

Eugene

#8
QUOTE:
I downloaded the MS123.PosSizers.

It's demo source code in the Wiki, not to be placed in Wealth-Lab's main folder. Open the solution in Visual Studio or SharpDevelop, get yourself familiar with this API manual:
Create a PosSizer, and you're ready to begin creating your own PosSizers.
QUOTE:
I'm happy to pay for the work I need (just let me know rate and how to pay):

You will be able to pay for the work once our Wealth-Lab MarketPlace is ready (but it's getting delayed due to other priorities). For now though I think I might consider looking at creating such PosSizer and eventually including it in MS123 PosSizers. Just don't expect a speedy resolution - my queue is already filled with other projects.
profile picture

tradertabb

#9
Thanks for your help "E"
profile picture

Eugene

#10
Hey there "Tabb Mr",

Look forward to backtest your logic in the next update (2011.11):
QUOTE:
If symbol = JY and position is long then risk = 1.5%; else risk = 1.0%(on shorts);
If symbol = C_ and position is long then risk = 1.5%; else risk = 1.0%(on shorts);
If symbol = anything else and position is long then risk = 1.0%; else risk = 0.5%(on shorts);

Here's how it will look like:



The idea is to click "Use .Tag" and select "Max % Risk". Two prerequisites for your Strategy:

1. Define a RiskStopLevel before entering a Position (QuickRef for more).
2. After successfully creating a Position you communicate the risk percent to the PosSizer. Example:
CODE:
Please log in to see this code.

The PosSizer will then recognize your flexible risk definition based on whatever inputs you imagine (risk by symbol, by position type, moon phase etc.)

(If your Bars.Tag is already occupied for some other purpose, there will be an alternative: click on "Use SetShareSize", assign your variable risk via SetShareSize, and the PosSizer will use this property instead.)

Of course you'll have to update WLP to 6.2 (patch release build 46), otherwise the extension won't install or update.
profile picture

tradertabb

#11
Wow, I like this update - wish I'd have been back here to visit sooner on this issue - but I am concerned about going to 6.2, since I couldn't get it to work with my data (CSI futures data) for some reason. It works fine in 6.1
profile picture

Eugene

#12
If "couldn't get to work" translates to "couldn't retrieve Named DataSeries from the futures datafeed", then unfortunately, 6.2 has bugs here (Wiki > Open Issues). To be fixed by 6.3.
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).