I Have a question, Why when I plot multi-ticker chart the plotted lines give different results when I choose different tickers. I use foreign () ant that situation continues wither I set fixup argument of foreign () to 0 or 1.
@mohamed.gad Foreign data used in Indicator formulas are aligned to the current symbol (not as in case of Automatic Analysis, to the Reference symbol specified in AA Settings), so simply choose the most liquid one - having the least amount or preferably no data holes at all (for instance Index etc.) to plot other (foreign) symbols.
Thank you @Milosz , by confirming that this difference is only related to data holes I think the next logic step is to force the base ticker for Index, is there are any possibility to force specific ticker and ignore the manual selection form AB or I have to assign such plots to specific tab and use lock symbol functionality.
Thank you @Tomasz , I use such graphs to study the relative performance of different tickers using some functions applied simultaneously to all tickers So it is important for me to observe results on the same scale. however as you said the performance is
But I have to waive performance to increase knowledge space per unit area of screen.
@Tomasz I think, that @mohamed.gad wasn't clear enough in his initial post. At the beginning I wasn't sure what kind of situation was he describing (attaching example screenshot could help), but if I understand correctly he is simply using Foreign() or PlotForeign() to plot a few foreign symbols in a single chart pane. He doesn't want to create a matrix of several separate charts/graphs in grid-like fashion (contrary to this thread: Multiple Low Level Graphics Charts) and he is not using Gfx functions at all.
For this reason I'm not sure (maybe I'm wrong) if your above reply is fully applicable in this case.
Thank you @Milosz, you are right and I only have one graph with multiple ticker, excuse me if the description of situation made you confused but I thought the text description to the problem "data variation according to selected base ticker" was enough.
Attaching a screenshot in problematic situations is always a good idea, because the initial post should leave no room for speculation. For example you could have also been using one chart window with several panes - each showing a different ticker, with the use of PlotForeign, like this (one chart window with two panes):
AmiBroker is a very versatile software and you can display the same graph in several different ways ...
Dear @Milosz thank you for your effort, here are the figures that show difference in result according to selected base ticker. Both figures are of the same tickers and in the same time range but the data differs according to the selected base ticker.
This is what Users' Guide says about Foreign function:
Foreign function synchronizes the data file you are referencing with the currently selected symbol.
Synchronization makes sure that EACH bar of FOREIGN data matches exactly with each bar of currently selected symbol.
So if DateNum() function returns 990503 for given bar then Close array represents the CLOSE of currently selected symbol at May 3, 1999 and Foreign("SYMBOL", "C") represents close of foreign symbol at May 3, 1999 TOO.
This is absolutely necessary because otherwise you won't be able to do ANY meaningful operations involving both selected symbol and foreign symbol.
This also needed for the display so when you mark the quote with vertical line it will always match the date displayed regardless if you use Foreign or not.
Please note that if you have data holes in currently selected symbol then in order to synchronize bars Foreign function will remove bars that exist in Foreign symbol but do not exist in currently selected symbol.