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

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.
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        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.

            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.
                BertrandNinjaTrader Customer Service

                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 algospoke, 04-17-2024, 06:40 PM
                  6 responses
                  49 views
                  0 likes
                  Last Post algospoke  
                  Started by arvidvanstaey, Today, 02:19 PM
                  4 responses
                  11 views
                  0 likes
                  Last Post arvidvanstaey  
                  Started by samish18, 04-17-2024, 08:57 AM
                  16 responses
                  61 views
                  0 likes
                  Last Post samish18  
                  Started by jordanq2, Today, 03:10 PM
                  2 responses
                  11 views
                  0 likes
                  Last Post jordanq2  
                  Started by traderqz, Today, 12:06 AM
                  10 responses
                  21 views
                  0 likes
                  Last Post traderqz  
                  Working...
                  X