I am trying to use the SampleGetBar provided by NinjaTrader as is but I am getting the following error.
"Error on calling 'OnBarUpdate' method for indicator 'SampleGetBar' on bar 4743: You are accessing an index with a value that is invalid since its out of range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart."
I have tried if (CurrentBar < 2) return; to no avail.
I have attached a copy for you to look at, cheers.
Comment