Milosz
June 21, 2018, 6:04am
6
When and how often AFL code is executed:
All analysis in AmiBroker including charting, Analysis window or commentaries is based on underlying AFL code, which is being executed by the program to produce the required output. Therefore - any changes we see in the charts or analysis results...
How to execute part of the formula only when new bar is added:
You should read about data types in AFL, variables, arrays, accessing array elements using - subscript operator etc:
Since the subject of data types surfaced in this thread: Send orders to IB on next bar (Intraday)
Here are some comments regarding data types in AFL.
While some users who familiarized a bit with array handling in AFL may think that everything is an array in AFL, that is not the case.
The data type depends on value assigned to variable. If you assign scalar (number) the variable type will be scalar (floating point number, 4 bytes long).
So if you assign a number to variable like this:
var1 =…
https://www.amibroker.com/guide/a_language.html
https://www.amibroker.com/guide/keyword/typeof.html
https://www.amibroker.com/guide/h_understandafl.html
In general it is a little strange for me, that you wrote your own plugin lacking such crucial (and basic) knowledge - about how AFL works. No wonder, that it might not work as you expected.
2 Likes