October 20, 2007
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.
3) Right click inside the Formula Editor ‘page’ and select Paste from the context menu that opens.
4) Delineate the formula name, as a comment, by adding the symbol pair /* and */ before and after the name.
5) When the formula is exported, in any format, the name travels with the formula.
field = ParamField(“PriceField”,3);
Color = ParamColor(“Color”,colorBlack);
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.