Hi all,
I've been working on a modified version of the Buttonwood system for a couple months now and finally have something I am happy with. You can find the backtesting code for my version here:
http://www.wave59.com/library/scriptdetail.asp?id=181
You will see I did a little refactoring on some of the original code so its in a similar format to the Livermore system I created.
Before we get into exactly what I changed, lets review how v7 of Buttonwood has fared over the last year. These results are using the default settings for v7 on an @ES#C chart from 10/1/12 to 1/10/17 with all holidays and half-days excluded. I started the chart from 10/1/12 as I first began my own version in 10/16 and wanted four years of history and have just been expanding the chart as time went on.
- es_5m_buttonwood_original_summary.PNG (42.63 KiB) Viewed 32951 times
- es_5m_buttonwood_original_equity_small.PNG (46.38 KiB) Viewed 32951 times
So as you can see, it did not perform as well during the volatility we saw in 2016 and the average trade value has dropped by half.
This is the final result of my implementation on the same chart which has a profit per unit of risk score of 20.1 trading a base contract size of 2 like in v7 (before equity curve adjustment).
- es_5m_buttonwood_2cts_summary.PNG (51.29 KiB) Viewed 32951 times
- es_5m_buttonwood_2cts_equity_small.PNG (45.96 KiB) Viewed 32951 times
- es_5m_buttonwood_2cts_annual.PNG (43.21 KiB) Viewed 32951 times
While I did create some versions with a higher average trade value, they all had a lower profit per unit of risk score and a less smooth equity curve so I believe what I have now offers a better balance and hopefully will not degrade as quickly.
So this is what I did.
First, I re-optimized the existing Fast/Slow SMA sub-system to use lengths of 12 by 48 instead of 12 by 46 as it looks like the ideal values changed in 2016. I tried implementing an adaptive version to avoid some of this degradation going forward but nothing I tried showed improvement over the static values.
However, for the Channel Breakout, I was able to implement an adaptive version that did improve the system. Rather than using a static value of 7, it now adapts over a lookback period of 100 between AMA lengths of 2 to 7, incrementing by 1.
I then set about trying to add additional sub-systems to improve the merged signal and believe me, I tried a lot. My custom momentum divergence system, bollinger bands system, variations of systems included in my daily Livermore system and so many others never made the final list. While some of them did show some improvements, it always came with its drawbacks and when I would do an optimization run that would determine the best combination of sub-systems, the two systems above and only the two systems below ever made the list. I do plan to come back to try to experiment with more but I'm happy with what I have now.
The first additional system I added is a genetic program originally created on an 8m @ES#C chart that uses TSI and USM, both with a length of 10. It just so happens it works well on a 5m chart as well.
The last system I added just resulted in slight improvements. A while back I discovered that using ExBars with higher inputs actually indicated trend continuation so in this case I am using it as an inverse signal. If ExBars2 with an input of 11 gives a red (bearish) ExBar, it triggers a +1 signal.
I was becoming frustrated that I could not find settings for my momentum divergence sub-system that improved Buttonwood as it kept giving such great signals on a 5m chart. It then dawned on me that if I couldn't use it as an entry system, maybe I could use it as an exit system. Buttonwood will now reverse/exit on a signal change or if momentum divergence is detected. However, there is a points of profit threshold that must be reached before it will exit, otherwise I found it exits some positions way too early and decreases the average trade value in the long run. If you disable the momentum divergence exit system, you will see it does not add very much profit but what it does do is decrease the max draw down significantly which means you can trade more contracts for your account size.
Next, I implemented catastrophe ATR stops. As expected, whenever the ATR stop was hit, it decreased overall performance so a large multiplier of 20 is used as the largest multiplier that was hit over the last four years was in the low teens so this way we have some leeway.
Then I tweaked the equity curve filter. Originally, Buttonwood would decrease contract size by half after two or more wins and would increase by half after two or more losses. I tried many different equity curve filters and eventually found that if we start with a base contract size of two like the original, we can increase contract size by half after one loss and then double contract size after two or more losses without affecting the max draw down. My implementation does not decrease contract size after successive wins so is a little riskier than the original but greatly increases profit without affecting MDD.
Lastly, I re-optimized the astro filters. I'll be honest, I still have a lot to learn when it comes to the astro tools in Wave59 so I only optimized the orb and threshold values. I found the ideal threshold values are still the same from a year ago and that the orb values have barely changed at all. I now have the progressed_orb set at 0.95 instead of 1 and spherical orb set to 9 instead of 8. I did not try optimizing the correction or index values.
Considering how little the inputs for the astro filters have changed in a year, I believe this filter is extremely stable and will work great on future systems as well.
The comments in the code go into a little more detail on everything, including the inputs, but let me know if you have any questions. Below are what I believe will need to be re-optimized in the future. I plan to track the average trade value on a rolling four year chart and re-optimizing everything whenever the average trade value drops below $50. I'm taking my live implementation of this version online tomorrow as its been performing as expected on my paper account.
First as we are using static values for Fast/Slow SMA's, these will change.
fast_avg
slow_avg
Then the momentum divergence exit system will need to be optimized again if it begins to miss obvious exits.
mom_len_long
min_mom_div_dist_long
mom_div_point_thresh_long
mom_len_short
min_mom_div_dist_short
mom_div_point_thresh_short
Then lastly, the following may need to be optimized again but from what I can tell they will only change slightly.
progressed_orb
spherical_orb
Other than that, it is possible the genetic system degrades and needs to be removed but that is easy to test for as you can set s3_enabled to false to see if it would have performed better over a certain time period.
If anyone can think of additional sub-systems, exit systems, etc. they want to add, please let me know and I'm happy to help. While I consider this to be usable now, I'm sure we can make it better
I haven't tried adapting Buttonwood to another time frame yet but will also try this when I have time.
I have a couple more comparison charts I'll share in the next post.