Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Walk Forward vs. Market Replay Discrepencies

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

    Walk Forward vs. Market Replay Discrepencies

    I have a strategy where I look back two bars for a setup, then look at the last bar for the trigger. When running Market Replay, it works according to code.

    But when I run a backtest/walk forward, it skips by one bar forward. So in other words, it's looking three bars back for the setup, and two bars back for the trigger.

    My strategy is based off of COBC = false.

    Something is off here though, so please let me know what you need me to do next. If you need me to post the strategy, I will do so in private but not publicly. I will also send you a screenshot as well if you need me to.

    #2
    trend747,

    COBC=false has no bearing in a backtest and is a real-time only setting. In a backtest you can only process each bar at the close of the bar. Once you process at the end of the bar any order actions you may want to attempt can only be achieved at the next tradeable location which is the opening of the next bar.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      trend747,

      COBC=false has no bearing in a backtest and is a real-time only setting. In a backtest you can only process each bar at the close of the bar. Once you process at the end of the bar any order actions you may want to attempt can only be achieved at the next tradeable location which is the opening of the next bar.
      Well actually, the strategy is processing on the close of the bar. So there's still a problem. As I stated, it's supposed to enter on a 2 bar back setup and 1 bar back trigger. It's going 3 bars back on the setup and 2 bars on the trigger.

      Comment


        #4
        Basically, what I've done is moved my bars back one in my code to run it in my optimization. I can then move them back when I do real time testing...

        A pain, but I guess that's how it is.

        Comment


          #5
          When you are using Market Replay COBC=false with [0] means the last bar on the right. When you are using a backtest [0] means the last closed bar which is one bar before the bar that just opened on the right.

          COBC is always true in a backtest. [0] refers to the bar that just closed historically. Market Replay [0] does not refer to the bar that just closed. The bar that just closed would be [1] in a replay with COBC=false.
          Josh P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by elirion, Today, 01:36 AM
          0 responses
          0 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by gentlebenthebear, Today, 01:30 AM
          0 responses
          2 views
          0 likes
          Last Post gentlebenthebear  
          Started by samish18, Yesterday, 08:31 AM
          2 responses
          9 views
          0 likes
          Last Post elirion
          by elirion
           
          Started by Mestor, 03-10-2023, 01:50 AM
          16 responses
          389 views
          0 likes
          Last Post z.franck  
          Started by rtwave, 04-12-2024, 09:30 AM
          4 responses
          31 views
          0 likes
          Last Post rtwave
          by rtwave
           
          Working...
          X