Limit Monthly Drawdown PosSizer unexpected results
Author: llhk
Creation Date: 7/24/2012 1:58 AM
profile picture

llhk

#1
I am using the "Limit Monthly Drawdown" possizer in the strategy code "S&C 2011-01 | Combining RSI with RSI (Konner), my testing is using the S&P1500 as the dataset, I found that some trades were still buying in through my monthly drawdown from the beginning equity level was already over what i set. I don't know if my understanding of this possizer is incorrect or the possizer code has some problems. Please kindly give your advice. Thanks!

Here are the screen captures:

Possizer:


Trade Details:
(Should not have trades for 2008/9/22)


Equity Level:



profile picture

Eugene

#2
QUOTE:
(Should not have trades for 2008/9/22)

From what I saw, trades taken by your system before September 22, 2008 were exited either after that date or in October. As "Use intra-month equity" option is not enabled, the PosSizer takes the equity value from the beginning of September. The impact on the portfolio equity by the spree of losing trades (entered on 09/11, 09/12, and 09/18) is not considered. Try turning the option on and see if it changes the PosSizer's behavior.
profile picture

llhk

#3
checked the option "Use intra-month equity", some trades did skip but still have some being bought.

The equity level in this month:


Trade details:
profile picture

llhk

#4
Trades on 2008/9/11, 9/19, 9/24 should not been traded in my understanding, right?
profile picture

Eugene

#5
QUOTE:
Trades on 2008/9/11, 9/19, 9/24 should not been traded in my understanding, right?

If the equity percentages on 9/11 and 9/19 both exceeded (100% - 2% = ) 98%, why not?

However, I need to verify one theory that might have something to do with what you're seeing. Could you please do me a favor and perform one more test? Run your system in single-symbol mode (on one symbol of your choice), at the same time bumping the position size up from 3% so that it could considerably affect the equity curve (i.e. make it possible to have a monthly drawdown of 2% or greater). Does the PosSizer now work correctly?
profile picture

llhk

#6
Yes, just done for the single symbol mode, and it is correct.

In fact, I have tried to write my own possizer based on the logic of "Limit Monthly Drawdown" as I want to use the Tag property to multiply the size for different signal in the same strategy, but i got the same problem as the original possizer. I then write the equity value of the beginning of the month into a text file each time my possizer called in the testing and found that the beginning amount were not the same within the month. Don't know if this information help you or not.

Something likes below:


My possizer code:
CODE:
Please log in to see this code.
profile picture

Eugene

#7
Thank you, your findings are in line with my expectations. I have an idea why it works correctly in SSB mode and not always so in a MSB backtest.

The problem we're dealing with here is caused by Wealth-Lab not synchronizing the different historical data sets when doing multi-symbol backtesting. We already worked around this limitation before in other PosSizers and visualizers, but here it seems tricky and a workaround is not obvious yet.
profile picture

llhk

#8
You're welcome.

It must be a difficult task but hope it can be solved soon.

May I ask one more question here? I would like to build a customized input form for my own possizer, is there any reference for me? As I can only extend BasicPosSizer, ICustomSettings to get a basic form with 3 basic parameters as the tutorial given
profile picture

Eugene

#9
Sure there is. Log in to our Wiki, open Home - MS123.PosSizers, and download the project's source code. There are working examples which inherit from BasicPosSizer or from PosSizer. (But if you wish to expand on this particular topic, please consider finding a more specific/new thread.)
profile picture

llhk

#10
Ok, let me take a look. Really thanks for your help, Eugene!
profile picture

Eugene

#11
There's significant difference in count of bars between highlighted symbols (IRBT, ENS, MCF and FNF: 1689-2781 bars) and all the rest (e.g. DHI, BKE, HVT, RYL... 5075-6190 bars). Just an illustration that proves that the issue is connected with the absense of synchronization of the different historical data sets in an MSB.

Please create a support ticket to ensure that your bug report is in our queue. tia.
profile picture

Eugene

#12
Here's a proposed solution to the problem.

The EquityCurve and CashCurve properties, both being DataSeries, have a ConvertDateToBar method that you could use to get a correct bar. For example:
CODE:
Please log in to see this code.
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).