Stress Testing Systems Learning About Monte Carlo Simulations
Post on: 16 Март, 2015 No Comment

Trading in the FX market using mechanical trading strategies
Stress Testing Systems. Learning About Monte Carlo Simulations
November 15th, 2010 5 Comments
When we develop automated trading systems geared towards the long term production of capital we are often faced with a very simple and daunting question. How can we ensure that our systems will remain profitable in the long term and how will we know when our systems fail to be profitable. The answers to these questions are not very easy and certainly there is no way in which we can ensure a system will remain profitable since we simply do not know the future. However there are several ways in which we can have an idea when a system stops working, with the most robust one being the application of very long term stress-test simulations to see what the systems worst outcomes might be. Today I am going to introduce you to the world of Monte Carlo simulations, a very powerful method which enables us to get accurate estimates of what the worst possible outcomes of our strategies might be.
The Monte Carlo simulation is a type of forecasting procedure in which a given experiment that depends on a random factor is tested a very large number of times. The easiest way to exemplify the Monte Carlo procedure is to imagine a procedure that has two outcomes with equal probability. Imagine we have a coin toss, 50% chance of getting heads and 50% chance of getting tails. When you toss a coin many times it is obvious that you will not get heads-tails-heads-tails type sequences all the time but sequences involving head-heads-heads-tails or something of that sort may in fact arise. A Monte Carlo simulation simply performs thousands of coin tosses and gives you the expected runs of heads and tails you would expect if you did this in the long term. We can say that Monte Carlo simulations allow us to see the extent to which a given series of individual random probability outcomes may temporarily differ from their long term statistical outcome (which we assume to be certain).
When we evaluate trading systems this means that we will take our systems winning percentage, average profit and average loss and execute a Monte Carlo simulation of about X trades evaluated X times ( for example 100K separate runs of 200 trades). Using this very large number of trades we will be able to know what the worst consecutive losing run and worst draw down of our strategy might be given the statistical randomness of short term results. This gives us some very important information as we now know what the worst behavior of our system might be before it deviates from its true long term statistical characteristics. For example if you have a system which has a predicted 24 maximum consecutive losing run within a Monte Carlo simulation and it eventually reaches 26, then you know that your system has become too risky to be traded because it has started to deviate dramatically from the long term expected Monte Carlo deviations.
Up until now in Asirikuy we have used a double rule to make up our worst case scenarios. For systems that have risk to reward ratios near 1:1 (from about 1:2 to 2:1) the doubling rule aligns pretty well with Monte Carlo simulations as the worst draw down scenario usually corresponds to twice the maximum draw down seen in back-tests. This means that our current approximation is certainly good although Monte Carlo simulations give us additional refinement in this regard. The number of consecutive losing trades is very high in Monte Carlo simulations and indeed a system may take up to 22-25 consecutive losses in the very long term, as shown by these simulations. (above, the results of a 200 trade subset of a 100K-200 trade run Monte Carlo Teycanani EUR/USD simulation are shown (the green line is the peak value for the given trade number while the red one is the lowest peak for that trade number across the 100K runs)).

A very interesting observation comes when you evaluate very skewed systems using this type of simulation. Systems like Megadroid with very high winning rates and bad risk to reward ratios give overall numbers in Monte Carlo of 7-9 consecutive losses across 100 K trades with a very high probability of having at least 4 consecutive losing trades within the first 10K trades and three consecutive losses being almost a certainty every 1K trades. Although such runs are quite infrequent they do happen, showing why as I have said before I keep my stand against using this type of systems as everything points out to the fact that they will wipe your account in the longer term. Since you cannot stop running them before they do (as you only know they stopped working when they wipe your account) these are very unsound all-or-nothing type strategies. Take into account that this assumes that the simulations of these systems are reliable, something very unlikely due to their low take profit targets meaning that wiping scenarios may be even much more common than what is portrayed by the simulations discussed above.
A very important part of Monte Carlo simulations is to ensure that the worst case draw down remains within a small portion of equity such that you can ensure that if a worst case happens you will be able to stop trading the system and move onto other strategies that are still working. In systems with sound trading tactics and controlled risk this is always the case as you can determine the system stopped working regularly just at twice the historical maximum draw down seen in backtests, meaning that you can actually stop and change systems with a very good chunk of your equity still in place. Using a portfolio further increases your chances of doing this as you may be able to change a losing strategy without any hard losses in capital as the other systems which keep working take the account out of the draw down. As the probability of many systems failing at the same time is very small, the chances of just fixing the parts that fail becomes much bigger.
There is a truth we need to understand here: trading systems can and do fail sometimes as market conditions change beyond their ability to adapt. The important thing is that their failures dont imply equity wipe outs enabling us to simply change the systems that have stopped working for new systems that work or for older systems that continue to perform accurately. It is not about having a system that will last forever (since presuming this would be unrealistic) but about having many robust systems with a low probability to fail coupled with a clear criteria that lets us know whenever a strategy starts to under-perform so that we can change it. Monte Carlo simulations allow us to do just that, develop a clear criteria of when a system might fail and what behavior we might expect in the longer term regarding consecutive losing, winning trades, etc.
Next week I will probably do a video for Asirikuy explaining how to run Monte Carlo simulations and what conclusions we can derive from them about our trading systems and their long term profit and draw down characteristics. If you would like to learn more about my work and how you too can use and develop your own likely long term profitable systems based on sound trading tactics please consider joining Asirikuy.com. a website filled with educational videos, trading systems, development and a sound, honest and transparent approach to automated trading in general. I hope you enjoyed this article. o)