EDIT -- DO NOT USE ADD DATA SERIES if you don't need it!! This was causing OnBarUpdate() to execute more than once, which may trip you up if you're not expecting it. I am a total n00b and was using it, even though there wasn't a good reason to. Thanks, bltdavid!!
----------
Given the above instrument/time period -- I'm trying to deal with bar data (Open/High/Low/Close) within a given interval window for making a custom indicator. When I've queried the Count of a loaded chart, I'll get a number like 114 -- but if I try to reference the Close[114] using that index, its out of range. So I'm struggling to get what is going on here.
Essentially, given a bar chart and time period, and knowing the number of bars loaded - how do you access the furthest back in time, iterating using the interval window to make some calculations, all the way to the Bar 1?
I used to do NinjaTrader, but an ancient version - so none of the old code I have will work directly, so I'm porting it to Ninjatrader 8. I just find the Series/Bars documentation a bit confusing, and using Print statements hasn't helped much. I can get prices, but for instance Close[1] doesn't match what I have on my chart for the time period, even if I do some debug statements confirming the instrument time period, etc...
I don't know if it has anything to do with working with the EOD data that was available (My full ticker subscription isn't set up yet - my funding wire is in progress.).
Just looking for some newbie help and staring at the API isn't it.
Anything is appreciated, thanks.
Comment