MS123 PosSizer library - a collection of money management methods
Author: Eugene
Creation Date: 1/7/2010 8:33 AM
profile picture

Eugene

#1
The PosSizer library library is available to download for Wealth-Lab 6 customers.

The following management techqniues are included:

* Constant Risk
* Control Drawdown
* D-VaR position sizing
* Drawdown/Runup
* Equity Breakout
* Extraordinary opportunities
* Fixed Ratio
* Graded equity percentage
* Increasing risk % with growing equity
* Kelly criterion
* Larry Williams method
* Limit monthly drawdown
* Losing streaks
* Market's Money
* No Profit/Loss Sharing
* Percent volatility
* Percent Winners Pos.Sizing (% Equity)
* Portfolio Heat
* Position Options (many helpful and time-saving options)
* Position sizing with the Trend
* Priority adjustment
* Pyramiding
* Random (in demo version)
* ROR as Benchmark
* Secure F
* Spread Equity Equally
* Timid/Bold Equity
* Trade Outcome
* Trading the Equity Curve
* Win Increases
* Winning streaks
* Withdrawal
profile picture

Eugene

#2
Update: Descriptions added to each money management method's page in the Wealth-Lab 5 Wiki. You can get online help by clicking the "More info..." link in PosSizer Settings (applies to MS123.PosSizers only, not to Wealth-Lab's built-in PosSizers).
profile picture

maninjapan

#3
I believe this is along a similar line of thinking of Percent Volatility, adjusting position size based on the volatility of the product traded, but what about a position size based on a max $ loss of a 1 or 2 standard deviation move?
different enough to worthy consideration?
profile picture

Eugene

#4
It doesn't ring a bell, please explain your method to me.
profile picture

mikesblack

#5
Idea for future sizer script:

Use period ROR as a benchmark for percent of equity used:

.If _____ ( day, week, month, quarter)ROR is < or > _____ then sizer =________% of equity.
.If _____ ( day, week, month, quarter)ROR is < or > _____ then sizer =________% of equity.
.If _____ ( day, week, month, quarter)ROR is < or > _____ then sizer =________% of equity.
.If _____ ( day, week, month, quarter)ROR is < or > _____ then sizer =________% of equity.
.If _____ ( day, week, month, quarter)ROR is < or > _____ then sizer =________% of equity.
If _____ ( day, week, month, quarter)ROR is < or > _____ then sizer =________% of equity.
.Here, like priority perhaps 6 bins.
profile picture

Eugene

#6
Thanks, that's interesting.

If I count out the "If _____ (" (i.e. N-period return), leaving only "1-month, quarter, year" (and hopefully day/week) instead + limit this to 2-4 lines (6 is overkill), then it seems doable.
profile picture

mikesblack

#7
Also practically difficult to implement over a large portfolio. 4 would be better than 2.

re: N period return. Are you saying that you would prefer taking out the capacity to make periods a variable? My preference is to use days and vary that number and forget weeks/ months etc. . If I understand you correctly then is it a coding issue or are you saying it is practically unreasonable for trading?
profile picture

Eugene

#8
OK let there be 4.

re: N period return. Yes, it's a coding issue. If you have a ready algorithm for N period return, please share it.

I already have over 20 items on the to-do list of MS123.PosSizers (issues, enhancements and new PosSizer ideas), but there also are many scheduled tasks and new projects I'd like to start this year. Time is precious.
profile picture

mikesblack

#9
Your time and efforts are appreciated. If I can come up with something of course I will share.
profile picture

Eugene

#10
Hi Mike,

For simplicity's sake, let's avoid the ROR concept [daily...annual] completely. Without complicating things, you'll be able to perform your graded equity adjustments using 4 rule sets. It's just instead of "periods", there will be "bars" - simple and robust.

profile picture

mikesblack

#11
Great stuff! I should think that will work well.

Additionally, is there some way rather than to size positions as a response to some external condition, in this case, percentage of portfolio change in X bars of data( but could be priority or other) , but to rather set parameters on the number of open positions allowed.

As an example:
...
percentage of equity = 5%
...
N bars: Change% Limit max open positions to :
5 > 5 15
5 > 10 20 ..or whatever
... etc

Logic- Perhaps optimization of a system that is not entireely efficient can be better implemented by keeping size the same, say to have greater exposure to higher priority signals, but rather increase/ decrease exposure through funding level.



I have some further questions/ ideas. Perhaps later I'll post. I'm in San Francisco today at a Predictive analytics/ data mining conference that has spawned some ideas.

