How to workaround 500 Plot() calls limit? (Warning 502)

0 votes
I am getting Warning 502, which says "You are calling Plot()/PlotOHLC() function over 500 times, it is highly inefficient. Reduce number of calls." but I need to draw Price trendline between Buy/Sell signals and need to call Plot() many times.
asked May 23, 2017 in AmiBroker by admin (9,260 points)

1 Answer

0 votes
Best answer
If you are calling Plot() more than 500 times it means that you are doing something wrong. Typical example is when users try to plot hundreds of line segments.

They call Plot() many times while this can be done using single Plot() call as shown here:
answered May 23, 2017 by admin (9,260 points)
I also would like to be able to plot more series.  These are not individual segments, but complete trendlines.  A modern PC with a high resolution display can readily render more than 500.  Perhaps a registry setting to unlock the restriction, like with RequestTimedRefresh, would be handy.
Yes I understand, but still you can draw complete trendlines using technique presented in the article. Also instead of Plot() which is designed to draw array-based data, you may consider using GfxLineTo which is strictly designed to draw a line with very low resource consumption (faster than Plot) and without the limit on number of calls