MonteCarlo - am i doing this right ?

Discussion in 'Strategy Development' started by imgunn, Sep 7, 2009.

  1. imgunn



    i have a VERY basic understanding of statistics and MonteCarlo simulation.

    So i am working on creating my own (MonteCarlo simulation) to try and get a better understanding of things.

    Lets say i use a trend following system as an example

    i look at the historical performance test and find it has 30% wins..

    i then categorize the size of the historical wins

    for example
    10% of all wins might be +10
    20% might be +5
    30% might be +2
    40% might be +1

    i am randomizing the wins (30% win) and if its a winner i then randomize the win percent (say 10%) and pay accordingly (+10)..

    my historical test my have 200 trades, so i run the above simulation 200 times... to get the performance of one instance.

    then i run it to get another 10,000 instances...

    am i on the right track ?
  2. Not sure, but I am planning to do mine different:

    * Load a list of all trades.
    * Possibly filter them - this is mostly a "date range" thing, allows one to compare last 2 months vs. the 2 months before".
    * Depending on how you handle them, you may need to normalize them. THis is your risk management. Some trades may for example have bigger/smaller size due to prior losses or wins, and naturally you want to have a "neutral" trade representation.
    * You then draw them randomly, and apply them. Repply risk assessment as you would normally (i.e. if you awlays risk2% of capital, you change the trade to do that too).
    * Do that X times....

    There you go ;)

    The risk management / neutralization part is important. If I always risk 2% of my account, and during my trading i made 100% profit, the lat trades will be twice as heave as the first ones, so I need to:
    * Pull them all down to a "normalized size" (risk 100 USD Per trade)
    * THEN readjust them to the correct size for their position in the random sequence (i.e. based on the current account value in the simulation).
  3. I believe you will find that for what you call "one instance" you will see +180 minus whatever you are losing in the other 70% of trades that aren't winners. (+180 is from 200*0.3*(0.1*10+0.2*5+0.3*2+0.4*1))

    Without getting too into this, Monte Carlo in your use is going to return what you have put into it. You inputted the type of randomization, and all the % of wins and PL, running it 10,000 times will just make the results run towards the percentages you entered.
  4. ...if you want to "stress test" your system you need only a few results from your historical systemtests like

    - number of price bars
    - number of trades
    - number of winning trades
    - number of losing trades
    - average profit of a (winning) trade
    - average loss of a(losing) trade

    You can program that e.g. in Excel VBA or something else or use a (faster) professional solution.

    Here is an example of a mcs for trading system on a website of a client of my monte carlo simulation software: