MVS with Adaptive Batch Exit and Adaptive CTS

Post anything related to mechanical systems and automated trading here.
Post Reply
hjelmstade
Posts: 34
Joined: Wed May 18, 2016 6:51 pm
Contact:

MVS with Adaptive Batch Exit and Adaptive CTS

Post by hjelmstade » Sat Dec 24, 2016 9:27 pm

Hi all,

I've been meaning to share this for a while but just now found the time to create the documentation and fully comment the code.

First, a big thank you to Earik for allowing me to share. Half of this code is his IP from his Mechanical Trading Systems book so it is very generous of him to allow me to share with the entire Wave59 community that may not have purchased his MTS book yet. If you haven't and you like what you see here, it is definitely a good idea to purchase so you can understand his sub-systems and the ideas I used to improve what he provides in the book. I probably would have floundered around for 10 years before I managed to build a system like this without the starting point he provides in his book so it was worth every penny and I expect this system to pay off his book very soon.

Everything is optimized to trade on an ES Daily chart. For all backtesting results, I am using IQFeed data for the ES continuous contract (@ES#C). All of the backtesting results attached are using the default settings, starting with a $125k account and with a contract cap of 5. Dynamic position sizing is enabled by default so you need to set the contract cap to the most contracts you are comfortable allowing the system to trade as this will override dynamic position sizing as your account grows.

The documentation file I attached as well as the comments in the code describe the strategy of the system as well as the additional sub-systems I created more in depth so please review everything before you use.

Lastly, even with the starting point Earik provided, this took me several hundred hours to complete. My only request is if you make any improvements, find any bugs or have any ideas for anything to add, please share so we can all benefit.

Also, for the sake of full disclosure, I am using this system live but still only with one contract. I plan on increasing the contract cap so it can fully utilize the batch exit system over the next six months.

Here is the code for backtesting: http://www.wave59.com/library/scriptdetail.asp?id=177

Here is the code for the live trading: http://www.wave59.com/library/scriptdetail.asp?id=178

Please note the following two points for the live version.

1. You need all of the SystemF functions in the backtesting version in order to run the live version as they share the same functions. This also means if you are experimenting with the backtesting version, make sure to create copies of these files.

2. You do need to create a folder named "trading_system_logs_and_settings" in the Wave59 directory in order for it to run. It uses this folder to store the log and position sizing text files.

Every descriptive name I created for this system was causing headaches when trying to select the correct file to load as the long name would run off the list so going forward I'll be using code names for most of my systems. This one I have named Livermore.

Thanks!
hjelmstade
Attachments
ES_Daily_Livermore_Documentation.pdf
(376.07 KiB) Downloaded 726 times
ES_Daily_Livermore_12-19-16_Summary.PNG
ES_Daily_Livermore_12-19-16_Summary.PNG (34.32 KiB) Viewed 21114 times
ES_Daily_Livermore_12-19-16_Equity_Small.PNG
ES_Daily_Livermore_12-19-16_Equity_Small.PNG (29.35 KiB) Viewed 21114 times
ES_Daily_Livermore_12-19-16_Annual.PNG
ES_Daily_Livermore_12-19-16_Annual.PNG (33.12 KiB) Viewed 21114 times
ES_Daily_Livermore_12-19-16_Monthly.PNG
ES_Daily_Livermore_12-19-16_Monthly.PNG (54.53 KiB) Viewed 21114 times
Last edited by hjelmstade on Wed Dec 28, 2016 1:15 am, edited 3 times in total.

hjelmstade
Posts: 34
Joined: Wed May 18, 2016 6:51 pm
Contact:

Re: MVS with Adaptive Batch Exit and Adaptive CTS

Post by hjelmstade » Sat Dec 24, 2016 10:15 pm

Hi Earik,

I have two questions.

1. Is there anyway you can enable PDF uploads to forum posts so I can upload a PDF of the documentation rather than a google drive link? Right now it says the extension is not allowed.

2. I kept having issues uploading the live version of the code to the qscript library as I was receiving an Upload Error every time I tried. I finally just tried uploading the indicator files and not the functions and got it to work. Can you confirm that this is due to both the backtesting and live versions sharing the same functions?

I did not see the point in having copies of all the functions for the live version as I always make copies whenever I make changes but if this will be a problem going forward, I can change my process.

Thanks!

User avatar
earik
Site Admin
Posts: 474
Joined: Mon Dec 01, 2014 12:41 pm
Contact:

Re: MVS with Adaptive Batch Exit and Adaptive CTS

Post by earik » Sun Dec 25, 2016 8:07 pm

Hi hjelmstade,

You should be able to upload PDFs now. I didn't realize they were being blocked. This forum has way too many settings... :?

Not sure what was going on with the library. You should be able to share functions between various uploads - the server doesn't do any double-checking, etc. It may have been an issue with a flood-control setting (so the library can't be spammed), so it might have just been necessary to wait a minute before uploading a second time. Not totally sure. Let me know if it happens again.

