Cnotey
Power Member
- Jun 25, 2010
- 730
- 984
Hey guys,
I've been searching Stackoverflow for the answer I need, but I can't seem to find it.
I have (3) different class objects, each level is a deeper list of a list.
I can't seem to figure out how to get; and set; variables for list items more than one deep.
Here's my code:
As you can see, I have no problem setting SymbolNames for my first list under my AddSecurities() class.
What I need to do, is for each SymbolName in SymbolList add a class of type completeData to each symbolData for the corresponding SymbolName.
Thanks in advance.
I've been searching Stackoverflow for the answer I need, but I can't seem to find it.
I have (3) different class objects, each level is a deeper list of a list.
I can't seem to figure out how to get; and set; variables for list items more than one deep.
Here's my code:
Code:
public void AddSecurities() {
for(int i = 0; i < symbolsList.Count; i++)
{
AddSecurity(SecurityType.Equity, symbolsList.ElementAt(i).ToString(), Resolution.Minute);
}
}
public void AddSymbols_toList()
{
for(int i = 0; i < SymbolsForAlgorithm.Length; i++)
{
symbolsList.Add(new SymbolList { SymbolName = SymbolsForAlgorithm[i]});
}
}
public class SymbolList
{
public string SymbolName { get; set; }
public List<SymbolData> symbolData { get; set; } = new List<SymbolData>();
public override string ToString()
{
return String.Format("{0}", SymbolName);
}
}
public class SymbolData
{
public List<SharePrices> completeData { get; set; } = new List<SharePrices>();
public List<SharePrices> windowData { get; set; } = new List<SharePrices>();
}
public class SharePrices
{
public DateTime Date { get; set; }
public decimal Price { get; set; }
public override string ToString()
{
return String.Format("{0}", "{1}", Date, Price);
}
}
As you can see, I have no problem setting SymbolNames for my first list under my AddSecurities() class.
What I need to do, is for each SymbolName in SymbolList add a class of type completeData to each symbolData for the corresponding SymbolName.
Thanks in advance.