{"id":1233,"date":"2015-10-07T07:30:55","date_gmt":"2015-10-07T12:30:55","guid":{"rendered":"http:\/\/www.amibroker.com\/kb\/?p=1233"},"modified":"2015-10-07T07:31:08","modified_gmt":"2015-10-07T12:31:08","slug":"how-to-increase-maximum-periods-of-built-in-indicators","status":"publish","type":"post","link":"https:\/\/www.amibroker.com\/wordpress\/kb\/2015\/10\/07\/how-to-increase-maximum-periods-of-built-in-indicators\/","title":{"rendered":"How to increase maximum periods of built-in indicators"},"content":{"rendered":"

Built-in indicators and averages which are shipped with AmiBroker use Param() function calls to provide the ability to adjust parameter values through Parameters window. Param function in the code specifies default, minimum, maximum values for the input arguments.<\/p>

The order of arguments in Param function is the following:<\/p>Param<\/span>( <\/span>"name"<\/span>, <\/span>defaultval<\/span>, <\/span>min<\/span>, <\/span>max<\/span>, <\/span>step<\/span>, <\/span>sincr <\/span>= <\/span>0 <\/span><\/code>

In certain situations, we may however want to use larger period settings than the pre-defined maximum. There is an easy way to adjust the code to achieve such task. Let us consider using built-in Price (all in one) indicator and setting e.g. 200 or 300 periods for Bollinger Bands (default maximum is 100).<\/p>

To modify the underlying code, we need to:<\/p>

  1. Click on the chart with right mouse button and choose Edit Formula<\/strong> from the context menu to bring up the AFL code editor
  2. In the code identify Bollinger Band section and the Param<\/strong> function call responsible for setting number of periods and change it from 200 to 300 as shown in the picture below.

    \"Param<\/p>

  3. Approve the changes, by selecting Tools->Apply<\/strong> from the editor’s menu<\/ol>

    Now we can go back to Parameters<\/strong> dialog and we will be able to set Bollinger Bands Periods setting up to 300 periods.<\/p>","protected":false},"excerpt":{"rendered":"

    Built-in indicators and averages which are shipped with AmiBroker use Param() function calls to provide the ability to adjust parameter values through Parameters window. Param function in the code specifies default, minimum, maximum values for the input arguments.The order of arguments in Param function is the following:Param( "name", defaultval, min, max, step, sincr = 0 In certain situations, we may however want to use […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[53,55,76],"_links":{"self":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/1233"}],"collection":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/comments?post=1233"}],"version-history":[{"count":2,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/1233\/revisions"}],"predecessor-version":[{"id":1239,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/1233\/revisions\/1239"}],"wp:attachment":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/media?parent=1233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/categories?post=1233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/tags?post=1233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}