I have an indicator that is 3037 lines long.... that's pretty long for me.
I have a load time calculator built into my indicator so I can test code and see where it's inefficient.
When I load 1 day of data, the indicator loads in .14 seconds. Works perfect.
2 days of data takes 4.3 seconds
10 days takes 5.1 seconds.
It seems if there was a calculation slowing it down, then it would be proportional to the amount of data I load. It's not even close. the jump from 1 day to 2 is huge. then very small increase to get to 5 or 10 days.
When I comment out everything in OnBarUpdate, it still takes 3.9 seconds to load 5 days. That makes no sense.
This is the timer data that I output. Top line is loading 1 day, 2nd Line is loading 5 days. #rd line is 10 days. 4th line is 5 days with OnBarUpdate code all commented out.
So I assume it has nothing to do with anything I do in OnStateChange or it would be slow even loading 1 day of data
I assume it has nothing to do with OnBarUpdate or it would load quickly when I commented out all that code.
I use OnRender for all drawing instead of the built-in Draw methods (that was a huge timesaver early on).
Any idea what can make the indicator load extremely fast on 1 day, and so slow on 2 days?
It takes 30 times longer to load 2 days compared to 1 day.
it takes 1.18 times longer to load 10 days of data than to load 2.
This makes no sense.
Any suggestions are appreciated

Comment