Thanks Eugene.

profile picture

Eugene

#12
No problem, this feature has been added.


However, from this point we'll stop adding any new tweaks to it.

It's funny but despite the PosSizer logic takes just 100 lines of code, the rest (fancy GUI, options etc.) complicates it quite a bit, so the resulting code has already gone over 1300 lines.
profile picture

mikesblack

#13
This is going to be a great add. Thanks so much.
profile picture

Eugene

#14
MS123.PosSizers are updated to 2010.03. Numerous changes:

* Added: new PosSizer - Increasing risk % with growing equity
* Added: new PosSizer - Secure f
* Added: new PosSizer - Timid/Bold Equity
* Added: new PosSizer - Control drawdown
* Added: new PosSizer - Trade Outcome
* Added: new PosSizer - D-VaR position sizing
* Added: new PosSizer - ROR as Benchmark (requested by mikesblack)
* Added: new PosSizer - Graded equity percentage (requested by wl64bit)
* Added: new PosSizer - Spread Cash Equally (requested by sl44096:
* Added: Fixed Ratio: option to switch to Fixed Fractional once Equity increased a certain percent
* Added: Limit monthly drawdown: option to use intra-month equity
* Added: Equity Trading: the ability to increase or decrease position size when "under water"
* Added: Percent Volatility: Adjusting trading size after the original Turtles: decrease risk while in drawdown compared to starting equity
* Added: Position Options: many improvements:
o "Skipped trades solution" for AtMarket orders
o Possible to take only long/short positions without touching the Strategy code
o Ability to use WealthScript Override (SetShareSize)
o Ability to filter trades by their Priority
o Option to always use original stating capital (turn off reinvesting)
* Fixed: internal and cosmetic fixes in Position Options, Limit monthly drawdown, Equity Trading and Percent Volatility
* Fixed: bug leading to incorrect calculations in Drawdown/Runup, Market's Money, Pct Winners (% Equity), Fixed Ratio, Priority adjustment


Existing Wealth-Lab 5 customers: please request the updated DLL free of charge by creating a support ticket (Fidelity WLP customers, be prepared to prove your entitlement.)
profile picture

Cone

#15
Wow, great work Eugene!
profile picture

mikesblack

#16
Indeed. I second that. Great work. Very useful and well thought out. Thank you Eugene.
profile picture

tassod

#17
Hi Eugene,

I posted a reply to my ticket requesting the updated version to MS123.PosSizers. I am getting a unhandled exception when i try to open the drop down menu for position sizing in Wealth Lab. Am i missing something?
profile picture

Cone

#18
You may have missed the big red Note! in the Revision History.
profile picture

tassod

#19
Sure did, that was it. Thanks Cone!
profile picture

avishn

#20
I'm seeing a strange problem with SecureF position sizer. It seems that it stops taking trades if the allowed drawdown percent is too high.

...executed against NASDAQ 100, 5-year time span.

SecureF with max drawdown of 10%:

http://img688.imageshack.us/img688/9854/sf10pct.png

SecureF with max drawdown of 40%:

http://img177.imageshack.us/img177/7977/sf40pct.png
profile picture

Eugene

#21
Due to space constraints, I had to remove the code and pictures - sorry. (This was meant to be an announcement thread originally.)

Anyway, I confirm the issue exists even with a different strategy. Thank you for reporting, I'll mark it for later.
profile picture

tasmaine

#22
I would like to request an addition to the PosSizer collection. It appears that it may fit best in the "Position Options" entry. I would like to add an option that would limit the number of entries / day to a user-selected value.

This is an effective filter for dip-buyer type systems and has shown it's worth in WLP 4.x. However I don't know how to program it for WLP 5.x

Thanks.
profile picture

Eugene

#23
But isn't "Max Entries Per Day" already doing it?
profile picture

tasmaine

#24
Good point.... I wasn't totally clear. What I really want is a combination of 3 filters:

1. Limit each entry to x% of equity.
2. Limit each day to y entries.
3. Limit each symbol to z entries. (In my case z=1, most often.)

With "Max Entries Per Day", I get 1 & 2, but not 3.
With "Positions Options", I get 1 & 3, but not 2.

I would be happy with any PosSizer that gives me all three. Thanks for considering this.
profile picture

Cone

#25
Max Entries Per Day give you #1 and #2. Your trading script can do #3.
profile picture

tasmaine

#26
I'll give that a shot. Thanks for the hint.
profile picture

dansmo

#27
@Eugene
Is it possible to make at least one other PosSizer source available that is not using the PosSizerSettingsBase, i.e. the percent volatility Sizer.
profile picture

Eugene

#28
Thank you for the request. Sure it's possible.

Demo source code in the Wiki updated with "Random2" PosSizer that doesn't derive from the BasicPosSizer and PosSizerSettingsBase interfaces. There are some differences to this approach vs. working with Wealth-Lab's BasicPosSizer, and this demo PosSizer will illustrate them.

Download Project Source (demo version)
profile picture

dansmo

#29
Thank you Eugene!
profile picture

mikesblack

#30
If it's not too much trouble was wondering if I could interest you in developing a new position sizer? I would like to be able to vary the number of active positions based on some dataseries value? Could this be a possibility?
profile picture

Eugene

#31
Mike,

Thank you for thought-out, detailed explanation (that I moved to a new thread). Having reviewed the PosSizer idea, for several reasons I don't see it as a component of MS123.PosSizers; however, I will help you getting it done as your own project. Please continue discussion in this new topic:

PosSizer request: Vary active positions based on DataSeries value
profile picture

Eugene

#32
2 avishn
QUOTE:
I'm seeing a strange problem with SecureF position sizer. It seems that it stops taking trades if the allowed drawdown percent is too high.

This is the result of formula producing a size way too much. Debugging shows it's not unusual to get a Secure F of 2 or 3.9 - i.e. trying to take a 200%, 390% position. When the capital isn't enough, trades are rejected. You can try running the WL4 original (Secure f, the poor man's version) to verify it.

After fixing a couple of errors in my code, I still have a feeling that the results are in la la land, so most likely, it's not going to be a big deal when the SecureF PosSizer disappears from the release 2010.06.
profile picture

avishn

#33
Re: SecureF

I see. I guess it would make sense to always have some kind of %% cap for unbounded position sizers as one of the configuration parameters. Clipping at 100% is more intuitive than discarding the trades altogether. D-VaR sizer we've discussed in another thread seems to have this problem solved.

On the specifics of SecureF... I think it was an interesting exercise in position sizing according to the shape of the equity curve, but if the results are not reliable then I guess there's not much value in keeping it.
profile picture

Eugene

#34
This is a good point, and I did clip the size at 100% - but tracing still shows too many unexpectedly large "F" readings, causing 100% sizes all the way. Guess there's something not quite right with the original implementation. It's better to demote it before it does some real harm.
profile picture

Eugene

#35
MS123.PosSizers has been updated to 2010.06. Summary of changes:

* Added: new PosSizer - Withdrawal - to simulate the effect of withdrawing a fixed sum of money on a monthly basis
* Added: new PosSizer - Larry Williams method
* Added: Position options - "Max entries per day" option. Works in any bar scale. For intraday trades, it sums up positions taken during the day.
* Added: "Pct Winners (% Equity)" - option: use rolling percentage of winners based on user-specified number of last trades (requested by mikesblack)
* Changed: Percent volatility - ability to enter a percentage smaller than 0.1
* Removed: "Secure F" - despite fixing a few bugs/issues, the formula is producing suspiciously large percentages. PosSizer demoted.

Existing Wealth-Lab 5 customers: please request the updated DLL free of charge by creating a support ticket (Fidelity WLP customers, be prepared to prove your entitlement.)
profile picture

tedclimo

#36
My most valuable PosSizer(in 4.5) is a liquidity algorithm.... that makes sure my order does not exceed 3% of Ave. Daily Volume. My live-trading experience is that orders in excess of 3%(of ADV) end up being completely filled on the losers & only partially filled on the winners. Net, net.. All too often, I become the catalyst for the bounce/reversal on the ultimate winners (& end up with partial fills on the stocks/ETFs that are less liquid). So I limit my trade size to a 3% max of the Ave. Daily Volume.
The code I use in 4.5 Simuscript looks like this: AND it works like a charm.
Obviously, I am now seeking a 5.6 solution :)
CODE:
Please log in to see this code.


My question is: Is someone else already doing something similar? Or does 'Full Version' of MS123.PosSizers include something similar? I'm not seeking an exact 5.6 replica of how I do it in 4.5. Just something similar.

Thanx in advance.
profile picture

Eugene

#37
No existing PosSizer is doing something similar, so thanks for the suggestion/code. I'll code a liquidity PosSizer based on your idea with options for moving average periods, a switch between current equity and fixed capital value (MaxTrade) and rounding.
profile picture

tedclimo

#38
Thank you in advance.
Earlier today, I placed a support ticket for your 'Full Version' of MS123.PosSizers...so I know better what is available now.
Regarding my proposal: the single most important add (for your users) would be that 'additional check box' for Max trade based on a % of Average Daily Volume.
If it's too much trouble to add which Moving Average of volume (10,30,90, etc), then ignore that & use 10-30ish as a default).
Same for 'Least Volume', this does add value to live trading liquidity (especially on the exits). Dip entries tend to occur on 'Panic' days(lotsa volume) while exits occur on 'Calmer' days (with quieter volume). So, basing entry Max Size on "% of Ave. daily volume", makes it tremendously easier to exit a trade with minimal slippage.
Rounding (to nearest 100 shares) is also very practical to live trading. But not as critical as the aforementioned proposal of "check box" for Max trade based on a "% of Average Daily Volume".

Currently(in 5.6), I accomplish this using a spreadsheet. I load every "entry Point" & "Max Capital" & " 3% of Average Daily Volume(manually calculated from ActiveTraderPro's Quote window(where I can see both 10d & 90day Average Volume concurrently)).

I have traded dozens of different dippers over the past decade(most entries occur on 'Panic' days) , & all have the same 'achilles heel' in live trading.... if Share Position Size is > 3-5% of Average daily volume, then slippage becomes a damaging factor on two fronts:
1) Losers get filled completely & Winners get partial fills b/c I become the catylyst for the ensuing bounce.
2) Exits occur later (on calmer days with less volume), so slippage in getting out becomes a factor.

