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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      63 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      35 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      54 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      61 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      48 views
      0 likes
      Last Post CarlTrading  
      Working...
      X