Mutual fund rotation strategy - same bar exit and entry
Author: avishn
Creation Date: 5/13/2010 12:16 PM
profile picture

avishn

#1
This might be a trivial question but I'm struggling to come up with a solution.

I have a strategy which is always 100% in the market, holds one fund at a time, on trade signal it sells current fund and buys a different fund with all available equity. Which position sizer do I select to allow same bar exit and entry at 100% level?

profile picture

Eugene

#2
It's Position Options - since v2010.03 it includes the so called "Skipped trade solution". Please enter a new ticket to get the updated PosSizer pack.
profile picture

avishn

#3
Thank you. It appears I already have 2010.03 installed.

When enabling that option I can get all trades filled only if I go down to 94% of equity trade size or lower. Otherwise it still skips trades. I think I understand that the results are somewhat dependent on commission ($8 in my case) and slippage (zero), but 6% buffer seems to be a lot. Am I missing something obvious? I guess basically I'm looking for an option similar to "transfer/reallocate 100% of capital" that many (most?) brokers provide when trading, for instance, a 401k account.

profile picture

Eugene

#4
94% is unexpected. Could you tell me the following?

1) Order type and entry price
2) OHLC for the signal bar (bar) and next open (bar+1)
3) Position size
profile picture

avishn

#5
List of trades with "Position Options" 99% equity, "Activate Skipped Trade" solution --


List of trades in raw profit mode --


Note that the previously missing FSMEX trade from 2/18/2009 now appears in the list. Entry price is $19.53 (BuyAtMarket), previous (signal) bar price is $19.59. This is mutual fund so OHLC are all the same.

Starting capital is $10,000 in both cases.
profile picture

avishn

#6
As a side note, MAE and MFE don't seem to match for the preceding (1/5/2009 FSAIX) trade in two position sizing modes... Not sure if it's a problem (unrelated to the skipped trade, of course) or not.
profile picture

Eugene

#7
Thank you. What was the equity value at the signal bar?

Re: MFE - MAE/MFE includes the commission value, maybe this explains the difference.
profile picture

avishn

#8
Signal bar equity (2/17/2009) is $76,170.36.
profile picture

Eugene

#9
It seems that the reason why this happens (i.e. the missing FSMEX trade) is that the proceeds of FSAIX sale are not available on the signal bar. The portfolio equity on the penultimate bar of the FSAIX trade was greater than on the signal bar, so the proposed trade size for FSMEX on the same bar is larger than WL could take. There's no such issue if you don't rotate into another symbol on the same bar.
profile picture

avishn

#10
Ok, so I guess currently this kind of rotation is not possible to backtest (same fund family) --



BTW, I've also tried to use SellAtClose(bar) instead of SellAtMarket(bar+1), but that causes even more trades to be skipped even at 90% and below position size.

Would it make sense for me to start looking into creating a custom PosSizer to achieve it? I've never done it before and I'm curious if such PosSizer is possible in principle.
profile picture

Eugene

#11
QUOTE:
BTW, I've also tried to use SellAtClose(bar) instead of SellAtMarket(bar+1), but that causes even more trades to be skipped even at 90% and below position size.

Are you sure? I can easily enter trades using 99.9-100% of portfolio equity when selling a Position at close - w/o even having to resort to the PosSizer (i.e. using nothing but the built-in Pct Equity option):
CODE:
Please log in to see this code.
profile picture

avishn

#12
Yes, that specific FSMEX trade seems not to be affected.

Now, please take a look at this --

CODE:
Please log in to see this code.


Raw profit: 2 trades
Position Options, 100%, "Skipped trade solution: ON": NO TRADES
Position Options, 99.9%, "Skipped trade solution: ON": 1 trade
Standard Pct Equity 100%: NO TRADES
profile picture

Eugene

#13
QUOTE:
Standard Pct Equity 100%: NO TRADES

There was an up gap, so it's expected.

HOWEVER, if I modify this line:
CODE:
Please log in to see this code.

this way - i.e. shift the next entry a bar or two in the future:
CODE:
Please log in to see this code.

...and set the position size to 99.9% in "Position Options", I get the two trades despite a gap up of 6.87% on the 2nd trade, and 0 trades with the built-in Pct Equity method (expected). This proves that our skipped trade solution is working as expected.

And at the same time leads me into thinking there could be a WL issue here.
profile picture

avishn

#14
Ok, please let me know if I need to file a ticket or something.

Back to the mutual fund same-bar reinvesting question (i.e. sell & buy at market at the same bar+1)... What's my best option at this point? Wait for you to look into possible WL issue... Or try to build a new PosSizer to handle that? I'm even thinking that I probably should just set share size in the strategy and bypass position sizing altogether.
profile picture

avishn

#15
So... Any more ideas on this by any chance?
profile picture

Cone

#16
Wealth-Lab was designed for stocks and futures trading. There's no way to do that Fidelity mutual fund option in Wealth-Lab. If you want it, call your Fidelity rep, tell them about the option you'd like to backtest in Wealth-Lab using 100% equity, and ask that Wealth-Lab fully support mutual fund trading. It would be a nice enhancement.
profile picture

avishn

#17
Ok, I understand.

Can the "same day" problem be solved in any form with a new custom position sizer?

Another question -- it appears that there might be an issue with WL even when the previous position is closed on the day before (see a couple of posts above). Can we get some clarification on what exactly is causing the issue (if there's one) so it can be easier isolated when backtesting the strategy? The problem I'm having now is that when I'm edging closer to 100% reinvestment of available equity, to understand full potential of strategy, I can never be sure if the trades skipped because of not enough funds are available or because there's something wrong with WL's position sizing.
profile picture

Eugene

#18
QUOTE:
Another question -- it appears that there might be an issue with WL even when the previous position is closed on the day before (see a couple of posts above).

Ditto. I believe that not fully releasing the proceeds of an AtClose( bar ) sale until bar+2 is incomprehensible.
QUOTE:
Can the "same day" problem be solved in any form with a new custom position sizer?

Position Options tries its best to do it, but...
profile picture

Cone

#19
QUOTE:
I believe that not fully releasing the proceeds of an AtClose( bar ) sale until bar+2 is incomprehensible.
Please make a specific example (1 or 2 trades only) with script, sizing, and Y! or Fidelity data.
profile picture

Eugene

#20
For script code producing 2 trades, please refer to message dated 5/16/2010 12:24 PM by avishn.
Symbols: FSRPX, FSRBX.
I've sent you the "latest and greatest" MS123.PosSizers (2010.04).
What confuses me about that is expressed in my reply @ 5/16/2010 1:08 PM.
profile picture

Eugene

#21
This issue isn't forgotten, I'm just pretty busy working on a few projects (incl. sample streaming provider to go open source) - we will look at this later.
profile picture

Eugene

#22
Re: 5/16/2010 12:24 PM

What I found is that the EquityCurve[bar] value on bar 2009/5/13 correctly represents the closed equity value. However, the double equity value supplied to my PosSizer on that bar raises concerns (it's the reason for skipping that 2nd trade).
profile picture

Eugene

#23
avishn, thank you for the heads-up. This bug has been trapped and a fix is coming in version 6.2.
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).