By limiting position size based on (% of Average Dailly Volume), then in live trading, Real Trading Performance more closely resembles backtesting.

You & Robert are my heros,
Thanks again for all you do!!!!!
Ted!






profile picture

Eugene

#39
The PosSizer library has become available to Wealth-Lab 6 customers for direct installation from our site.

Note to existing users: As there were breaking changes to PosSizer configuration strings, it's recommended that you delete WealthLabConfig.txt before using! See the User Guide > Data > Where data are stored for the exact location. Make sure hidden file visibility is enabled in Folder Options of your Windows.
profile picture

Eugene

#40
The PosSizer Library, bug fix release 2010.10:

* Fixed: "Percent Volatility" - "Cap Position" option broken + field didn't allow input below 1%
profile picture

plustiber

#41
Eugene,

I was looking at the PosSizer Percent Volatility. Is the input labeled "percent volatility" actually "percent equity"? I was assuming that the position size = (P.E. * Equity)/(P.V. * ATR) where:

P.E. = Percent Equity;
P.V. = Point Value.

If that is the case, could you add ATR Multiple as an additional input so that the equation becomes: position size = (P.E. * Equity)/(P.V. * ATR Multiple * ATR)?

That way you can have both your initial stop and position size be a function of a multiple of ATR (note: the ATR Multiple should be of type double).

