Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MaximumBarsLookBack.Infinite

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

    MaximumBarsLookBack.Infinite

    protected override void Initialize()
    {
    // Store all series values instead of only the last 256 values
    MaximumBarsLookBack = MaximumBarsLookBack.Infinite;
    }


    1. Does this property apply to the primary dataseries only or are all dataseries in the code set to infinite?

    2. In a indicator with multiple dataseries, is there a way to set only choosen dataseries to infinite to save memory?

    Tnx, Fredrik

    #2
    Hi Frederik, this setting would apply to all all series then - you can try working with individual indicators supplying the series so you could have a setting per instance as needed then.

    Comment


      #3
      Thanks Bertrand!

      Just to be clear; this means added/public ie: Add("RUT", PeriodType.Minute,10); as well as incode/private dataseries ie: V000DS = new DataSeries (this); right?!

      My problem was it seemed Infinite didn´t apply to the private dataseries, but I´ll have to look over the code then.

      Comment


        #4
        Hi Frederic, please check into which UI setting you're using as you apply the script...the Add() for the series would use the lookback amount of the primary series on your chart.

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          Hi Frederic, please check into which UI setting you're using as you apply the script...the Add() for the series would use the lookback amount of the primary series on your chart.
          1. Sorry, still not quite clear on if the private/in-code/non-Add() dataseries are infinite. The ones that are added with "new".

          2. A non topic question: Is there a NinjaScript method to get the amount of bars currently in view/on screen? If not, I guess I´ll have to try solve this with some C# event coding.

          Comment


            #6
            Freen,

            1) They simply use what you set in the UI. When you add a strategy or indicator you have the ability to set this to Inifite or 256. Do you see this option. It will use the setting for hosted indicators as well in a strategy.

            2) There is no supported NinjaScript for this. However I can point you to the property ChartControl.BarsPainted for you to play with. This seems to do what you want. However its unsupported and its functionality could change at any time.

            Let me know if I can be of further assistance.
            BrettNinjaTrader Product Management

            Comment


              #7
              1) Think I got it, thanks! The indicator uses the lookback set in the indicator UI, and the "MaximumBarsLookBack = MaximumBarsLookBack.Infinite;" enables this property for the indicator in a strategy setup but is else not required. Actually, adding the infinite property made my indicator malfunction in a chart, (didn´t try it in a strategy yet). Did I get that right?!

              2) Thanks for the pointer, found much help from this post: http://http://www.ninjatrader.com/su...ad.php?t=23979
              Last edited by FREEN; 04-18-2011, 02:31 AM.

              Comment


                #8
                What issue would you see FREEN with the indicator series set to infinite? This would then just be the legacy 6.5 way, where this setting was basically the default - NT7 offers ways to improve performance here as 256 data points should be enough for most scripts we estimated.

                Comment


                  #9
                  I tried infinite in both the UI and initialize in a more simplistic indicator and it works fine... just as you say. Knowing better about the infinite property I realize the issue is somewhere in my code. I´ll dig there.

                  Thanks Bertrand!

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  579 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  334 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
                  554 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  551 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X