// Downloaded From https://www.WiseStockTrader.com
//-----------------------------------------
// MTR Investors Group ~ www.MTRIG.com 
//
// Price charts with PE, EPS, EPS Yield
// Dividend and Dividend Yield
//
// Use AMIQuote to download funamental data
// from Yahoo! Finance.
//-----------------------------------------
SetChartOptions(0,chartShowArrows|chartShowDates);

//Get EPS set to ZERO if EPS is null
EPS =  Nz(GetFnData("EPS"));
PE = IIf(EPS != 0, (Close / GetFnData("EPS")),0);

//EPS Yield
EPSYield= (GetFnData("EPS") / C)  * 100;

//Dividend and Yield
DIV = GetFnData("DividendPerShare");
DIVYield = (GetFnData("DividendPerShare") / C)  * 100;

/* --- If you want to show other indicator values on the chart...use the {{VALUES}} line
Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} {{VALUES}}") +
*/

Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} ") +
        StrFormat(" C:%.2f", C) +
        StrFormat(" (%.1f%%)",SelectedValue(ROC(C,1))) +
        StrFormat(" ~  PE:%.2f",PE) +
        StrFormat("  [ EPS:%.2f  Yield:%.2f%% ]",EPS,EPSYield) +
        StrFormat(" ~ [ DIV:%.2f Yield:%.2f%% ]",DIV,DIVYield);


Plot(C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );