Forgive me if this is a newbie question but I've spent several hours working on trying to figure out alternatives to this before I came here....I'm having some trouble in figuring out what's the best way to achieve what I'm trying to. I'd like to place a series of double values into an array without setting each value like this
So in other words I'd like to to cycle though all values of spread_series.Ago(0-infinity) and place them into dataArray[i] something like this.
if (spread_series.Count > 7)
{
double[] dataArray = new double[spread_series.Count];
for (int i = 0; i < dataArray.Length; i++)
{
dataArray[i] = spread_series.Ago(i);
Array.Reverse(dataArray);
}
}
The problem obviously is that I can't implicitly convert a double into an array and the .Ago method requires an (int) in it's reference. I've tried casting but I think the underlying framework prevents it. So I'm left wondering if it's possible to make a simple class or some other method that would allow me to reference all values in the spread_series.Ago() method programmatically so that I wouldn't have to set each value individually or if I don't know how much data I'll be referencing?
Bookmarks