Hi,
Is it possible to get the symbols arranged in Vertical format at top left end arranged in descending order of relative performance? With my limited knowledge I tried this " \n {{VALUES}} " In Title Format.
But how to get each Value in NewLine and arranged in Descending order of Relative Perforamce?
Source Code:
https://www.amibroker.com/kb/2015/08/29/how-to-add-symbol-labels-to-relative-performance-chart/
_SECTION_BEGIN("Relative Performance 4");
WatchlistName = ParamList("WatchList", "List-1,List-2");
_TRACE(WatchlistName);
wlnumber = CategoryFind(WatchlistName, categoryWatchlist );
tickerlist = CategoryGetSymbols( categoryWatchlist, wlnumber );
_TRACE("WL number " + wlnumber);
_TRACE("Ticker list" + tickerlist);
fontsize = Param("Label font size", 10, 4, 30, 1 );
fvb = Status( "firstvisiblebar" );
for( i = 0; ( symbol = StrExtract( Name() + "," + TickerList, i ) ) != ""; i++ )
{
fc = Foreign( symbol, "C" );
if( ! IsNull( fc[ 0 ] ) )
{
relP = 100 * ( fc - fc[ fvb ] ) / fc[ fvb ];
Plot( relP , symbol, color = colorLightOrange + ( ( 2 * i ) % 15 ), styleNoLabel );
x = LastValue( BarIndex() ) + 1;
y = LastValue( relP );
PlotTextSetFont( symbol, "Arial", fontsize, x, y, GetChartBkColor(), color, -fontsize/2 );
}
}
PlotGrid( 0, colorYellow );
_N(Title = StrFormat( "{{NAME}} - Start Date: %s, Relative Performance [%%]: {{VALUES}}", DateTimeToStr(Param_dt, 1)));
SetChartOptions(0, chartWrapTitle);
_SECTION_END();