Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

isFirstBarOnChart or isLastBarOnChart?

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

    isFirstBarOnChart or isLastBarOnChart?

    When developing indicators, if there are certain initialization tasks to be done in your script that you don't want to be included in the Initialize() method for whatever reason, the ol' . . . if (CurrentBar == 1) . . . trick works pretty well. However, when developing strategies, if the "min. bars required" setting is greater than 1, the expression (CurrentBar == 1) will never be true.

    Are there existing system boolean variables that represents isFirstBarOnChart or isLastBarOnChart switch values or similar that would not be impacted by a strategy's "min bars required" setting? Thanks.

    Regards,

    Whitmark
    Last edited by whitmark; 07-07-2007, 03:27 AM.
    whitmark
    NinjaTrader Ecosystem Vendor - Whitmark Development

    #2
    Not that I can think off, what I do is just create a bool private bar.
    RayNinjaTrader Customer Service

    Comment


      #3
      yep, that's what I did . . .thanks.
      whitmark
      NinjaTrader Ecosystem Vendor - Whitmark Development

      Comment

      Latest Posts

      Collapse

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