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:

Other findings:

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 index

This 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 R

While 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.

Legend:

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
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.

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.

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.

-- ariel