FOREIGN<\/a> function which allows to refer to other symbols than currently selected:<\/p>It’s necessary to do the following:
– Analysis -> Formula Editor
– enter the formula:<\/p>
spread <\/span>= <\/span>Foreign<\/span>( <\/span>"ticker1"<\/span>, <\/span>"C"<\/span>) - <\/span>Foreign<\/span>( <\/span>"ticker2"<\/span>, <\/span>"C"<\/span>);
<\/span>Plot<\/span>( <\/span>spread<\/span>, <\/span>"spread"<\/span>, <\/span>colorRed<\/span>); <\/code>– Tools -> Apply Indicator
(replace ticker1, ticker2 with actual symbol names)<\/p>","protected":false},"excerpt":{"rendered":"
To create a spread chart (and other multi-security indicators \/ statistics etc.) one can use FOREIGN function which allows to refer to other symbols than currently selected:It’s necessary to do the following:– Analysis -> Formula Editor– enter the formula:spread = Foreign( "ticker1", "C") – Foreign( "ticker2", "C");Plot( spread, "spread", colorRed); – Tools -> Apply Indicator(replace ticker1, ticker2 with actual symbol names)<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[53,55],"_links":{"self":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/43"}],"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\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/comments?post=43"}],"version-history":[{"count":1,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/43\/revisions"}],"predecessor-version":[{"id":802,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/43\/revisions\/802"}],"wp:attachment":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/media?parent=43"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/categories?post=43"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/tags?post=43"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}