I have only basic programming skills, but browsing the online manual i found a way to measure the slope angle of a indicator (EMA). Its only one row of code and when i run it on any chart it works fine, i can see the digits in the Output. However when i try to include it in a strategy (which also works fine standalone) i receive error:
"Strategy 'GameOverTest': Error on calling 'OnBarUpdate' method on bar 16: Index was outside the bounds of the array."
I guess this is happening, because when i run the indicator alone it will calculate and return in the Output window a lot of digits (i can presume it calculates everything from the beginnig of the chart). I dont need this, i only need the last digit. How can i achieve this?
The indicator:
double angle = (Math.Atan(Slope(EMA(25), 5, 0))*18000/Math.PI);
Print (angle);
Best regards,
Hristo
Comment