Formula Editor

AFL Formula Editor features user-definable syntax highlighting, context-sensitive formula reference help, enhanced error reporting, automatic statement completion and parameter information technology (similar to Intellisense(tm) featured in Microsoft Developer studio), support for editing multiple files at once, and is multi-monitor friendly.

These features greatly simplifies writing formula and provides instant help so time needed to write formula decreases significantly.

Menu

Formula Editor menu options are described in detail in Menus: Formula Editor chapter of the guide.

Toolbar

The Formula Editor toolbar provides the following buttons:

Usage

Typical use of Formula Editor is as follows:

Syntax highlighting

AmiBroker's AFL editor features user-definable syntax highlighting that automatically applies user-defined colors and styles to different language elements like functions and reserved variable names, strings, numbers, comments, etc. This feature greatly simplifies code writing. You can modify coloring scheme in Preferences window.

Enhanced error reporting

When you make an error in your formula, AmiBroker's enhanced error reporting will help you to locate and fix an error by highlighting the place where error occured and displaying extended error description with the examples of common mistakes and advice how to fix them.

Context  help

You can quickly display relevant AFL function reference page if you press F1 key or choose "Function reference" from the context menu while the caret is inside or right after function name as shown in the picture below:

Automatic statement completion

 
The automatic completion feature (available when you press CTRL+SPACE key combination) finishes typing your functions and reserved variables for you, or displays a list of candidates if what you've typed has more than one possible match. You can select the item from the list using up/down arrow keys or your mouse. To accept selection press RETURN (ENTER). You can also type immediately space (for variables) or opening brace (for function) and AmiBroker will auto-complete currently selected word and close the list. To dismiss the list press ESC key.
 
 
 
Parameter Information
 
When you are typing a function, you can display a Tool Tip containing the complete function prototype, including parameters.  The Parameter Info Tool Tip is also displayed for nested functions.

With your insertion point next to a function, type an open parenthesis as you normally would to enclose the parameter list.

AmiBroker displays the complete declaration for the function in a pop-up window just under the insertion point.

Typing the closing parenthesis dismisses the parameter list.

You can also dismiss the list if you press arrow up/down key, click with the mouse or press RETURN.