Dear All,
I want to have an exploration for the Relative performance of any or a group of stocks as compared to an Index(Nifty or BankNifty or any sectoral Indices) on any time frame.(Also includes any date range)
I am using the relative performance code below taken from
http://www.amibroker.com/kb/2015/08/29/how-to-add-symbol-labels-to-relative-performance-chart/
The chart for this is
I want to have an exploration for the Relative performance of any or a group of stocks as compared to an Index(Nifty or BankNifty or any sectoral Indices) on any time frame.(Also includes any date range)
I am using the relative performance code below taken from
http://www.amibroker.com/kb/2015/08/29/how-to-add-symbol-labels-to-relative-performance-chart/
Code:
_N( TickerList = ParamStr( "Tickers", "^DJI,MSFT,GE" ) );
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 ), styleLine );
x = LastValue( BarIndex() ) + 1;
y = LastValue( relP );
PlotTextSetFont( symbol, "Arial", fontsize, x, y, GetChartBkColor(), color, -fontsize/2 );
}
}
PlotGrid( 0, colorYellow );
Last edited: