I am trying to pass an array by referance to a method (funtction). I placed a print statement inside of the method but get an error message from the print line (CS0120). This error message says:
An object reference is required for the nonstatic field, method, or property 'member'
In order to use a non-static field, method, or property, you must first create an object instance.
I belive that the method does not reconize that the print() statement belongs to the using NinjaTrader.Strategy Class. I think that I need a private or public in front of the static but that did not work?
How do I fix this. I am using the print statement to test that the array is being passed to the method.
Here is my code below.
staticdouble ProbLast50(refdouble[] array_ClosePrice)
{
double P_ProbLast50 = 0;
int[] LongORShort = newint[50];
int i;
for (i = 0; i < 50; i++)
{
LongORShort[i] = 0;
Print("ClosePrice["+ i.ToString("00")+ "] " + array_ClosePrice[i].ToString("00.00"));
}
return P_ProbLast50;
} // End of ProbLast500
Thanks for your help,
Bayes

Comment