Over the past year, I have been testing different platforms where artificial intelligence or neural networks are used in order to develop and create new Forex trading strategies. Bottom line, I used my super-computer to generate +25,000,000 strategies over the period of 5 days for USDCAD using data from 2015-2020(December). From 25M strategies, I narrowed it down to top 10 strategies, which I am giving away for free.
Approx. reading time: 10 min.
In the Summer of 2019, I decided to upgrade my computer and build a powerhouse meant for heavier/intensive CPU hungry applications. Thanks to my background in Electrical Engineering, I built a nice setup with parts coming mostly from China, using Chinese manufacturers. Yes, it is very uncommon to do so because most buy their computers at computer stores or they build them using respected branded hardware.
I bought 2 Intel XEON-8 Cores CPUs meant for servers/workstations. These processors have a unique feature which enables them to combine their resources and make it a fully working 16-core processor. Since these are processors taken from servers for newer generations(~4-5 years cycle), you can grab them for 40-60$. Dirt cheap, considering newer model cost ~1500-2000$.
I needed to find a motherboard with dual-cpu support. Only China have those and for good reasons. These guys are top quality when it comes to reverse engineering electronics. They have a distinct set of skills and knowledge for this kind of work which you don’t see in North America nor Europe. You won’t see a branded retail hardware company build dual-cpu motherboards in North America.
Then I needed some RAM to compliment it. There’s a hidden gem when it comes to memory, they are very expensive. If you follow the marketing gimmicks, something like 80$ for 16GB RAM.
There are different kind of RAM memory type, but they all perform about exactly the same. You can check for yourself online, by looking at benchmarks from memory sticks costing 50$ to 150$, not much difference.
Memory for servers is even cheaper, you can get refurbished for very cheap, 32GB RAM for 50$. That’s a steal.
The whole thing runs on a virtual machine using 12 cores out of 16 and 4GB RAM to support it. This gives more than enough power to process CPU hungry applications. I initially bought 32GB of RAM because I thought it would use the memory extensively since it endlessly stores data. Not sure if it is my custom settings, but I made it run for 5 days, using 4GB or less.
By running it on a virtual machine, you are shielding its operations from any possible incidents thus making it safer for applications which needs to run literally forever. I use VirtualBox to create this environment. It’s free, widely known and used in the IT world.
The software I am using is called StrategyQuant X. It uses several indicators and “building blocks” such as operators. You can generate strategies based on predefined indicators and settings so the software will only work on those and improve the settings through several iterations.
You can also build strategies based on indicators with different period ranges. Different data blocks for different types of orders. You also get to choose which Entry/Exit order types you want, including, target profit, trailing stop, breakeven, etc.
One of the most important feature is the ability to randomize data and do cross-currency testing. Meaning that you can tell the program to run strategies on the main currencies and it will also run it in parallel with another currency. The “idea” behind is to create a universal mechanical strategy which can perform on multiple currencies using same settings.
Here I am using 4 different data sets within a 5 year period in order to test the robustness of the strategies. This is very different from the traditional backtesting method used in Strategy Tester in MetraTrader4 where you cannot modify or randomize the data. With StrategyQuant, you can customize as you wish your data set.
The Ranking section allows us to control how we will treat strategies that have passed all filtering conditions. You can add as many conditions as you want but this will also slow down the amount of strategies you can generate per hour as it will need to go through many checks.
Once you have your conditions set, you can then set the weighting value of each condition. This is very useful when you are testing millions of strategies per day, you need a system to filter through all this so you can only keep the best options and then filter through them as well.
There is also another section dedicated entirely to testing the robustness of a strategy. I personally do not use them. I rather use my CPU power to generate millions of random strategies than wasting resources trying to cross-check. First option generates more opportunities.
Using my own custom settings, I ran the software for 5 days on the USDCAD for the period of 2015-2020 under the H1 timeframe. Ended up generating over 25,000,000 strategies.
I set the software to store the top 1000 strategies generated and to endlessly run. This way, if new strategies come up, they will automatically be updated in the ranking system and old strategies will be discarded.
I am using these filtering conditions. I think they are the basic minimum requirements for any strategies. Mind you, these are only for the first pass to generate millions of strategies. Once we have enough, we will go through a second round of filtering.
We now have 1000 strategies saved that needs to be looked at for a round 2. If you have done your weighting properly, this exercises is almost intuitive. Let the ranking system show you the best strategies, using the Fitness filter.
I personally choose strategies with high Symmetry values and low Drawdown values. Symmetry indicates if Buy/Sell orders uses the sames conditions. The higher the number, the more Buy/Sell orders are executed the same way. Drawdown value is self-explanatory, you want the lowest risk possible. The reason behind is simple, this is automated trading, you can’t let algorithms take too much risk. Plus, because we didn’t actually worked to get these strategies, you can just build more across different currency pairs and build a global portfolio, which is much better in terms of stability and returns than running algorithms on a single currency.
Here is an example of a strategy generated through AI. You can see how the algorithms perform when using the normal data sample and also randomized sample(Out Of Sample) throughout 2015 to 2020. You can choose different options on your X and Y axis
Top 10 Strategies + Download Link
There you go, this is how you create strategies using historical data and artificial intelligence.
It is a puzzle, the learning curve is not too bad if you already have been trading forex and understand how to build strategies. You will probably have to play around for a few days until you build your own templates.