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 KevinWalker, Yesterday, 07:48 PM
              1 response
              10 views
              0 likes
              Last Post NinjaTrader_ShawnB  
              Started by Leeroy_Jenkins, Today, 03:00 AM
              0 responses
              9 views
              0 likes
              Last Post Leeroy_Jenkins  
              Started by Prasanna, Today, 02:53 AM
              0 responses
              13 views
              0 likes
              Last Post Prasanna  
              Started by PeterInBrisbane, Today, 01:07 AM
              0 responses
              16 views
              0 likes
              Last Post PeterInBrisbane  
              Started by WaveAtElliot, Yesterday, 05:11 PM
              1 response
              17 views
              1 like
              Last Post hdge4u
              by hdge4u
               
              Working...
              X