Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to modify and retest an ATM strategy

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

    How to modify and retest an ATM strategy

    Here's a trick I'd like to do. I manually entered several orders today using a particular ATM strategy. I would like to see what would have happened today if I had a different trailing stoploss on my strategy. Is there a way I can rerun today's market through the strategy analyzer, where it would find my order entry points, then apply a different stoploss/strategy for that order?

    Thanks!
    Bryan
    cassb
    NinjaTrader Ecosystem Vendor - Logical Forex

    #2
    Hi cassb,

    What you can try instead is to use the Market Replay facility we have available in NinjaTrader. Record the live data and then you can replay it whenever you want. Run as many changes you want.

    Alternatively, you can also try setting up multiple Sim accounts. Each sim account will be linked to a variant of your trailing stop and then you can see how trades are different with your different stops.

    Hope that helps.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      In this same vein -- I have a question about Strategy Analyzer vs. Market Replay.

      In Strategy Analyzer, does it backtest tick by tick, or bar by bar? Because when it places an order with a stoploss, and the stoploss price falls within the bar that the order was placed in, it always stops out the order for a loss even though in realtime it would not have.

      If this cannot be changed, then how do you backtest a strategy as if it were executing in a tick by tick market? Market Replay again in the Strategy Analyzer?
      cassb
      NinjaTrader Ecosystem Vendor - Logical Forex

      Comment


        #4
        Strategy Analyzer is done bar by bar. This is the nature for backtesting. Please see this article about the differences between backtesting and real-time: http://www.ninjatrader-support.com/H...sBacktest.html

        If you wish to backtest with a tick-by-tick logic you will need to use multi time frames with one of them being 1tick. This will take a lot of CPU time and a lot of memory to run on more than a few days of data. Alternatively, you can just forward test using Market Replay since it will mimic being real-time.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by Josh View Post
          Alternatively, you can just forward test using Market Replay since it will mimic being real-time.
          OK, so I recorded market data yesterday and today. I am attempting to play back today's market with my two strategies running. I have selected the strategies and started the market replay. However, it's not placing any of the stop orders that my strategy should be placing, unless I open the strategies window and click the "Apply" or "OK" button. Then it seems to go back and place the stop orders correctly up to that point in time. When I resume the market replay, it will fill those orders correctly, but will not place any new orders until I go back to the strategies window and click "Apply" or "OK" again.

          Why will it not place these orders as the replay is happening in simulated "real-time?"

          Thanks,
          Bryan
          cassb
          NinjaTrader Ecosystem Vendor - Logical Forex

          Comment


            #6
            Any error messages in your Control Center Logs tab?
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              No. Just the "Starting NinjaScript strategy..." message.
              cassb
              NinjaTrader Ecosystem Vendor - Logical Forex

              Comment


                #8
                Add some Print() statements in your strategy to confirm that specific areas of your code is being reached in real-time, also enable TraceOrders property to verify that order methods are being called.
                RayNinjaTrader Customer Service

                Comment


                  #9
                  OK, I added some Print() statements to debug it. It seems that when running in real-time, this function returns 0 for every OnBarUpdate() call. But when I open the Strategies window and click OK or Apply, the process goes back and 'reruns' all of the bars up to the current time and the function does return the correct values. So does this function not work in real-time then?

                  Swing(5).SwingHigh[0]
                  cassb
                  NinjaTrader Ecosystem Vendor - Logical Forex

                  Comment


                    #10
                    According to the Help Guide a zero value is returned under the following conditions.

                    * A return value of 0 (zero) will be returned if the CurrentBar is less than the "strength" value or a swing pivot has not yet been found.
                    RayNinjaTrader Customer Service

                    Comment


                      #11
                      No, this happens throughout the whole replay of the day. It never returns anything but 0 regardless of the number of bars or the Strength setting. I have the Swing indicator also on the chart and it is working fine and showing swing levels.

                      Could this be a bug? Want me to create a strategy with this indicator in it and send it to you?
                      cassb
                      NinjaTrader Ecosystem Vendor - Logical Forex

                      Comment


                        #12
                        - Can you confirm that you are running NT 6.5.1000.1? If not please upgrade and see if the problem still persists.
                        RayNinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by NinjaTrader_Ray View Post
                          - Can you confirm that you are running NT 6.5.1000.1? If not please upgrade and see if the problem still persists.
                          Yes, I am running v6.5.1000.1.
                          cassb
                          NinjaTrader Ecosystem Vendor - Logical Forex

                          Comment


                            #14
                            I tested this on real-time feed and it works as expected. Can you test on real-time (not market replay and see if you get the same result), keep in mind, there must be some amount of historical data on your chart.
                            RayNinjaTrader Customer Service

                            Comment


                              #15
                              OK, I don't have time to do it until next week... but you can try your strategy on Market Replay and see if you get the same result as I did though. Just set it to 500x speed and you'll know pretty quick.

                              Bryan
                              cassb
                              NinjaTrader Ecosystem Vendor - Logical Forex

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by georgeinharmony, Today, 12:06 AM
                              2 responses
                              13 views
                              0 likes
                              Last Post NinjaTrader_Jason  
                              Started by Prisalice, Yesterday, 07:07 AM
                              2 responses
                              16 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by Futurestrader00, Yesterday, 12:04 AM
                              1 response
                              10 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by Blairski, Yesterday, 11:26 PM
                              0 responses
                              10 views
                              0 likes
                              Last Post Blairski  
                              Started by aligator, Yesterday, 02:38 PM
                              0 responses
                              10 views
                              0 likes
                              Last Post aligator  
                              Working...
                              X