I have developed a couple of custom indicators which really take a long time to load (e.g. when applied to 1 Min charts it could take 30 secs to load)
Once they load, they update ok even though they seem to use a lot of PC resources (I am not a techie, but I can sense symptoms such as the time it takes to display a chart when flicking between chart windows or computer noise - sounds as if PC is going to take off any minute! - and/or temperature)
Not sure if I am coding something incorrectly. Common features these two indicators have are the following:
- They plot or use 4 to 5 data series each.
- They use TimeSpan variables and LRO/MRO methods to filter out bars*
- Once compiled they generate about 300 lines of code
- I use them real-time (i.e. CalculateOnBarClose set to False)
I have read the Help file on ways to improve PC performance when using NT, but is there anything else you could suggest to improve code efficiency and/or PC performance when developing custom indicators?
Thanks in advance,
Stopped
* I was referring to the following code:
TimeSpan refTime = TimeZoneInfo.ConvertTime(Time[0], Bars.Session.TimeZoneInfo).TimeOfDay;
int barsAgoInit = LRO(delegate{return TimeZoneInfo.ConvertTime(Time[0], Bars.Session.TimeZoneInfo).TimeOfDay == refTime;}, 1, CurrentBar + 1);
int barsAgo = MRO(delegate{return TimeZoneInfo.ConvertTime(Time[0], Bars.Session.TimeZoneInfo).TimeOfDay == refTime;}, 2, CurrentBar + 1);
Comment