I am fed up with something I've tried to code and it doesn't work.
I definitively need help on that...
I have a dictionary in an indicator that I want to expose to another indicator. I keep on getting the following error :
Object reference not set to an instance of an object...
In my first indicator I initialize the dictionary in the variables section
private Dictionary<string,List<double>> sup = new Dictionary<string,List<double>>();
In my property I have the following :
[Browsable(false)]
[XmlIgnore()]
public Dictionary<string,List<double>> Sup
{
get { Update(); return sup; }
}
In the second indicator I am trying to get the list of my dictionary like that :
if(MyIndicator().Sup.Count != 0){
foreach(KeyValuePair<string, List<double>> key in MyIndicator().Sup){
List<double> thislist = key.Value as List<double>;
foreach(double item in thislist)
Print(Time[0]+" Mylist item : "+item);
}
}
What am I doing wrong ?
Thanks
Bernard
Comment