How to create a method with a constructor?
Hello,
I am trying to for loop a list from another class.
I have this class
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
for(int z = 0; z < 40; z++)
{
fibo2 = (listm[z] - lowPrice0) / (Ncma - lowPrice0);
}
}
I want to create some method from outside the class to reproduce the for loop.
Something like:
private double RunCalculation(int z)
{
for(int z = 0; z < 40; z++)
{
return z;
}
}
So it can produce this instead: fibo2 = (listm[RunCalculation] - lowPrice0) / (Ncma - lowPrice0);
The goal is to remove the brackets of the for loop in the first class because the code is very long and it encompasses to much code.
Is this feasible ?
Thank you