The Foreign() documentation includes a very nice Relative Performance Indicator that shows multiple tickers on the same chart.
How can I mouse click on one of the Relative Performance plots, and automatically (via AFL) switch any other chart panes (and any other symbol linked charts) to the selected ticker name?
//Copied from http://www.amibroker.com/guide/afl/setforeign.html
SetChartOptions(blankbars = 10);
_N( TickerList = ParamStr("Tickers", "^DJI,MSFT,GE") );
NumBars = 20;
fvb = Status("firstvisiblebar");
Plot( 100 * ( C - C[ fvb ] ) / C[ fvb ], Name(), colorBlue );
for( i = 0; ( symbol = StrExtract( TickerList, i ) ) != ""; i++ )
{
fc = Foreign( symbol, "C" );
if( ! IsNull( fc[ 0 ] ) )
{
Plot( 100 * ( fc - fc[ fvb ] )/ fc[ fvb ],
symbol,
colorLightOrange + ( (2*i) % 15 ),
styleLine );
}
}
PlotGrid( 0, colorYellow );
_N( Title = "{{NAME}} - Relative Performance [%]: {{VALUES}}" );
//vvvvvvvvvvvvvvvvvv NEED HELP HERE vvvvvvvvvvvvvvvvvvvvvvv
//Detect Click on Plot and Switch Ticker
ThisTicker = Name();
_TRACE("AFL - Ticker " + ThisTicker);
/*
if (Status("ActionEX") == actionIndicator )
{
//Get TouchedTicker
//Switch Ticker to the one touched
//Force Refresh
}
*/