How may I call a method in another class from another class in a separate file. The files are in the same directory. I tried calling this SMAMethod method
namespace myBackEnd
{
public class SMA
{
public static Models.DateClose SMAMethod (Queue<Models.DateClose>
queue, int period)
{
decimal average, sum=0;
Models.DateClose dateClose = null;
for (int i = 0; i < period; i++)
{
dateClose = queue.Dequeue();
if (dateClose != null)
sum += dateClose.Close;
}
average = sum/period;
dateClose.Close = average;
return dateClose;
}
}
}
When I call the SMAMethod in I get the red squiggly line with the hover over text " SMAMethod does not exists in the current context"
SMAMethod(movingAverageQueue, 10);