(1)
{
startDateTime1ea = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 9, 30, 0);
endDateTime1ea = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 9, 44, 59);
int startBarsAgo1ea = GetBar( startDateTime1ea);
int endBarsAgo1ea = GetBar( endDateTime1ea);
do something here
startDateTime1eb = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 9, 45, 0);
endDateTime1eb = new DateTime(Time[0].Year, Time[0].Month, Time[0].Day, 9, 59, 59);
int startBarsAgo1eb = GetBar( startDateTime1eb);
int endBarsAgo1eb = GetBar( endDateTime1eb);
do something here
}
(2) I've done the above over an hour's market session and applied on FDAX 1 Range Chart. I even set begin and start time within an hour in the chart properties. If I code for the entire market session, I think it will be worst. During the application, I encountered the problems:
(a) First, when I load up the indicator, after a few minutes, NT was foced to close down with the message "System.OutOfMemoryException" which I read from the trace file.
(b) Second, if NT is not forced to close down, it will take unbelivable 10 minutes or even more to show the indicator on screen.(Please refer to the attachment "ntplot4' The case stayed there for the duration I mentioned above) The funny part is that the appearing of indicator takes two steps to plot.It plots my DrawLine and DrawRectangle then it stops for a minute or two (Please refer to the attachment "ntplot2") before continuing plotting my DrawRegion. The case happened when the market is very active .(That is a lot more bars than normal.)
(3) Occasionally,when the market is active,moving of cursor seems to cause delay as well.
(4) My indicators are only valid for that specified time range .Any new time range start,a new set of calculation is started and the previous set of calculation is not in use anymore.Is NT does all the calculations from the first bar to current bar whenever there is a new incoming tick? If so ,how can I write a logic to terminate the previous calculations which I'm not needed? Could it help in terms of CPU and Ram? I've used RemoveDrawobjects when new time range started.
(5) I'm using XP Professional, Intel Pentium D CPU 2.8/2.79 GHz and 1.5 GB Ram.
(6) Attachment "ntplot5' is an example of my indicator layout.
(7) I hope you understand my explanation in such a poor English
Comment