Thanks for sharing all these systems! :D

Regards,

Earik

spancham
Posts: 3
Joined: Tue Feb 28, 2017 3:02 am
Contact:

Re: MVS with Adaptive Batch Exit and Adaptive CTS

Post by spancham » Tue Apr 04, 2017 12:20 am

Hi hjelmstade,
I recently bought and read through Earik's MTS book, and was browsing the forum and came across your trading system.
Thanks for uploading your system, I downloaded your back test script and was able to run it.
Your trading system performs amazingly well during the credit crisis years. That's phenomenal!

How has it been working for you? I think I'll try trading it but manually at first with just one contract of course.
Thanks again. Will let you know how it goes.

Sheikh

hjelmstade
Posts: 34
Joined: Wed May 18, 2016 6:51 pm
Contact:

Re: MVS with Adaptive Batch Exit and Adaptive CTS

Post by hjelmstade » Sat Jun 17, 2017 5:12 am

Hi Sheikh,

Sorry, I didn't respond earlier. Life got busy and I wasn't able to check the forums for a while.

To answer your question, yes, I'm still running this same system. I've tried adding improvements but still have not come up with anything better.

Below is an update. As I finished the system in December, we can consider the last 6 months to be out of sample data. It has been profitable 4 out of the last 6 months and although it had a rough month in March, it has now recovered and is up for the year.

Just a note though, you need to run the system with at least 5 base contracts (I recommend $25k per contract so a $125k account) in order to take advantage of the batch exits and win/loss streak contract size adjustments which really help to smooth out the equity curve. If you don't, it will not perform as well.
ES_Daily_Livermore_update_6-16-17.png
ES_Daily_Livermore_update_6-16-17.png (43 KiB) Viewed 20888 times

hjelmstade
Posts: 34
Joined: Wed May 18, 2016 6:51 pm
Contact:

Re: MVS with Adaptive Batch Exit and Adaptive CTS

Post by hjelmstade » Sun Feb 25, 2018 8:17 pm

Just in case anyone stumbles across this in the future and decides to give this system a go.... don't.

I turned it off after letting it run for 6 months on my live account. It did nothing but lose money. I'm pretty sure I over optimized and overall made it far too complicated.

I have since built a new system using a modified version of Earik's Lunar system and am running that instead. It is much much simpler (it is not a MVS) and so far is having a killer year in 2018.

So, lesson learned here is keep things simple :)

sbank
Posts: 174
Joined: Tue Jul 21, 2015 9:35 pm
Contact:

Re: MVS with Adaptive Batch Exit and Adaptive CTS

Post by sbank » Tue Feb 27, 2018 3:16 pm

Thanks for sharing. And updating us.

I agree that simplicity it key. About 5 years ago I had a complex system that was composed of around 7 other systems. One or two of the systems would give me incorrect results....sometimes. I ended up writing scripts to take screenshots before and after, daily plus enabled a whole bunch of debug messages in the script log to track down what it was. I never did find the culprit and just scrapped that whole system.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests