Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Min bars required in a live strategy

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

    Min bars required in a live strategy

    I'm running a strategy live on one PC and I'm unable to get it to run properly on a 2nd PC.

    The issue is that the strategy, which uses tick bars as its primary bars, requires approximately 1600 bars at startup. The strategy doesn't run when I change the min bars required to from its default value of 20.

    On the 1st PC this hasn't been a problem. According to the log files NT has been starting the strategy around the 3030th bar which is sufficient for the strategy. I'm not sure why NT is starting the strategy at bar# 3030 but this works regardless.

    The problem is on the 2nd PC. I'm attempting to run the same strategy but the log files consistently show the strategy starting around bar #238. This is an insufficent number of bars for the strategy. Given that I can't change the min bars req'd from the default value how can I get NinjaTrader on PC#2 to mimic what NT is doing on PC #1?

    Does NT use some kind of internal default bar value that would cause the same strategy to start at bar #3030 on PC1 but only at bar #238 on PC2? Is there a roundabout way to fix this problem w/o using the min bars req'd input?

    -Lou

    #2
    If the only thing you have in OnBarUpdate() is:

    Print(CurrentBar);

    and when you run with Min Bars Required = 20, the 1st print should be either 19 or 20, don't recall. This will be true for any PC. If you have suplementary series, such as 60 min bars, you would need 20 60 min bars before OnBarUpdate() is called for the primary series.

    My point is that there must be a difference in data from PC1 to PC2...That would be my first guess.
    RayNinjaTrader Customer Service

    Comment


      #3
      Ray,
      1) What do you mean by a difference in data? I've just exported the data file on PC1 to PC2 today. Same with the strategy. They're exact copies.

      2) What would be your next guess regarding the problem?

      -Lou

      Comment


        #4
        I guess there is no next guess. Something is different between PC1 and PC2. Does your strategy use multi-series? If yes, make sure the data is the same between both. Maybe just copy over the database from PC1 to PC2.
        RayNinjaTrader Customer Service

        Comment


          #5
          Ray,
          I've already copied the data from one PC to the other. I think there might be some other issue since, not only is the live trading log file showing a problem on PC2, but also the backtesting isn't correct either. I guess there's something else I need to resolve.

          Thx,
          Lou

          Comment


            #6
            I see, then there must be some other difference somewhere. Unfortunatley I would not have any further ideas on what this may be.
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            571 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            331 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            549 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            550 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X