Hello,
I want to display 2 curves on the same graph.
the first is the "PPP"
the second is the "exchange rate".
The data are here
https://data.oecd.org/conversion/purchasing-power-parities-ppp.htm
I drag and dropt with the "Plot Foreign" indicator or by typing
the AFL code below .
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
TxChgJPN = Foreign("JPN" ,"JPN");
Plot(TxChgJPN ,"exchange rate",colorBlue,styleDots);
But both approaches failed manually and programmatically.
I did get 2 charts and started with Japan.
The curves are good. (see picture below)
What I don't understand is that Japan's exchange rate
has been applied to all of my tickers, in all database markets including stocks !!
What I need to do is two "PPP" and "exchange rate" curves but from each country. That is, country by country.
ex PPP JPN with JPN exchange rate (Japan)
PPP KOR with KOR exchange rate (Korea)
PPP SWE with SWE exchange rate (Sweden)
etc ....
For this I created 2 markets with tickers in them named "PPP" and "exchange rate" respectively. (see the image below) The data is good but I can't assemble them country by country.
NB: I'm a beginner and I don't understand Amibroker and AFL very well.
I think I need a code to fetch a list of ticker and then loop over that list of tickers.
Or maybe there is an easier solution without using AFL and just Amibroker with a manual solution .