{"id":1006,"date":"2007-10-20T04:22:08","date_gmt":"2007-10-20T04:22:08","guid":{"rendered":"http:\/\/www.amibroker.org\/userkb\/2007\/08\/19\/naming-formulas\/"},"modified":"2007-10-20T06:02:10","modified_gmt":"2007-10-20T06:02:10","slug":"naming-formulas","status":"publish","type":"post","link":"http:\/\/www.amibroker.org\/editable_userkb\/2007\/10\/20\/naming-formulas\/","title":{"rendered":"Naming Formulas"},"content":{"rendered":"

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.<\/p>\n

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. <\/p>\n

To copy formula names into the code:<\/strong><\/p>\n

1) Select the formula name by clicking in the name box.<\/p>\n

2) Right click in the selected area and pick Copy<\/strong> from the context menu that opens.<\/p>\n

\"NamingFormulaFiles002\"<\/p>\n

3) Right click inside the Formula Editor<\/em> ‘page’ and select Paste<\/strong> from the context menu that opens.<\/p>\n

\"NamingFormulaFiles001\"<\/p>\n

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

\"NF001\" <\/p>\n

5) When the formula is exported, in any format, the name travels with the formula.<\/p>\n

\/*P_PriceFields*\/<\/p>\n

field = ParamField(“PriceField”,3);
Color = ParamColor(“Color”,colorBlack);
Plot(field,”(“PriceField”,Color,styleLine);<\/p>\n

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. <\/p>\n","protected":false},"excerpt":{"rendered":"

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 […]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[97],"tags":[],"_links":{"self":[{"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/posts\/1006"}],"collection":[{"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/comments?post=1006"}],"version-history":[{"count":0,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/posts\/1006\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/media?parent=1006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/categories?post=1006"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/tags?post=1006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}