Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is there no way to backtest with OnMarketData() ?

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

    Is there no way to backtest with OnMarketData() ?

    It seems the docs say that this won't fire on historical data for backtesting. Doesn't that sort of making difficult to test a strategy that uses this granular level of tick data? Am I missing something on how to go about this?

    Thanks.

    #2
    OnMarketData() will not be useful in backtesting. To go on tick granularity you need to forward test with Market Replay or simulation live.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by Josh View Post
      OnMarketData() will not be useful in backtesting. To go on tick granularity you need to forward test with Market Replay or simulation live.
      I don't understand. What method do I want to override in this case? Also I am using data that I recorded with my test MB Trading account. So what is the difference between backtesting and forward testing with Market Replay? Is that not the same thing?

      Comment


        #4
        Backtesting is not the same as forward testing. Forward testing with Market Replay allows you to most accurately simulate the data as it would come in if it were live. Backtesting just takes a set of data and calculates based on already predisposed OHLC values. In realtime you would never know the HLC of a bar while the bar is in progress.

        You use whatever method you want. You just don't run Strategy Analyzer. You run Market Replay or run it live if you want OnMarketData() to work. If backtesting is what you want. You cannot get tick granularity. That is just not what backtesting does unless you want to add a 1tick series to your strategy, but even then it will not simulate it as well as a Market Replay does.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by Josh View Post
          Backtesting is not the same as forward testing. Forward testing with Market Replay allows you to most accurately simulate the data as it would come in if it were live. Backtesting just takes a set of data and calculates based on already predisposed OHLC values. In realtime you would never know the HLC of a bar while the bar is in progress.

          You use whatever method you want. You just don't run Strategy Analyzer. You run Market Replay or run it live if you want OnMarketData() to work. If backtesting is what you want. You cannot get tick granularity. That is just not what backtesting does unless you want to add a 1tick series to your strategy, but even then it will not simulate it as well as a Market Replay does.
          So when I open up a new chart and format the data range to go back 2 days, and I have market data recording, what is that? Market replay or backtesting? I guess I am not clear because I am not specifically telling it to do either.

          Comment


            #6
            Market Replay is its own thing. If you open a chart and it populates with old data that is backtesting. Market Replay is an actual replay of the market as recorded by NinjaTrader. You can access your Market Replay as a connection. Just like how you would connect to your brokerage/data provider accounts.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Thanks Josh as always, very helpful. Can't believe I missed that, that explains why the timestamps on each data item are the same when I do a backtest

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Jema1, Today, 12:23 AM
              3 responses
              14 views
              0 likes
              Last Post s.kinra
              by s.kinra
               
              Started by PlunketaLuca, Today, 03:43 AM
              0 responses
              3 views
              0 likes
              Last Post PlunketaLuca  
              Started by elliot5, Today, 03:09 AM
              0 responses
              2 views
              0 likes
              Last Post elliot5
              by elliot5
               
              Started by soon123, Today, 12:51 AM
              1 response
              2 views
              0 likes
              Last Post s.kinra
              by s.kinra
               
              Started by soon123, Yesterday, 11:14 PM
              0 responses
              4 views
              0 likes
              Last Post soon123
              by soon123
               
              Working...
              X