

This situation exist in various degrees in all documentation and cannot be prevented. Of course their view is just as relative and subjective as those of the author. Users on the other hand often assume that their lack of knowledge is shared by all beginners and, if the Help file inadequately explains something, claim that the documentation is badly written. The results is that, for the individual user, some topics are covered excessively while others are skimmed over because the author assumed that everybody is basically familiar with the topic. The problem is that this prerequisite minimum level of understanding is set by the subjective judgment of the author. To write documentation on any topic that leaves no questions unanswered is an impossible task, all help documentation assumes a minimum level of familiarity with the topic studied. For the newcomer to programming, this may represent a steep learning curve and it may take a little persistence to find the answers to all your questions.
Amibroker file examples how to#
The AmiBroker Programming Language (AFL) is a very unique and powerful programming language but to use it effectively you have to understand how it works and how to properly use the AFL functions.
Amibroker file examples code#
If the cursor is lower down the code the search will start from there and it will only traverse to the end before reporting that the search is complete.įiled by brian_z at 4:02 am under AFL - The Basics Comments Off on Abbreviated Identifiers v2 Note: The font format for reserved variables can be customized in Tools > Preferences.Ī handy tip for searching, with the Text Search Tool, is to position the cursor at the top of the code so that the search will begin from there. if the ‘writer’ wants to replace all “C’s” with a variable = ParamField, for example, the Replace tool will pick up every “C” in the code and ask the user to confirm the replacement.Ĭhecking Match whole word only in the Text Search Tool will change the criteria so that where “C” is part of a word it will be passed over while “C”, on it’s own, will be treated as a word and highlighted in the search report . If abbreviated identifiers are used it makes the task of finding and replacing price arrays, using Formula Editor > Edit > Replace very tedious e.g. This is very nice for speeding up formula writing but there is a ‘Catch 22’. They are not case sensitive and when entered into a formula, in the Formula Editor, they will default to upper case and bold (as shown in the figure below). Of the small number of variables that are reserved the price identifiers are the only ones that can be abbreviated (OHLCVOI can be used instead of the longer form). In AFL the identifiers Open, High, Low, Close, Volume, OpenInt and Avg are reserved for price field arrays. function IIF_AFL ( condition, inputA, inputB ) PlotShapes ( C, colorRed, 0, C , - 10 ) Plot ( C, "", colorLightGrey, styleBar ) Title = "Hollow = " + NumToStr ( shapeHollowCircle - shapeCircle, 0, 0 ) + "\n" + "Small = " + NumToStr ( shapeSmallCircle - shapeCircle, 0, 0 ) įiled by Tomasz Janeczko at 5:01 pm under AFL - The Basics Comments Off on AFL Shapes Cheat Sheet This function is an AFL equivalent for the IIF() function. An example on how this would be done is shown in the function below (copied from the AmiBroker help). It is possible to use if()s to individually test and modify each bar in an array for a condition. A search of the afl library will also get you many more examples. It can be used to code complex decision trees and state machines, for example as these are often needed in automated trading systems.įor more detailed explanations click IF(), IIF(), or Switch().

In all but the simplest applications the Switch() is the preferred method to the IF() to change program flow.

The IF() and Switch() are program flow control statements, the IIF() is a function that acts on all elements of an input array and returns an output array. This post gives a few simple examples of their use. Many newcomers to AFL are confused by the IF(), IIF() and Switch().
