TZ
Wrong EMA Values
19 Nov 2015, 19:13
Hey, I am trying to create a function which will be comparing the three last EMA values of 30min diagram and the three last EMA values of 5min diagram
However, in my code when I try to retrieve these values from diagram they are not actually correct and the results I take from the comparison are false.
Any Idea???
private bool LongUpShortDown()
{
var slowEMACounter = 0;
var fastEMACounter = 0;
var Index30 = series30.Close.Count;
for (int i = Index30; i > Index30 - 2; i--)
{
if (slowEma.Result[i - 1] - slowEma.Result[i] > 0)
slowEMACounter++;
}
var Index5 = series5.Close.Count;
for (int i = Index5; i > Index5 - 2; i--)
{
if (fastEma.Result[i] - fastEma.Result[i - 1] >= 8E-05)
fastEMACounter++;
}
return ((fastEMACounter == 2) && (slowEMACounter == 2));
}

Spotware
23 Nov 2015, 02:42
Dear Trader,
We do not provide coding assistance services. We more than glad to assist you with specific questions about cAlgo.API. You can contact one of our Partners or post a job in Development Jobs section for further coding assistance.
@Spotware