MVS with Adaptive Batch Exit and Adaptive CTS
Posted: 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
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