PDA

View Full Version : isFirstBarOnChart or isLastBarOnChart?


whitmark
07-06-2007, 06:39 PM
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

NinjaTrader_Ray
07-07-2007, 08:17 AM
Not that I can think off, what I do is just create a bool private bar.

whitmark
07-07-2007, 10:19 AM
yep, that's what I did . . .thanks.