Thanks,
Peter
profile picture

Eugene

#42
Peter,

The position size is indeed = (Equity * Percent_Volatility) / (ATR * PointValue).

Sorry but based on the feedback, this PosSizer is being used the most and for this reason, I would rather avoid making a change to its internal configuration strings caused by introducing a new option.

However, you may create your own PosSizer for that, based on our open source code from the Wiki. Let me know if you need help with this (in a new thread).
profile picture

Eugene

#43
Version 2010.11 is a maintenance release. If you have already installed build 2010.09 or 2010.10, there's no need to upgrade. The only (cosmetic) change was the removal of a WLP6 upgrade helper DLL.
profile picture

Eugene

#44
MS123 PosSizer library has been updated to version 2011.01 on 01/12/2011.

This is a maintenance release fixing zero sized Alerts in two PosSizers: D-VaR position sizing and Fixed Ratio.

No other changes except that you should update to Wealth-Lab 6.1 to be able to install/use the library.
profile picture

Eugene

#45
MS123 PosSizer library has been updated to version 2011.02.

* Fixed: Position Options: "Max Positions Per Day" option may take excessive positions.

Identic bug exists in Wealth-Lab's original PosSizer - to be fixed in v6.2.
profile picture

Eugene

#46
The MS123 PosSizer library has been updated to version 2011.03.

Summary of changes:

* Added: Position Options: Liquidity filter reduces a position's size to a percentage of the N-day SMA of Volume.
* Fixed: Priority adjustment: removed the position size limit of 100%
profile picture

Eugene

#47
The MS123 PosSizer library is updated to version 2011.06.

Summary of changes:

