Here is my code below-
double divBuy = 0;
for (int j = 0; j < equityCheckArray.Count; j++)
{
for (int i = 0; i < noOfBuyIndicators; i++)
{
buySum += buySignal[i][j];
}
divBuy = buySum / noOfBuyIndicators;
averageBuy[j] = divBuy;
}
buySum
and noOfIndicators
both have values assigned to them as 1 and 3 respectively. As you can see, divBuy
is also initialized correctly and is not a null value. Still, after divBuy = buySum / noOfIndicators
line is passed, 1/3 is not assigned to divBuy
and the value remains as 0. Why is this happening?
Apologies if this question has been asked multiple times in the past. Thanks in advance