SZ PE Ratio
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © dsstudios12

//@version=5
indicator("SZ PE Ratio")
string str= (syminfo.prefix+":"+syminfo.ticker) 
eps = request.financial(str, "EARNINGS_PER_SHARE", "TTM")
pe = close/eps

pe_avg = ta.sma(pe, 730)

plot(pe, color=color.blue)
plot(pe, color=color.green, trackprice = true, show_last = 1)
plot(pe_avg, color=color.purple)