* Added: Position Options: Limit total amount invested ($ or %) (requested by wl64bit and abegy)
* Added: Pyramiding: added the scaled-down (upright) pyramid
* Added: Position Sizing with the Trend: option to decrease size in opposite trend
* Added: Portfolio Heat: option to treat long and short risk separately
* Added: Drawdown/Runup: ability to increase/decrease during runups (just like in drawdowns)
* Changed: Position Options: options regrouped, dialog revamped
* Changed: Trade Outcome: position size can now exceed 100% (made configurable through option)
* Changed: Position Sizing with the Trend: dialog redesigned (any existing settings for PosSizer will be lost)
* Changed: Extraordinary Opportunities: dialog redesigned
* Changed: Drawdown/Runup: ability to turn off position size change during drawdown
* Changed: Drawdown/Runup: any existing settings for PosSizer will be lost
* Fixed: Drawdown/Runup: removed undocumented option to skip trades during drawdown. Reason: misleading (no "ghost" positions = trading stops completely)
profile picture

Eugene

#48
The MS123 PosSizer library has been updated to version 2011.07.

Summary of changes:

* Added: Secure F (Dr.Koch version) returns - now with an option to limit the F to a fraction (to curb down risk)
* Added: Drawdown/Runup: new Incremental behavior (requested by miroslav_krajcir)
* Added: Pyramiding: two new scale-in types: Reverse pyramid, Reversing Incremental pyramid (refer to online manual)
* Changed: Pyramiding: dialog redesigned, breaking change: any existing Pyramiding PosSizer settings will be lost
* Added: Position Options: for Max % Risk, cap position size at % (based on a [LINK=/Forum/Posts/New-Position-Sizer-requested-to-change-Max-Percent-Risk-behavior-31740#160088
]request[/LINK] by Sammy_G)
* Added: Position Options: reject if/force minimum position size option (requested by abegy)
* Changed: Position Options: redesigned dialog, clutter reduced (Note! for users of previous versions it's recommended to reopen the Position Options dialog and verify/apply settings)
* Added: Win Increases: new option to calculate equity change over last rolling N trades vs. over past N bars (default behavior)
* Changed: possible to install in Wealth-Lab 6.2+
profile picture

Eugene

#49
The MS123 PosSizer library has been updated to version 2011.09.

Summary of changes:

* Added: New PosSizer: Constant Risk
* Added: New PosSizer: Equity Breakout
* Changed: Priority adjustment: dialog redesigned (expanded to include 10 sizes). Be sure to double check your settings if you're using it.
profile picture

Eugene

#50
The MS123 PosSizer library has been updated to version 2011.11.

Highlights:

* Added: New PosSizer: No Profit/Loss Sharing (created by Robert Sucher)
* Added: Position Options: script-based Percent Equity / Max % Risk option (takes the value from Position.Tag or SetShareSize). Based on request by tradertabb.
* Fixed: Position Options: made some input boxes hidden when they're inactive according to corresponding option checkbox

Also, its open source demo version has been expanded to contain 3 PosSizers to facilitate your development; for more, see here.
profile picture

Eugene

#51
The MS123 PosSizer library has been updated to version 2012.01.

Highlights:

* Added: "Position Options": new checkbox "Use what's left for last position" - don't skip trade (requested by innertrader)
* Added: "Trade Outcome": new option "Sort by exit date"
* Changed: "Position Options" cosmetic changes

If you find that Wealth-Lab skipping trades, make sure to give the new option "Use what's left for last position" a try.

When you know how much positions your system can be holding (for example, up to 10 open positions with Margin Factor 1:1 and sizing positions at 10% equity), this option allows to eliminate more skipped trades in cash-limited situations. The idea is to press the "Max Open Positions" button, activate the new checkbox, and when you have 9 open positions and there's not enough equity to take the 10th signal, Wealth-Lab will still take the final signal, sizing the Alert using all the cash left.
profile picture

innertrader

#52
QUOTE:
* Added: "Position Options": new checkbox "Use what's left for last position" - don't skip trade (requested by innertrader)
Hi Eugene,

(Thanks for adding this feature and for the mention :) I tested the new posizer with the new "Use what's left...." option. I set Pct equity at 10, Max Open Positions to 10, and checked the box you referenced. With one of my strategies, I had to set to margin to 1.1:1 to get all trades to execute, the same as I previously had to set it at without the new posizer feature. With another strategy that previous required 1.7:1 margin to execute all trades, I could not get it to execute all the trades at any margin setting (it maxes out at 10:1). Let me know what additional information I can provide.

innertrader
profile picture

Eugene

#53
Hi Robert,
I tested it and the checkbox was working as expected. It comes into play only for the last signal (e.g. 10th position). If your strategy opens more than that, consider enabling the "Skipped trade solution" option.
profile picture

innertrader

#54
It doesn't open more than 10 positions, so I'm not sure why it's not working for me.
profile picture

innertrader

#55
Enabling the Skipped trade solution button in conjunction with the checkbox doesn't make any difference. Same warning message.
profile picture

sedelstein

#56
I am trying to write a position sizer based on the pct winners on the long positions and the pct winners on the short positions as well as the profit factor to date. I've downloaded the attachment on the position sizer page but was wondering if there are other code examples around from which to learn from or if anyone has done something like this before.

Take a non-zero position if the pct wins to date > X and Profit Factor to date > Y

Thanks
profile picture

Eugene

#57
innertrader,
QUOTE:
It doesn't open more than 10 positions, so I'm not sure why it's not working for me.

I suggest opening a new forum thread to discuss this issue. Please prepare a test case for me to reproduce (symbols, data range, strategy or demo code, settings etc.)

sedelstein,
QUOTE:
I've downloaded the attachment on the position sizer page but was wondering if there are other code examples around from which to learn from or if anyone has done something like this before.

None that I'm aware of.
profile picture

jamesmhaley

#58
I'm interested in using the pyramiding PosSizer. I've successfully installed the MS123 PosSizer library. Are there special programming requirements to successfully implement the pyramiding functionality? I've created a simple ma crossover app. I've configured the PosSizer Pyramiding option under the simulation mode. What other requirements are there?
profile picture

Eugene

#59
Yes. Typing in the initial signal name for the pyramid base is the key without which it's not going to function. Please revisit the PosSizer's online help page in the Wiki, and if that doesn't solve it for you, post in an existing thread on the Pyramiding PosSizer (I'm sure there was one this month on in January) or start a dedicated one.
profile picture

