Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

First 19 candles not processed?

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

    First 19 candles not processed?

    My strategy has decided to stop processing the first 19 5 minute candles of recorded data. I put debug code to paint the screen pink on any on-bar-update as follows:

    protectedoverridevoid OnBarUpdate()
    { BackColor = Color.Pink;

    A screen shot is attached. The recorded data starts at the 6:00AM candle. The screen should be pink from the first tick of the first bar and it isn't.

    I'm out of clues. Any ideas?

    Thanks,

    Larry
    Attached Files

    #2
    Larry,

    This is the case because of your Min. bars required setting for the strategy. By default you require 20 bars before your strategy will begin processing.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks, Josh! I see it now.

      As I control my own start-up in the strategy, how/where do I override the defaut in my code? I'd rather not have to remember to set this up manually every time I start the strategy.

      Thanks,

      L.

      Comment


        #4
        In Initialize(), use...

        Code:
        BarsRequired = 0;
        Josh P.NinjaTrader Customer Service

        Comment


          #5


          That's the best I can do for a thank you!

          L.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Austiner87, Today, 03:42 PM
          1 response
          18 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by cshox, Today, 11:11 AM
          2 responses
          16 views
          0 likes
          Last Post cshox
          by cshox
           
          Started by algospoke, Today, 06:53 PM
          0 responses
          11 views
          0 likes
          Last Post algospoke  
          Started by mlprice12, 12-21-2021, 04:55 PM
          3 responses
          298 views
          0 likes
          Last Post paypachaysa  
          Started by lorem, 04-25-2024, 09:18 AM
          20 responses
          87 views
          0 likes
          Last Post lorem
          by lorem
           
          Working...
          X