Using lists is not specific to NinjaScript but is instead general c#. (Meaning there is not information about lists in the NinjaTrader help guide.)
Is using a list required for your code? (Can you code your script without using a list?)
Below I am including a link to a 3rd party site that teaches using lists.
For example:
In #region Variables:
private List<int> barNumbers = new List<int>();
In OnBarUpdate():
barNumbers.Add(CurrentBar);
for (var i = 0; i < barNumbers.Count; i++)
{
Print(barNumbers[i]);
}
This would print out all of the bar numbers on ever bar. (a list that would get longer on each bar)
Comment