Eugene

#60
The MS123 PosSizer library has been updated to version 2012.03.


This is a maintenance release that fixes two bugs in Position Options:

* Fix: "Position Options": "Use Tag" to handle integer values as well
* Fix: "Position Options": "Skipped Trade Solution" ignored "Use Tag"
profile picture

Eugene

#61
Hotfix 2012.03.1:

* Fix: "Position Options": "Equity Limit" value was ignored

Found by Gamba here (thanks).
profile picture

Eugene

#62
Hotfix 2012.03.2:

* Fix: "Trade Outcome": peeking issue with multi-position strategies (reported by richard1000)

Found by richard1000 here (thanks).
profile picture

sifty

#63
Pilot error or defect in "Position Options" PosSizer? I have been experimenting with limiting number of short trades in this PosSizer. When I enable "Max short positions" and set the value to 1, the trades come through as advertized. Only 1 active short position at a time. However, if I enable and set the value to 0, *all* the generated short trades come through. Seems like a possible defect to me... Is there any way to turn off all short trades generated by a strategy from a PosSizer?
profile picture

Eugene

#64
It's simpler than you think. To take only Long or only Short trades, select from the dedicated dropdown box:



A zero in "Max Short/Long Positions" is ignored.
profile picture

sifty

#65
As usual - pilot error. Thanks Eugene.
profile picture

abegy

#66
Is it possible to add the following Money Management strategy
http://championship.mql4.com/2008/news/366 ?

Steps can be :
- tssf<1
- ((tssf>1) and (tssf<=2))
- ((tssf>2) and (tssf<=3))
- ((tssf>3)) and (tssf<=5))
- ((tssf>5))

Value for each step would be defined in Dollard or in percentage of the equity

Thanks in advance
profile picture

Cone

#67
Nice reference. I think we can base a TSL article on that :)
profile picture

Eugene

#68
BTW, that work was the basis of our Win Rate + Profit factor visualizer (before PosSizers came on stage).

Follow-up:

I'll take the TSSF PosSizer (ETA April/May 2012). Couple of notes:

1. Skipping a position (e.g. TSSF < 1) will not be supported for the same reason it's not possible in Trading the Equity Curve (for example): if you do not trade while being underwater, you will stay this way forever. Instead, we'll reduce the position size when TSSF drops below some minimally accepted threshold.

2. The idea of different steps has proved clumsy: e.g. here. There always be someone who needs more steps. Instead of steps, the TSSF PosSizer will vary the size gradually just like the % Winners PosSizer does. The more the TSSF the greater the position size (capped at some threshold, of course). Simple and robust.
profile picture

Cone

