//Lot you want to find High beta stock in your portfolio.
//Beta is basically measuring the volatility of stock. So if Hindalco has Beta reading over period of 50 days as 1.8 so this means if Nifty will move 1, Hindalco will move 1.8.
//Use the code below for Beta Exploration.
//Run explore on Amibroker for n last days = 1 //Setting when you click analysis in amibroker//
function
Beta( BaseSymbol, N )
{
Chg =
ROC( C, 1 );
ChgBase =
ROC( Foreign( BaseSymbol, "C" ), 1 );
return ( N * Sum( Chg * ChgBase , N ) - Sum( Chg, N) * Sum( ChgBase, N ) ) /
( N *
Sum( ChgBase ^ 2 , N ) - Sum( ChgBase, N ) ^ 2 );
}
symbol =
ParamStr( "Symbol", "70001247" );
Plot
( Beta( symbol, Param("Periods", 21, 2, 100 ) ), _DEFAULT_NAME(), ParamColor( "Color", ColorCycle ) );
Filter
=
1;
AddTextColumn
(FullName(), "FullName");
AddColumn
(Close, "Close", 1.2);
AddColumn
(Beta("70001247",50), "Beta",1.2); //Replace 70001247 with your Nifty Symbol here