Zen monte carlo simulator


Monday, June 8, 2009


TESTING TRADING SYSTEM USING MONTE CARLO SIMULATIONS




Last year we had an article about building a trading system. We designed a simple moving average crossover system where we did some basic backtesting. We will now start a series of articles covering Monte Carlo testing of trading systems to help us further support our trading system testing. Today we will take a closer look at the trading system we designed earlier and do a basic Monte Carlo analysis to see if our decision about not trading the system in real time was correct or not. Later we might also look at how we could improve the system further by looking av walk forward analysis and optimization. The software we use for the Monte Carlo analysis is "Zen Monte Carlo Simulator V5.01e" made by Volker Butzlaff.


Fig.1. OSEBX and equity curve along with buy- and sell- arrows. A green buy arrow occurs when there is a 5 day- and a 25 day- moving average crossover and vice verse when there is a red sell arrow.

Here we can see the OSEBX chart and an equity curve of how the system performs with the buy and sell signals. Starting capital for this single backtest was 100000 NOK. From the chart we can immediately see that the system performs quite well this is partly because the test data is mostly trending. Where the market is moving sideways we see that the system performs poorer. But again it looks not too bad.


                          Fig.2. Backtesting results of the MA Crossover trading system.

The backtesting results that you can see in the figure shows that 34 trades was executed where 16 were winners while 18 were losers. Average profit for the winners were 27292.32 NOK while average loss for the losers were -12456.37 NOK. Max drawdown was -129035.42  NOK (there should ring a bell already here about this trading system). The backtesting data is then fed into "Zen Monte Carlo" for further analysis (Fig.3).



Fig.3. Input data window for Zen Monte Carlo Simulator.


This gives us a trade ratio (TR) of 47% (47% winners), Payoff ratio (PR) of 2.19 (119% higher average win than loss) and finally a Profitability index (PX) of 1.95 (higher number the better and good indication when comparing scenarios and different trading systems).The other numbers put in here is dealing with units, the simulation period and number of simulations to be run (our test period will be run 100000 times. Running the simulation we get our results (Fig.4).



Fig.4. Monte Carlo simulation results.


So what do this tell us? Minimum profit for a year is -37789 NOK, maximum profit for a year is 98492 NOK while average profit for a year is 30388 NOK (remember that we start out with an equity of 100000 NOK). This might not look too bad at a first glance but we also need to take a closer look at the risk of the system. Minimum drawdown for a year is 27292 NOK, maximum drawdown is -264522 NOK(!!!!) and average drawdown is -16185 NOK. We can already say that this trading system is way too risky to trade. If we are really unlucky we would need a trading account of (margin (100000 NOK) + max drawdown (264522 NOK)) 364522 NOK to lose possible -37789 NOK (worst case) in a single year. In our opinion this is a very good reason not to trade this system. This is also confirmed by the ACR and WCR ratios. The results from our simulation can also be viewed graphically (Fig.5).



           Fig.5. Graphical display of Monte Carlo simulation.


How do the results from the Monte Carlo simulation coincide with the backtesting results?
Average yearly profit from backtesting showed a result of (212462.46 / 7 (net profit/years backtested) 30351.77 NOK compared to the Monte Carlo simulated profit of 30388 NOK. The biggest difference between the backtesting and the Monte Carlo simulation do we see by looking at the max drawdown. Bactesting suggested a max system drawdown of -129035.42 NOK while the Monte Carlo simulation showed max drawdown of -264522 NOK (Fig.4 & Fig.6).



                                  Fig.6. Drawdown results from backtesting.


Later we will see if we can improve the system by optimizing the parameters in use and possibly also modify the trading system. We will also look into how the system perform under different market settings by running Monte Carlo simulations on synthetic simulated data. If you have any comments, suggestions or questions please contact us at (contact@stocktradersbulletin.com). We are happy to receive suggestions for improving the trading system.

If you would like to check out the Monte Carlo simulation software used you can find it here:
http://www.zentrader.de

Happy trading!

SB


comments (0)



1 - 1 of 1

RSS  


Articles


Stocktradersbulletin take a closer look at trading strategies, trading systems, the market in general and other relevant topics



TAGS




RECENT POSTS



Testing trading system using Monte Carlo simulations 


Optimization and Monte Carlo Simulation of Trading Systems 


S&P500 the past and the present 


Building a trading system 




ARCHIVE



september 2010


june 2009


may 2009


october 2008





TOPICS



TRADING SYSTEMS (3)


TRADING STRATEGIES (0)


MARKET COMMENTS (0)


OTHER (0)


MARKET OVERVIEW (1)



admin*









Today's chess puzzle