#69
QUOTE:
if you do not trade while being underwater, you will stay this way forever.
True, but only if you are not holding position(s). Positions are equity, which can also improve.

profile picture

abegy

#70
For me, I agree with Eugene... No trade must be skipped. This is not the idea of the TSSF money management strategy
profile picture

Eugene

#71
The MS123 PosSizer library has been updated to version 2012.05.

* New: TSSF (Trading System Safety Factor) PosSizer (requested by abegy)
* Fix: "Pct Winners %", "Fixed Ratio", "D-VaR", "Pct Volatility", "Larry Williams", "Increasing Risk": reading settings can potentially crash WL (thanks richard1000)
* Change: Wealth-Lab 6.3+ required to install
profile picture

streak

#72
Just downloaded 2012.05 with "Position Options". When I configure "Reject if size < $" all trades with volume less than the entered figure get rejected. Should this not be rejecting trades with a dollar value less than that entered?
profile picture

Eugene

#73
QUOTE:
When I configure "Reject if size < $" all trades with volume less than the entered figure get rejected.

Sorry, it's a typo. In reality, the option is working as "Reject if size < Shares" - rejecting a trade if current position's size is less than some number (rather than a dollar figure). In upcoming revision, I'll make the option behave as advertised.
profile picture

streak

#74
Thanks, ok, look forward to it (hopefully I can code a dll to do similar).
profile picture

Eugene

#75
What's new in the MS123 PosSizer library version 2012.06?

* Fix: "Reject if size < $" option was erroneously acting as "Reject if size < Shares" (thanks streak)
profile picture

Eugene

#76
What's new in the MS123 PosSizer library version 2012.11:

* Fix: "Limit Monthly Drawdown": in MSB only, was possible to take trades even though monthly drawdown was exceeded.
* Fix: due to a WL peculiarity, several PosSizers could sometimes produce incorrect results in MSB (QC 3139): "Control Drawdown", "DVaR", "Equity Breakout", "Fixed Ratio", "Market Money", "Percent Volatility", "Portfolio Heat", "ROR as Benchmark", "Timid/Bold Equity", "Win Increases", "Withdrawal"
* Fix: internal change to reduce memory requirements: "Control Drawdown", "Percent Volatility", "Position Sizing with the Trend"
* Change: requires .NET 4.0 (requires Wealth-Lab 6.4+)
profile picture

mikesblack

#77
Greetings-
I was looking for a way to limit position size to no more than 2 trades per symbol. As per position sizer "One Trade Per Symbol", is it possible at some time when convenient to create a position sizer that allows for this, or possibly even a way to make number of trades per position a variable ? If there is currently such a way and of which I am unaware, can you tell me which Position Sizer may do this? Thank you most kindly.
profile picture

Eugene

#78
You came to the right place: Position Options > "Max open in symbol" option.
profile picture

Eugene

#79
You're welcome Michael.

Note to posters: this thread is a "blog" for the MS123 PosSizer library release announcements, bug reports and your idea suggestions. Please ask general PosSizer questions in other/new threads; here they will be deleted. Thank you for understanding this.
profile picture

Eugene

#80
What's new in the MS123 PosSizer library version 2013.09:

* New: Pyramiding: added "Upright Modified, Small Initial Bet" pyramid shape
* Fix: Pyramiding: Reverse Incremental bug (previously, yielded equal/fixed pyramid sizes as a % of the step specified)
profile picture

Eugene

#81
What's new in the MS123 PosSizer library version 2014.02:

* New: "TSSF": ability to include the raw trades in TSSF calculation a.k.a. "ghost trading"
* Fix: "Priority": reading settings can crash WL
profile picture

Panache

#82
Is there any chance you could add a toggle in Position Options>Average Volume (SMA) for "Adjust size to %" like the limit above it (Adjust size to $)? Instead of rejecting a trade if the size of the trade is greater than the Average Volume, I'd like to still get my highest priority alert, even if it means making a smaller trade.
profile picture

Eugene

#83
Added to our product backlog for future consideration. I think this might be possible but implies a breaking change.
profile picture

Panache

#84
Thanks.

In case you've forgotten, I already wrote the code for this, so it's just a matter of integrating it into the Position Options position sizer http://www.wealth-lab.com/Forum/Posts/Average-Volume-Limitation-PosSizer-31498
profile picture

Eugene

#85
Thanks but it's the integration that is the problem, not coming up with the code. :) We have pretty limited screen real estate here so not much room for new options (if any). Might even think about combining your condition with "the limit above it". This is a mature and popular solution so I foresee potential compatibility problems with existing configuration files. That was my line of thinking.
profile picture

