March 26, 2007
How to chart spreads?
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)
Filed by AmiBroker Support at 7:58 am under Indicators
1 Comment
Could you please provide an example of taking this spread one step further?
With a 5 second database, how would I display in a one minute chart H,L,C bars of the spread utilizing the highest high and lowest low of the spread calculated in the base timeframe within the 1 minute bars? In other words I don’t want the one minute high of ticker1 – the one minute high of ticker2, etc.
thank you