Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars.Period.Value

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

    Bars.Period.Value

    If I add the following code to the initialize method it blows up my code

    tCI= Bars.Period.Value;

    where tCI is defined as a private int , it compiles but my code blows out. The log says that bars in Progress cannot be accessed from within initialize. Is there some reason Bars.Period.Value cannot be accessed in the Initialize method. Ultimately I am trying to select the file name of the wave file that be used for certain alerts based on the chart compression. It seems logical to do that in initialize. Where am I going wrong?

    thanks
    Jerry

    #2
    Originally posted by JerryWar View Post
    ... Is there some reason Bars.Period.Value cannot be accessed in the Initialize method.... It seems logical to do that in initialize. Where am I going wrong?

    thanks
    Jerry
    The only reason why is because those who designed the NT framework decided as part of their design that Bars should not be accessible from that method. You need to work within the documented constraints of the framework. (Just for the record, I too hate that I cannot access those properties from the Initialize() method).

    Comment


      #3
      Koganam, - I needed confirmation that the message was in fact the real issue. I had already
      wrote some code that got around it by creating a dorky flag to only process the code once.I just hate having to write code like that.

      Thanks
      Jerry

      Comment


        #4
        Jerry, sorry for our late reply - koganam is correct, unfortunately we could not support dynamic adding / access of the bars object in the Initialize() method. That feedback is on our internal product enhancement list to consider as we're working on our next major platform update and refinements for the framework offered, I could not offer a commitment or ETA unfortunately at this point in time.

        Comment


          #5
          Bertrand - The chart compression by any reasonable definition in relation to the indicator code is Static. If you change the chart compression i would like to think you totally rerun the indicator from scratch, initialization and all. Dynamic adding would be a more complicated case.
          Regardless, I have it working, I don't understand the logic or details of your framework that well which is why it gets me in trouble now and again.

          Thanks
          Jerry

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          596 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          343 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          556 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          554 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X