Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Monte Carlo Simulation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Monte Carlo Simulation

    I took my best daytrading strategy, which has a total of 1600 trades and ran it with the Monte Carlo simulation. I have read all the forum comments and they make sense. I also read the NT links and Wikipedia etc. They all make perfect sense.

    There is one aspect that troubles me with the graphs I get from NT. They look way too good. My strategy is good, but its not perfect! It has a draw-down history of $5000. It has a net equity gain of $57,000 over 3 years of daytrades including commissions and slippage.

    Now this is a commercial level strategy which I actually intend to lease to clients, so it is hedge-fund quality. But the Monte Carlo simulation says that it has almost a zero percent chance of going negative. That does not seem right to me. If there is the possibility of $5000 draw-down, then there is some probability that I could start trading the system and immediately get into the $5000 draw-down.

    The only way I can envision this making sense is if the averaging of simulations simply averages out the draw-down case. This is still hard to imagine, but I guess it would have to be the effect of "diversification."

    The other thing I expected to get out of this simulation was the ability to determine how often I can increase my contract size. I don't see how I can determine that from this graph?

    #2
    I think I just answered my own question. If you select "Draw-down" in the Monte Carlo simulation then it gives the probability curve for worst case draw-down. In this case it told me that there was a 96% chance that my strategy would always result in a draw-down less than $10,000 while at the same time having a 96% change of a profit of $84,000. Now that makes total sense. The possible draw-down is potentially worse than the historical draw-down, as it should. The possible net gain is potentially better than the historical net gain, as it should. Let me know if I missed anything.

    Comment


      #3
      Glad to hear you got it figured out. Thanks for letting us know.

      Comment


        #4
        Not sure how often this thread gets looked at but having just started using NT's Monte Carlo Simulation it appeared near the top of a Google search.

        In any event a couple of caveats come to mind (and please correct if it looks like I'm missing something) in case the reader is not already well aware of them; namely,

        1. session definition is vital to the actual performance of the strategy (bot), since the behaviour of any indicators used by the bot in back- and forward testing varies with session definition (i.e., data outside defined session hours is not used to determine indicator values). The upshot of this is there is apparently no way in NT to back- or forward test a bot intended to be run on a session that is a subset of the indicator data domain. In other words, it does not appear meaningful to test a bot with e.g. 24/5 currency futures over multiple sessions with indicators calculated from the 24/5 data domain, if the trading session is also not 24/5 (i.e., instead restricted to the overlap between European and N American markets, say). In such a case one can however forward test by turning the bot on and off manually at the start and end of each session. That said, it is not an issue if one is aware of (and perhaps depending upon) the fact that in real life the indicators (and hence the bot) will react vigorously to any price gap between start of session and end of last session.

        2. the probability curve displayed is a cumulative probability, so that for indicated probabilities over 50% the probability of the associated value occurring is actually 100 minus the indicated probability. E.g., the probability of a an $84,000 cumulative profit with 96% cumulative probability occurring is 100 - 96 = 4%.

        ETA: by the way, it's been my experience with bots that if there is any chance of a worst case scenario occurring, it will, seemingly often enough near the outset when the account is most vulnerable, a perception that likely stems from the fact it's game over if we blow out the account. I've learned therefore to limit quantities so that the account is able to absorb the worst case draw down and still function from the get-go.
        Last edited by bnichols; 08-20-2012, 07:13 AM.

        Comment


          #5
          Originally posted by bnichols View Post
          Not sure how often this thread gets looked at but having just started using NT's Monte Carlo Simulation it appeared near the top of a Google search.

          In any event a couple of caveats come to mind (and please correct if it looks like I'm missing something) in case the reader is not already well aware of them; namely,

          1. session definition is vital to the actual performance of the strategy (bot), since the...
          Not sure this is related or that I followed your point, but I verify the session against my own strategy configuration file. After having the wrong session and the right strategy a few times, I learned to not rely on what I have in the NT window but in my external file. So I disable the strategy and print to the output window if my session is wrong for my strategy.

          Originally posted by bnichols View Post
          ... it's been my experience with bots that if there is any chance of a worst case scenario occurring, it will, seemingly often enough near the outset when the account is most vulnerable, a perception that likely stems from the fact it's game over if we blow out the account. I've learned therefore to limit quantities so that the account is able to absorb the worst case draw down and still function from the get-go.
          I have tested many approaches. I use either 3X max draw for starting account size, or else 2X max draw plus capital requirement to trade one contract. If the ES is $5,000 min and my max draw is $6,000, then I start with $17,000. The more conservative is 3X max draw = $18,000. Note that this does not protect you from a failing/broken strategy. But you should never see 2x max draw (at least very low probability in Monte Carlo sim), so this ensures that case. I have even considered 4X max draw as the most paranoid method. When I don't fully trust a strategy or wondered if it was curve fit I'll use this.

          There is a whole other analysis to determine when to add contracts. This is usually 2x max draw (times total contracts) in new gains achieved, then add one contract. 1x (or 1.5x) max draw in drawdown (times total contracts), drop a contract. This creates a ratchet effect, where you drop potentially all the way back down to one contract while preserving 50% of your historical gains (worst case scenario).

          Comment


            #6
            So, Monte Carlo analyzes only one trade or all trades before I click in "Trades" tab?

            Comment


              #7
              alexstox, MonteCarlo simulation is about randomizing the sequence of your strategy trades (so doing that on one trade would not be meaningful), so per default the complete trades amount is used, however you could change this in the settings.

              BertrandNinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_Bertrand View Post
                alexstox, MonteCarlo simulation is about randomizing the sequence of your strategy trades (so doing that on one trade would not be meaningful), so per default the complete trades amount is used, however you could change this in the settings.

                https://www.ninjatrader.com/support/...o_simulati.htm
                Dear Bertrand, I have run backtest, than chose "Trades". And MCS showed different results when I right click on one of trade than on other in "Trades" list. That's why I thought is it because MCS uses from first trade to what I chose.

                Comment


                  #9
                  I would expect that, as a MonteCarlo run means you randomize the sequence of your trades. That in itself will mean you can't exactly reproduce each 'run'.
                  BertrandNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Shansen, 08-30-2019, 10:18 PM
                  24 responses
                  938 views
                  0 likes
                  Last Post spwizard  
                  Started by Max238, Today, 01:28 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post Max238
                  by Max238
                   
                  Started by rocketman7, Today, 01:00 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post rocketman7  
                  Started by wzgy0920, 04-20-2024, 06:09 PM
                  2 responses
                  27 views
                  0 likes
                  Last Post wzgy0920  
                  Started by wzgy0920, 02-22-2024, 01:11 AM
                  5 responses
                  32 views
                  0 likes
                  Last Post wzgy0920  
                  Working...
                  X