Optimal Position Simulations (2008)
Intro Case Pivot Position Simulations
Disclaimer + Fair Warning:
There's much more to the method than presented here. These simulations are of a very early version, employing gross simplifications of what I'm actually using. Since writing this, me and my friend Adi, have made many improvements and changes designed to reduce both risk, and number of trades. As presented, the method is not really viable or practical. Trying to follow this simple method at home may result in great risk exposure, too much activity, sub-optimal results, and gross disappointment.
I've coded and ran numerous simulations on various ETFs, of the Optimal Position algorithm. With a Pivot that's not forward looking.
The results I got were mostly as I expected; not many surprises.
Ongoing position adjusting, (at the end of each trading day, for convenience) using the logistic-function as a basis for determining the new position on a daily basis, and an average position of 0 (all portfolio in cash), over a period including both bull and bear markets, results in:
- Much lower volatility than "buy-and-hold" of the same ETF over the same period.
- A higher return in most (not all) cases were the underlying ETF is relatively volatile.
- Better return, and much better risk-adjusted return regardless of whether we chose the leveraged or inverse-leveraged ETF vs, buy and hold. Even in the cases where the optimal position had an overall loss for the simulated period, it had a much smaller loss than B&H. In most cases I tested the advantage over B&H was very significant: between 1.5x and 6x better than B&H in about 2-3 years of simulation.
- The algorithm under-performs the more predictable and less volatile the underlying ETFs are. For example, the algorithm under-performs the SPY (S&P 500 index ETF). But it generally out-performs SSO, the double leveraged index. You need to design enough inherent volatility into the system for it to work well.
- One of the best ways to employ the Optimal Position (OP) algorithm is to pick pairs of uncorrelated ETFs and shift money constantly between them. This exploits the most non-obvious cases of reversion to the mean (short term timing). Since short-term timing can fool even the best of the best of traders, the cold and calculated logistic function formula really shines here. OP is able to literally convert the daily noise and randomness (sigma) into its advantage (alpha).
- The algorithm performs best during times of uncertainty and high volatility (like the one we are now: Sept-Nov 2008)
- The algorithm generally under-performs in times of calm. This is kind of obvious because of two reasons:
- p0 (position at the pivot) is 0 (all cash). This means that the algorithm is under-invested during bull markets.
- What may be a bit less intuitive is that even if I set p0=1 (position at pivot is "fully-invested") during bull markets, and run it vs B&H on SPY, the algorithm still underperforms SPY during bull market periods. Only at around p0=1.5, the algorithm starts outperforming SPY during bull-markets, but it does so with higher risk/volatility that this overweighting brings. This makes the algorithm not very useful at times where "the tide lifts all boats". The reason is that the movements during calm are too predictable so there's not enough random volatility (sigma) to convert to alpha.
- Different choices of pivots make a difference, but a not a very significant one. I settled on a pivot that averages several moving averages and which seems to work generally well in my simulations. In the examples below, I didn't attempt to optimize (or worse: over-fit) the pivot choice.
- In all the cases I tried, the algorithm out-performed the underlying asset during bear markets. That in itself may be obvious because the approach is inherently market-neutral. Nevertheless, more significantly, in most cases it has good net gains during bear markets.
Below are a few charts with my simulations of the Optimal Position Algorithm vs several leveraged ETFs and their inverses. Please note that in most of these cases, most of the period that I have data for is the recent bear market which makes them look optimistic.
In all the charts below, unless I explicitly indicate otherwise, p0=0 (position at pivot is 100% cash) and no additional leverage is used, i.e. on average the algorithm is bounded between (almost) -100% (short) and (almost) 100% (fully invested) although most of the time it is only partially invested [-0.5 .. 0.5] with the rest in cash.
To avoid large draw-downs, I added a "stop-loss" rule to these particular simulations: The algorithm switches to all cash (position=0) whenever the underlying asset moves over e (the natural logarithm base, about 2.718) standard-deviations above or below the pivot. I didn't try to optimize this number. I found that 2.2 is roughly optimal for non leveraged ETFs (for the limited period tested) and, I like e because it is the basis for the logistic formula. This tweak reduces both volatility and the overall return. If you don't mind losing 20% in one day only to gain 22% the day after, then this tweak is not for you.
I'll let the charts speak for themselves.
S&P 500 double long
Mid-cap 400 double long & double short
Russell 2000 indexThis one is almost golden. Small-caps are less predictable. The algorithm outperforms both the bear and the bull versions both with much less volatility.
NASDAQ double long & double short
Oil and Gas sectors double long & double short
Financial sector (regular) long & double short
Basic materials sector double long & double short
Appendix: intermediate debugging printout from RWhile running the simulations I added intermediate debugging printouts to help ensure that what I think I'm doing is really what I'm doing and that I don't future-snoop any data. Here's a sample output from the simulation.
- inv: portion of portfolio that is invested (optimal position) based on the close of the prior day. Adjusting positions is done at the last minutes of trading every day based on the position formula output.
- chg: change (multiplier) during the next day of trading
- pft: profit as portion of full portfolio. Note that ocassionally we have a profit, if we are partially short (inv < 0) and the asset goes down (chg < 1.0)
- bal: balance (total portfolio) where bal=1.0 at t=0 This is the sum of our cash and whatever portion we have invested (or short).
- vsBH: ratio of balance vs a buy-and-hold strategy for the asset (no position adjustment trades).This is just an example. It doesn't represent any of the charts above. As you can see p0=0.25 which is 25% invested at the pivot.R> OPS('DUG', p0=0.25, v=1, min=-e, max=e) etf_data_ma DUG: dim(R(DUG)): [449,6] 2007-02-02: inv=0.2500 chg=1.0104 pft=0.0026 bal=1.0026 vsBH=0.9923 2007-02-05: inv=-0.0895 chg=0.9868 pft=0.0012 bal=1.0038 vsBH=1.0067 2007-02-06: inv=0.6952 chg=1.0000 pft=0.0000 bal=1.0038 vsBH=1.0067 2007-02-07: inv=0.4736 chg=1.0221 pft=0.0105 bal=1.0143 vsBH=0.9952 2007-02-08: inv=-0.3633 chg=0.9834 pft=0.0061 bal=1.0204 vsBH=1.0182 2007-02-09: inv=0.6265 chg=1.0015 pft=0.0009 bal=1.0214 vsBH=1.0176 2007-02-12: inv=0.4106 chg=1.0288 pft=0.0121 bal=1.0334 vsBH=1.0008 2007-02-13: inv=-0.4492 chg=0.9684 pft=0.0146 bal=1.0481 vsBH=1.0481 2007-02-14: inv=0.8568 chg=0.9950 pft=-0.0045 bal=1.0436 vsBH=1.0488 [... many lines omitted ...] 2008-10-28: inv=-0.5068 chg=0.7570 pft=0.2146 bal=1.9577 vsBH=3.1159 2008-10-29: inv=0.0000 chg=0.9709 pft=0.0000 bal=1.9577 vsBH=3.2092 2008-10-30: inv=1.0674 chg=0.9104 pft=-0.1872 bal=1.7705 vsBH=3.1879 2008-10-31: inv=1.1154 chg=0.9747 pft=-0.0499 bal=1.7206 vsBH=3.1784 2008-11-03: inv=0.9534 chg=1.0418 pft=0.0686 bal=1.7893 vsBH=3.1725 2008-11-04: inv=0.3750 chg=0.8927 pft=-0.0720 bal=1.7173 vsBH=3.4107 2008-11-05: inv=0.9802 chg=1.0824 pft=0.1387 bal=1.8560 vsBH=3.4055 2008-11-06: inv=0.1131 chg=1.1126 pft=0.0236 bal=1.8797 vsBH=3.0998 2008-11-07: inv=-0.4619 chg=0.9077 pft=0.0801 bal=1.9598 vsBH=3.5606 2008-11-10: inv=0.5462 chg=0.9841 pft=-0.0170 bal=1.9427 vsBH=3.5867 2008-11-10: DUG: EOD invested=0.513849
Comparing to buy-and-hold: for the period of 2007-02-02 to OP end up with a balance that is over 3.5x higher. This is not a typo, PO is 250% better than buy-and-hold for less than a 2 year period.
What about costs?
In the worst case scenario, every day you make either one sell, or one buy (the amounts vary).
Assuming $10/trade (my broker charges me less, you can usually negotiate these lower if you care enough.) this results in $2520 per year in comissions. For a $100,000 portfolio, this is 2.52%/year in costs. With a lower commission schedule and a higher than $100,000 per position, my costs would be less than 2% per year.
You can further make the ratio smaller by:
Or you can go the other way: trade multiple times a day, It doesn't really matter how often, you just 'rebalance' to the new recommended positions if it seems to be worth it. If the 'rebalancing' earns more than the comission, it is worth it. I found that this approach actually increases returns if you apply it on volatile days where ETFs move up and down several times. Of course, the big downside of this is that it forces you to work much harder. Personally, I cannot afford, nor am I interested in excess activity so this option is a non-starter. In later revisions of the strategy, in fact, me and Adi managed to significantly reduce the activity level that's required, to a level that's much lower and very reasonable.
- Holding less positions at a time: dividing the portfolio into slices and commit money only if OP exceeds a certain value. I found that this "exclusion of the middle" strategy doesn't make a big difference in the end result while keeping me in cash about 20%-60% of the time.
- Having a larger portfolio. A fixed cost out of a larger pie costs less.
Paying 1%-3%/year in commissions seems very reasonable for such out-performance.
Note however that this means it may not be worth it if your overall portfolio balance is less than about $20,000 or so. You may consider doing the rebalancing once a week instead of once a day. At the time of this writing, I haven't simulated this method because excluded-middle seemed good enough and achieved similar goals with likely better results.
Intro Case Pivot Position Simulations
Disclaimer: this should not be considered as investment advice. It is merely describing a very rough and early version of my thoughts. None of the above examples represents what I'm actually doing.
Feedback is welcome.