Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Giving Different Results With Market Replay

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

    Strategy Giving Different Results With Market Replay

    Situation:

    Using the sample MAStrategy to narrow problem.

    Using Market Replay to test

    Using 2 days of data

    TEST 1:

    Using Market Replay, I sllide the bar to just after 9am. I then kick to 500x and let it roll.

    Orders start to come on, everything is normal. I get a result, say +500.00

    I then let it continue through the overnight session all the way to the next day's session. It begins firing orders again (on the 9-4 standard session btw). And I get another end of day result, say -400.

    So I am net 100.00

    TEST 2:

    I start off same as 1, but after the end of the first day, I then slide the bar to the next day and stop just before 9:30 open. It runs and I get a different result for that day. Say +100 instead of -400.


    QUESTION:

    Am I getting different results because when I let it run overnight and through the next day, there are bars that can be looked at to calculate the MA crosses, etc. and as such fire orders perhaps earlier or at different time because the MA will be using prior bars to work off?

    If so, is there a code snippet or something I can do so that when I let it run through say a weeks worth of data or whatever, it will simulate the effect of starting from a clean slate at 9:30am without looking at prior bars?

    At first I thought it was a bug, but logically I think it has to do with what I am saying herein.

    Please advise.


    Thank you

    #2
    Originally posted by r2kTrader View Post
    QUESTION:

    Am I getting different results because when I let it run overnight and through the next day, there are bars that can be looked at to calculate the MA crosses, etc. and as such fire orders perhaps earlier or at different time because the MA will be using prior bars to work off?
    r2kTrader, that could be the case.
    If so, is there a code snippet or something I can do so that when I let it run through say a weeks worth of data or whatever, it will simulate the effect of starting from a clean slate at 9:30am without looking at prior bars?
    The only way to do this is to specify the session begin time to 9:30am. Then it would ignore all the data/bars before the session begin.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Austin,

      Thank you for the reply.

      I thought when you state the instrument timeframe or whatever, that it sets the start time of the session.

      Could you provide a quick snippet example of how to make sure you only start looking at bars from 9:30 forward?

      I know there are a few ways to skin this, so I was just wondering what the simplest would be.


      Thanks,

      Comment


        #4
        Hello,

        I am jumping here, but try something like this:

        if(ToTime(Time[0]) < start_time)
        {
        return;
        }
        DenNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        633 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        567 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X