Naming Formulas

For sharing formulas, or where the owner keeps notes on formulas outside of AmiBroker, it can be useful to copy the name of the formula into the code. That way, when the formula is copied and pasted back into AmiBroker the name will be ‘shipped’ with the formula. It also helps with version control by recording the version number in the formula.

Note: This helps avoid naming mishaps since changing the version number in the formula requires a deliberate effort that goes hand in hand with formula modifications. 

To copy formula names into the code:

1) Select the formula name by clicking in the name box.

2) Right click in the selected area and pick Copy from the context menu that opens.

NamingFormulaFiles002

3) Right click inside the Formula Editor ‘page’ and select Paste from the context menu that opens.

NamingFormulaFiles001

4) Delineate the formula name, as a comment, by adding the symbol pair /* and */ before and after the name.

NF001

5) When the formula is exported, in any format, the name travels with the formula.

/*P_PriceFields*/

field = ParamField(“PriceField”,3);
Color = ParamColor(“Color”,colorBlack);
Plot(field,”(“PriceField”,Color,styleLine);

6) When the formula is ‘imported’ back into AmiBroker the name can be copied, from the formula, and pasted back into the Formula Editor name box. 

Comments are closed.