Ok, my brain is about to explode. I'm sure someone with a little more knowledge than me can help. Most of my experience writing C# has been for small programs where I don't need to worry about inheritance and such. Fairly basic stuff.
So I have a few classes set up. One class has two values, the SymbolName and the data for that Symbol.
I have a sublist of that setup to house two different data sets of type SharePrices.
I am trying to figure out a way to add TradeBar data to the list of completeData for each symbolData for each corresponding SymbolName.
Basically I need to populate SharePrices, each minute, store that in list completeData which will happen for each symbolData corresponding to each SymbolName. I hope I explained that right. Any help is appreciated.
I have it set up to AddSecurity() correctly at initialization. But I can't seem to figure out how to add data more than one level deep.
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
public override string ToString()
{
return String.Format("{0}", SymbolName);
}
}
public class SymbolData
{
public List
public List
}
public class SharePrices
{
public DateTime Date { get; set; }
public decimal Price { get; set; }
public override string ToString()
{
return String.Format("{0}", "{1}", Date, Price);
}
}
John Rewolinski
John Rewolinski
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!