Panache

#86
That's why I was thinking you could do exactly the same thing you did with "Take any pos size" -- just have a drop down for "Adjust Size to %". However, if it creates compatibility problems, that's a whole different issue!.

I assume you know that Use SetShareSize in Position Options doesn't result in SetShareSize being shown as the Quantity in Alerts, however, WealthScript Override (SetShareSize) works as expected. I thought this might be helpful in sorting out the live bug in WL (#62853 In PosSizers, the Candidates list is empty for Alert sizing).

I can put my average volume limitation in the Strategy as a work around, so it's not a priority for me.


profile picture

Eugene

#87
UPDATE 4/17/2014:
QUOTE:
I can put my average volume limitation in the Strategy as a work around, so it's not a priority for me.

After weighing all pros and cons, I decided to not include this option in Position Options. This appears to be a single-user solution that you already have the workaround for, and it would be a breaking change.

QUOTE:
I thought this might be helpful in sorting out the live bug in WL (#62853 In PosSizers, the Candidates list is empty for Alert sizing).

The live bug doesn't have to do with this - it's a limitation. Just added it to the online help page:

Limitations

* "Use SetShareSize" does not work for Alerts (by design).

Note for posters:

This thread is a "blog" for the MS123 PosSizer library release announcements, bug reports and your idea suggestions. Please ask general PosSizer questions in other/new threads; here they will be deleted. Thank you for understanding this.
profile picture

Eugene

#88
What's new in the MS123 PosSizer library version 2014.11:

* New: "Portfolio Rebalancing" PosSizer (created by Leszek Mazur)
* Fix: "Extraordinary Opportunity": minor change to size increase calculation

For the first time, we're including in the library a PosSizer created by a Wealth-Lab customer. Make sure to try the "Balancing PosSizer" with Strategy specifically written to accompany it that you can download from within Wealth-Lab itself:

Portfolio Rebalance Strategy (Balancing PosSizer)
profile picture

Eugene

#89
What's new in the MS123 PosSizer library version 2015.02:

* Fix: Kelly PosSizer: now uses closed positions only to address a problem with unexpected size reported by sedelstein
profile picture

Eugene

#90
It's been a while since last update yet this release 2016.09 is highly recommended to apply by every user of "Position Options":

* Fix: "Position Options": major bug fix. Some options which reject trades ("Take only long/short", "Reject on Priority", "Candidate count filter") were ignored if "Skipped trade solution" was activated
* Fix: "Spread Equity Equally": due to an inherent bug, option "Cash" is depreciated (is now made to return result equal to the "Equity" option that functions correctly)
* Change: upgraded to .NET Framework 4.5, Wealth-Lab 6.8 or higher required to install or update
profile picture

Eugene

#91
What's new in version 2017.04:

* New: option "Use T+3" in Position Options will reject new trades if there are insufficient funds due to settlement
* Fix: "Position Options": bug fix. Several options ("Script-based % equity", "Size cap for Max % Risk", "Limit total invested amount") ignored "Don't reinvest" option
* Change: Wealth-Lab 6.9 or higher required to install or update
profile picture

abegy

#92
Hi Eugene,

In the last version 2017.07, you have changed "Use T+3" to "T+2" because of the new SEC regulation. In France, the AMF regulation requests "T+1". Is it possible to have the delay as a parameter instead of a fixed value to be more compliance with the different regulations ?
profile picture

Eugene

#93
Hi Alexandre,

The switchover to T+2 will take place only in September 2017 but to reflect the historical rule, T+3 will still be applied backwards to any trades before the cutoff date. PosSizers cannot differentiate stocks trading in different countries to apply T+n selectively and to control this, in addition to the T+n input I'd have to add a checkbox. So to support a rarely used option, I'd have to overload the PosSizer's already crowded GUI beyond reason. Sorry, there's no room for flexibility here. The best solution for you might be to develop a custom PosSizer.
profile picture

abegy

#94
Ok. I understand.
profile picture

abegy

#95
Hi Eugene,

Is it possible to add the Ralph Vince Optimal F position sizer in the collection ?
The formula can be find here : http://www.dummies.com/personal-finance/investing/investing-strategies/the-optimal-f-money-management-style/
profile picture

Eugene

#96
The library already contains a version of Optimal F called Secure F.
profile picture

Eugene

#97
What's new in version 2017.10:

* Change: Winning & Losing Streaks: Updated logic for consistent backtests and realistic Alerting