[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Why is indicator COM/plugin called many times from AB?



PureBytes Links

Trading Reference Links

I created a simple little COM control (in Perl :-) ) that just returns the
array that it receives as a parameter. Inside the control, it writes out all
values in the array to a file, every time it is called.

I noticed that when the control is called from an indicator, it is called
multiple times. Can someone explain why this is so, and the reason for the
different number of elements?

This is an example, where I called the control with the Close array.
myobjfac = CreateObject("JH.TestMA");

Plot(myobjfac.MA2(C), "getMa", colorPink);

I just hit "Apply" on the Indicator Builder, and I got the following output
in my debug file. I did not move anything in the AB charting windows, so
intuitively I thought it was really one call of my AFL script.

first call, parameter contained 170 elements
(Visible bars = 140 bars. The array contains an extra 30 elements prior to
first visible bar.)

second call, 170 elements

third call, 709 elements
The entire Close array was passed from the first bar.

fourth call, 709 elements
Again, the entire Close array was passed in.






Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/