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

0 votes
asked May 23, 2017 in AmiBroker by admin (9,260 points)
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.

1 Answer

0 votes
answered May 23, 2017 by admin (9,260 points)
 
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:

http://www.amibroker.org/userkb/2007/04/20/plotting-trade-zigzag-lines/
commented May 23, 2017 by bigalgator
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.
commented May 24, 2017 by admin (9,260 points)
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
...