i defined a constructor eg.
private UtilityClass _myClass;
public MyXXType() : base()
{
//in here i create instance of another utility class
//and store the reference..
_myClass = new UtilityClass();
}
When i put some prints in here i get many multiple calls of the constructor showing,
So i created a singleton of my UtilityClass above .... UtilityClass.Instance and invoke this way.
Is it normal/expected for the bartype constructor to be called many times ?
Is it called / is a new bartype object created for every bar added to a chart / every session. I cant seem to find anything in help reference.
I need to better understand the creation process of this as i need the _myClass reference to be reliable. If i have a singleton defined for utilityclass
public static UtilityClass Instance
{
// in here i invoke the constructor .. which should be once...
}
for some reason the print statement in my UtilitClass constructor which is defined as private was getting called multiple times ...
So you see i am trying some different approaches here ....
as i need to know the sequece of when i open a new chart ....
When the data is loaded are the historical bars then added to the chart addbar ?
or do the bars get created as the data loads from history in sequence ....
and then once this is complete any indicators can now reference the bars object...
i did look at the object lifecycle but is doesnt cover this part .... if there is something i have missed please point me to that
thanks

Comment