## Getting Better at Monte Carlo : Distribution Based Simulations of Trading Strategies

Last week I wrote a post about our new Asirikuy Monte Carlo simulator and how it now enabled us to adequately evaluate our systems through the use of this powerful statistical method. Although the initial implementation of the simulator was quite powerful, it neglected to contain a very important feature which would allow us to have even more accurate simulations of our trading strategies. This feature, which deals with the accurate evaluation of the systems through their particular trading distribution, allows us to carry out simulations in which all strategies are appropriately distinguished from each other through a trade-class structure built from the probabilities to have trades with certain outcomes. Through the following post I will talk about this new feature and the whole new world it opens for the accurate evaluation of Asirikuy systems through Monte Carlo Simulations.

The first version of the Asirikuy Monte Carlo simulator included a simple simulation method which carried out Monte Carlo simulations based solely on the simple long term statistical characteristics of a strategy such as the risk to reward ratio, win to loss ratio, etc. The problem with this method was that the simulations for certain systems weren’t accurate as the trade distribution of the strategy was ignored. For example a system that has a 50% winning percentage, a 2% average losing trade and a 2:1 reward to risk ratio would be simulated with all winning trades giving a 4% profit and all losing trades giving a 2% loss. Although this way of simulating strategies works good for almost all strategies – especially those that only take trades based on an SL/TP – it gives quite inaccurate results for some strategies with internal closing mechanisms (and very bad for those with ONLY internal closing mechanisms) as the distribution of trades was ignored.

After an Asirikuy member posted on the forum about the idea of a Monte Carlo distribution based simulation, I decided to implement this feature so that we could have the most possibly accurate simulations of our trading systems within Asirikuy. The new version of the simulator – which will be released this weekend –  now uses a CSV input with the system’s trade distribution to carry out a Monte Carlo simulation using the exact way in which the system took trades.  For example if the system had 3 classes with -1-0%, 0-1% and 1-2% trades with probabilities of 50%, 30% and 20% the program carries out a simulation such that the average distribution of trades through all iterations of the simulation is that of the input distribution, weighting probabilities amongst the classes as specified by the CSV file.

The results are impressive and MUCH better than those of the simple Monte Carlo simulations, allowing us to get an accurate statistical picture of ALL Asirikuy trading systems (including systems such as Ayotl and the God’s Gift ATRwhich were previously difficult to evaluate or evaluated inaccurately on our previous implementation) . The simulator also allow us to see how the distribution of each iteration looks and how it compares to the input distribution using a chi square test. This way you will be able to see how deviated a distribution has to be from the original one to fail a statistical goodness-of-fit chi square test, allowing you to see how powerful this method is for evaluating statistical deviations from the input distribution.

Another great thing here is that coming up with the input distribution will not be any trouble since we have also come up with – through the invaluable help of a very hard working Asirikuy member – with an implementation of our profit and draw down analysis tool which automatically generates this distribution file and loads it into the Monte Carlo simulator which it calls directly with the adequate command prompt parameters. The new version of this tool will also be released this weekend including some very interesting features such as the analysis of monthly return distributions (something I will talk about on a later post with more detail).

### 8 Responses to “Getting Better at Monte Carlo : Distribution Based Simulations of Trading Strategies”

1. andrea says:

Hi Daniel,
the new version of monte carlo simulator is a great thing and i’m very happy about this implementation.
I’ve just finished to watch all your video, and now i’m going to deeply understand your asirikuy sistems (especially aytol and quimichi).
Thank you very much for your work.
Andrea

Hi Andrea,

Thank you very much for your comment :o) I am glad you like this new version of the Monte Carlo simulator, it will definitely allow us to expand our understanding of Asirikuy trading systems and how they work from a statistical point of view. Make sure you watch the videos I will release this week end which will deal with the new features of our draw down analysis tool and the Monte Carlo simulator. I will certainly continue to work on the simulator to add even more features and even potentially link it to the EA analyzer indicator to be able to do more complex statistical analysis of Asirikuy systems on the go. Thank you very much again for your comment :o)

Best Regards,

Daniel

2. Jon says:

Hi Daniel,

Why not, instead of taking an statistical summary of the trade types of the system, use all the historical trades of any particular system and re-order them randomly in n interations?

As opposed to other clasical uses of Monte Carlo analysis, on trading systems we don’t need to generate random trades within a specific profile, we already have these on backtests.

The purpose of using MC on systems is, in my opinion, to simulate a random order in the trades and stress test the consecutive losses/drawdowns risk. For this, I think using the actual backtested trades can offer you even more accuracy, on a simpler approach. My 2 cents..

Hi Jon,

Best Regards,

Daniel

3. Jon says:

Well, I’d never do a 15 year MC with a backtested experience of, for example, just 1 year. I think 1 years experience can be randomized just within that particular year. And if you want to stress test the system on the other 14 years market conditions, you should instead try to backtest it over those years.

On the rest, I thinl I can agree, but let me understand it better: what are your objectives with result sets? are you trying to analyze the pattern of the result outputs or just the P&L?

Thanks,
Jon.

Hello Jon,

Thank you for your comment :o) Definitely you can do this randomization and get some useful results, however the Monte Carlo simulation based on the distribution of returns is more powerful since it also allows you to test deviations from the exact distribution of returns you have seen in backtests, small deviations which might be realistically expected due to differences between testing data (such as broker dependency) therefore worst case values obtained through such simulations yield more statistical value as they cover a much wider probability space. Obviously randomizing trades is one way to stress test systems but I decided to go with the distribution of monthly returns as it is a much more powerful technique.

Our objectives with the results are also very varied. For example we want to analyze P&L loss values (particularly worst case draw downs and draw downs that happen with an X% probability) but we are also interested in the pattern of the results, particularly to see if the random distributions generated within the input distribution fail or past different sets of distribution tests (such as the chi-square goodness-of-fit test) something that will allow us to know whether or not a particular strategy can be discarded by the use of such tests. For some systems these tests work very well while for others the tests do not hold any predictive power due to the structure of their returns distribution. So overall we are interested in both things and for this reason the power of doing this analysis using the distribution data obtained from the backtests (instead of a simple randomization of backtesting data) becomes necessary. I hope this answers your questions :o) Thanks again for your comment,

Best Regards,

Daniel

4. Bruno says:

Hi Daniel and thanks for this post.

I know about Asirikuy since about 1 month now and I really am considering joining, even more after reading quality content like this post.

I would like to know if it is possible (for members or somehow else) to download this Monte Carlo simulator and use it with our own data from the strategies I am using for example?

Also, does the randomizer considers the correlation between different strategies, from the input data provided to the program?

Thanks a lot for your time