{"id":505,"date":"2014-10-06T18:43:59","date_gmt":"2014-10-06T23:43:59","guid":{"rendered":"http:\/\/www.amibroker.com\/kb\/?p=505"},"modified":"2018-03-14T19:55:31","modified_gmt":"2018-03-14T18:55:31","slug":"relationship-between-chart-panes","status":"publish","type":"post","link":"https:\/\/www.amibroker.com\/wordpress\/kb\/2014\/10\/06\/relationship-between-chart-panes\/","title":{"rendered":"Relationship between chart panes"},"content":{"rendered":"

In order to explain possible relationships between chart panes in AmiBroker, let us first introduce two important attributes associated with each chart pane, these are Chart ID<\/strong> and File path<\/strong>.<\/p>

To see these attributes, we need to right-click on the chart and choose Parameters<\/strong>, then Axes&Grid<\/strong> tab:<\/p>

\"Parameters<\/p>

The File path<\/strong> defines physical AFL file on your hard-drive that contains the indicator code used to generate charts. The Chart ID<\/strong> is an index to AmiBroker’s internal chart table. The chart table holds chart settings such as those seen in Axes&Grid<\/strong> tab, including the File path<\/strong>. So knowing the Chart ID<\/strong>, AmiBroker knows everything about the chart. The Chart ID<\/strong> uniquely identifies the chart.<\/p>

Chart ID<\/strong> plays important role in the following areas:<\/p>

  1. Chart parameters are keyed by Chart ID<\/strong> so two different charts may have same names of parameters, yet parameters are independent if those charts have different ChartID<\/strong>.
  2. Hand-drawn studies are stored wih Chart ID<\/strong> assigned to it, so they “belong” to given chart and can be referenced from other formulas using Study() function
  3. Chart ID<\/strong>s are stored in the layout files so AmiBroker knows which charts should be loaded when layout is loaded.<\/ol>

    When we compare two charts, then the following relations are possible:<\/p>

    1. if both Chart ID<\/strong>s and File path<\/strong>s are different, then charts are completely independent. This will happen if we use Insert<\/strong> option from the Charts<\/strong> window to create a new chart pane or when we double-click on the given formula (double-click works as Insert<\/strong>), because AmiBroker then would create new Chart ID<\/strong> and independent copy of the formula as described in manual http:\/\/www.amibroker.com\/guide\/h_dragdrop.html<\/a>

      \"Insert\"<\/p>

    2. if Chart ID<\/strong>s are different in both chart panes but File Path<\/strong> is the same, then these are different charts, yet they share same formula file. In such case hand-drawn studies will not get transferred and parameters will not be shared, but drag&drop operations and changes in the formula will affect both charts. This situation will occur if we use Insert Linked<\/strong> option from the Charts<\/strong> window to create a new chart pane directly linked to the original formula.

      \"Insert<\/p>

    3. if Chart ID<\/strong> is the same for both – then it is essentially the very same chart<\/strong>. It means that all the hand-drawn studies and parameters are common for both charts (changes in one chart pane will affect the other) and all the drag&drop operations or formula changes affect both charts – that is because as a result of dragging and dropping indicators the underlying code is being modified (new sections are added). Such relationship between chart panes will happen when we open another chart window that uses the same chart template as the previous window (e.g. using File->New->Default Chart<\/strong>) or save chart template and load it from the other window.<\/ol>

      There is also a functionality in AmiBroker, which allows to copy-paste the selected chart pane and define which elements are pasted. To do that click on the pane you want to copy, choose Edit->Copy<\/strong> from the menu, then switch to the place where you want to paste it and choose Edit->Paste Special<\/strong><\/p>

      \"Paste<\/p>

      Choosing first option creates new Chart ID, and creates a copy of formula, so resulted chart is independent from source chart. Choosing second option creates new Chart ID, but links it to same formula as original, so the formula is shared. Choosing third option inserts a pane that uses same Chart ID (identical chart, everything shared).<\/p>

      \"Paste<\/p>","protected":false},"excerpt":{"rendered":"

      In order to explain possible relationships between chart panes in AmiBroker, let us first introduce two important attributes associated with each chart pane, these are Chart ID and File path.To see these attributes, we need to right-click on the chart and choose Parameters, then Axes&Grid tab:The File path defines physical AFL file on your hard-drive […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[55,24],"_links":{"self":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/505"}],"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=505"}],"version-history":[{"count":2,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/505\/revisions"}],"predecessor-version":[{"id":1523,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/505\/revisions\/1523"}],"wp:attachment":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/media?parent=505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/categories?post=505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/tags?post=505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}