{"id":43,"date":"2007-03-26T07:58:33","date_gmt":"2007-03-26T12:58:33","guid":{"rendered":"http:\/\/www.amibroker.com\/kb\/2007\/03\/26\/how-to-chart-spreads\/"},"modified":"2014-12-04T08:30:51","modified_gmt":"2014-12-04T13:30:51","slug":"how-to-chart-spreads","status":"publish","type":"post","link":"https:\/\/www.amibroker.com\/wordpress\/kb\/2007\/03\/26\/how-to-chart-spreads\/","title":{"rendered":"How to chart spreads?"},"content":{"rendered":"

To create a spread chart (and other multi-security indicators \/ statistics etc.) one can use 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);&nbsp– 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}]}}