I am having problem with:
double xx = EMA(Close,10)[1];
Nothing appears on the chart unless I change the 1 to a 0. This seems to be a common theme on the forum.
I have read this:
The log is reflecting the 'Error on calling the 'OnBarUpdate' method for indicator 'xx' on bar 0: Index was out of range...'
This doesn't make sense. I logged onto my Ameritrade account for historical and the chart is reflecting 3 days worth of 10 minute bars == 117 bars? I should only need 11 bars? What gives?
Pulling my hair out on this one. Been at it all day. Silly me.
EDIT:
Yikes... I figured it out. For the sake of posterity, bars are left to right, 0 to whatever. I needed to set the condition to check for bars equal to or greater than period plus whatever. Heh.
Comment