OGT Intrinsic Value Indicator
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © trademate2000

//@version=5
indicator("OGT Intrinsic Value Indicator",overlay = true)

// datestring = input.time(defval = timestamp("1 Jan 2022 00:00 +0000"), title = "Start Year", group = "Date")
// startdate = input(defval = timestamp("20 Feb 2020 00:00 +0300"), type = input.time, title = "Start Date", group = "Delivery settings")
// enddate = input(defval = timestamp("20 Oct 2021 00:00 +0300"), type = input.time, title = "End Date", group = "Delivery settings")
// inDateRange = (time >= startdate) and (time <= enddate)

lowlinecol = input.color(defval=color.red, title = "LOW Assumption Color",group = "Lines Color")
medlinecol = input.color(defval=color.blue, title = "MEDIUM Assumption Color",group = "Lines Color")
highlinecol = input.color(defval=color.orange, title = "HIGH Assumption Color",group = "Lines Color")


//Tables

bgcolor1 = input.color(defval=color.new(color.black,60), title = "Table Col 1",group = "Tables")
bgcolor2 = input.color(defval=color.new(color.blue,85), title = "Table Col 2",group = "Tables")
textcol = input.color(defval=color.rgb(255,255,255), title = "Table Text Col",group = "Tables")
textsize1 = size.normal




//EPS TTM
EPS = math.round(request.financial(syminfo.tickerid, "EARNINGS_PER_SHARE", "TTM"),2)
// EPS = 6.08
// EarningsYield = (EPS / close) * 100
plot(close, color = color.new(color.blue,100))
// if barstate.islast
//     label.new(bar_index, high,text = str.tostring(EPS))


//eps growth
epsgrowthlow = input.float(defval = 15.0,step = 0.0001, minval = 0.0, title="Low", group = "EPS Annual Growth Rate For Next 5 Years")/100
epsgrowthmed = input.float(defval = 20.0,step = 0.0001, minval = 0.0, title="Med", group = "EPS Annual Growth Rate For Next 5 Years")/100
epsgrowthhigh = input.float(defval = 25.0,step = 0.0001, minval = 0.0, title="high", group = "EPS Annual Growth Rate For Next 5 Years")/100


epslow2 = math.round(EPS*(1+epsgrowthlow),2)
epslow3 = math.round(epslow2*(1+epsgrowthlow),2)
epslow4 = math.round(epslow3*(1+epsgrowthlow),2)
epslow5 = math.round(epslow4*(1+epsgrowthlow),2)

epsmed2 = math.round(EPS*(1+epsgrowthmed),2)
epsmed3 = math.round(epsmed2*(1+epsgrowthmed),2)
epsmed4 = math.round(epsmed3*(1+epsgrowthmed),2)
epsmed5 = math.round(epsmed4*(1+epsgrowthmed),2)

epshigh2 = math.round(EPS*(1+epsgrowthhigh),2)
epshigh3 = math.round(epshigh2*(1+epsgrowthhigh),2)
epshigh4 = math.round(epshigh3*(1+epsgrowthhigh),2)
epshigh5 = math.round(epshigh4*(1+epsgrowthhigh),2)

//your annual return
annualreturnlow = input.float(defval = 12.5,step = 0.0001, minval = 0.0, title="Low", group = "Your Annual Return")/100
annualreturnmed = input.float(defval = 12.5,step = 0.0001, minval = 0.0, title="Med", group = "Your Annual Return")/100
annualreturnhigh = input.float(defval = 12.5,step = 0.0001, minval = 0.0, title="high", group = "Your Annual Return")/100

//PE ratio in 5 years
peratiolow = input.float(defval = 10.0,step = 0.0001, minval = 0.0, title="Low", group = "PE Ratio In Year 5")
peratiomed = input.float(defval = 13.0,step = 0.0001, minval = 0.0, title="Med", group = "PE Ratio In Year 5")
peratiohigh = input.float(defval = 15.0,step = 0.0001, minval = 0.0, title="high", group = "PE Ratio In Year 5")


ivlow5 = math.round(epslow5*peratiolow,2)
ivmed5 = math.round(epsmed5*peratiomed,2)
ivhigh5 = math.round(epshigh5*peratiohigh,2)

ivlow4 = math.round(ivlow5/(1+annualreturnlow),2)
ivmed4 = math.round(ivmed5/(1+annualreturnmed),2)
ivhigh4 = math.round(ivhigh5/(1+annualreturnhigh),2)

ivlow3 = math.round(ivlow4/(1+annualreturnlow),2)
ivmed3 = math.round(ivmed4/(1+annualreturnmed),2)
ivhigh3 = math.round(ivhigh4/(1+annualreturnhigh),2)

ivlow2 = math.round(ivlow3/(1+annualreturnlow),2)
ivmed2 = math.round(ivmed3/(1+annualreturnmed),2)
ivhigh2 = math.round(ivhigh3/(1+annualreturnhigh),2)

ivlow1 = math.round(ivlow2/(1+annualreturnlow),2)
ivmed1 = math.round(ivmed2/(1+annualreturnmed),2)
ivhigh1 = math.round(ivhigh2/(1+annualreturnhigh),2)


alertcondition(ta.cross(close,ivlow1) or ta.cross(close,ivmed1) or ta.cross(close,ivhigh1),"1. Intrinsic Value Cross","Intrinsic Value has been crossed!")

////////////////////////////////Lines

// currentbar = bar_index

transpcol = color.new(color.white,100)

var line linelow1 = na
var line linelow2 = na
var line linelow3 = na
var line linelow4 = na
var line linelow5 = na
var line linelow6 = na
var line linelow7 = na
var line linelow8 = na
var line linelow9 = na

var label lowlabel1 = na
var label lowlabel2 = na
var label lowlabel3 = na
var label lowlabel4 = na
var label lowlabel5 = na


line.delete(linelow1)
line.delete(linelow2)
line.delete(linelow3)
line.delete(linelow4)
line.delete(linelow5)
line.delete(linelow6)
line.delete(linelow7)
line.delete(linelow8)
line.delete(linelow9)

label.delete(lowlabel1)
label.delete(lowlabel2)
label.delete(lowlabel3)
label.delete(lowlabel4)
label.delete(lowlabel5)

// datestring = "1 Jan " + str.tostring(year) + " 00:00 +0000"
// startdate = timestamp(year,1,1,1,1,1)
currentbar = timestamp(year,1,1,1,1,1)
year1 = (86400000 * 365)
year2 = year1*2
year3 = year1*3
year4 = year1*4
year5 = year1*5


linelow1 := line.new(currentbar,ivlow1,currentbar+year1,ivlow1,color = lowlinecol, xloc = xloc.bar_time)
lowlabel1 := label.new(currentbar+year1,ivlow1,text = "LOW ASSUMPTION - Year 1 : " + str.tostring(ivlow1), style = label.style_label_lower_right, textcolor = lowlinecol, color = transpcol, xloc = xloc.bar_time)

linelow2 := line.new(currentbar+year1,ivlow1,currentbar+year1,ivlow2,color = lowlinecol, xloc = xloc.bar_time)
linelow3 := line.new(currentbar+year1,ivlow2,currentbar+year2,ivlow2,color = lowlinecol, xloc = xloc.bar_time)
lowlabel2 := label.new(currentbar+year2,ivlow2,text = "Year 2 : " + str.tostring(ivlow2), style = label.style_label_lower_right, textcolor = lowlinecol, color = transpcol, xloc = xloc.bar_time)


linelow4 := line.new(currentbar+year2,ivlow2,currentbar+year2,ivlow3,color = lowlinecol, xloc = xloc.bar_time)
linelow5 := line.new(currentbar+year2,ivlow3,currentbar+year3,ivlow3,color = lowlinecol, xloc = xloc.bar_time)
lowlabel3 := label.new(currentbar+year3,ivlow3,text = "Year 3 : " + str.tostring(ivlow3), style = label.style_label_lower_right, textcolor = lowlinecol, color = transpcol, xloc = xloc.bar_time)


linelow6 := line.new(currentbar+year3,ivlow3,currentbar+year3,ivlow4,color = lowlinecol, xloc = xloc.bar_time)
linelow7 := line.new(currentbar+year3,ivlow4,currentbar+year4,ivlow4,color = lowlinecol, xloc = xloc.bar_time)
lowlabel4 := label.new(currentbar+year4,ivlow4,text = "Year 4 : " + str.tostring(ivlow4), style = label.style_label_lower_right, textcolor = lowlinecol, color = transpcol, xloc = xloc.bar_time)


linelow8 := line.new(currentbar+year4,ivlow4,currentbar+year4,ivlow5,color = lowlinecol, xloc = xloc.bar_time)
linelow9 := line.new(currentbar+year4,ivlow5,currentbar+year5,ivlow5,color = lowlinecol, xloc = xloc.bar_time)
lowlabel5 := label.new(currentbar+year5,ivlow5,text = "Year 5 : " + str.tostring(ivlow5), style = label.style_label_lower_right, textcolor = lowlinecol, color = transpcol, xloc = xloc.bar_time)


//MED Lines
var line linemed1 = na
var line linemed2 = na
var line linemed3 = na
var line linemed4 = na
var line linemed5 = na
var line linemed6 = na
var line linemed7 = na
var line linemed8 = na
var line linemed9 = na

var label medlabel1 = na
var label medlabel2 = na
var label medlabel3 = na
var label medlabel4 = na
var label medlabel5 = na


line.delete(linemed1)
line.delete(linemed2)
line.delete(linemed3)
line.delete(linemed4)
line.delete(linemed5)
line.delete(linemed6)
line.delete(linemed7)
line.delete(linemed8)
line.delete(linemed9)

label.delete(medlabel1)
label.delete(medlabel2)
label.delete(medlabel3)
label.delete(medlabel4)
label.delete(medlabel5)



linemed1 := line.new(currentbar,ivmed1,currentbar+year1,ivmed1,color = medlinecol, xloc = xloc.bar_time)
medlabel1 := label.new(currentbar+year1,ivmed1,text = "MEDIUM ASSUMPTION - Year 1 : " + str.tostring(ivmed1), style = label.style_label_lower_right, textcolor = medlinecol, color = transpcol, xloc = xloc.bar_time)

linemed2 := line.new(currentbar+year1,ivmed1,currentbar+year1,ivmed2,color = medlinecol, xloc = xloc.bar_time)
linemed3 := line.new(currentbar+year1,ivmed2,currentbar+year2,ivmed2,color = medlinecol, xloc = xloc.bar_time)
medlabel2 := label.new(currentbar+year2,ivmed2,text = "Year 2 : " + str.tostring(ivmed2), style = label.style_label_lower_right, textcolor = medlinecol, color = transpcol, xloc = xloc.bar_time)


linemed4 := line.new(currentbar+year2,ivmed2,currentbar+year2,ivmed3,color = medlinecol, xloc = xloc.bar_time)
linemed5 := line.new(currentbar+year2,ivmed3,currentbar+year3,ivmed3,color = medlinecol, xloc = xloc.bar_time)
medlabel3 := label.new(currentbar+year3,ivmed3,text = "Year 3 : " + str.tostring(ivmed3), style = label.style_label_lower_right, textcolor = medlinecol, color = transpcol, xloc = xloc.bar_time)


linemed6 := line.new(currentbar+year3,ivmed3,currentbar+year3,ivmed4,color = medlinecol, xloc = xloc.bar_time)
linemed7 := line.new(currentbar+year3,ivmed4,currentbar+year4,ivmed4,color = medlinecol, xloc = xloc.bar_time)
medlabel4 := label.new(currentbar+year4,ivmed4,text = "Year 4 : " + str.tostring(ivmed4), style = label.style_label_lower_right, textcolor = medlinecol, color = transpcol, xloc = xloc.bar_time)


linemed8 := line.new(currentbar+year4,ivmed4,currentbar+year4,ivmed5,color = medlinecol, xloc = xloc.bar_time)
linemed9 := line.new(currentbar+year4,ivmed5,currentbar+year5,ivmed5,color = medlinecol, xloc = xloc.bar_time)
medlabel5 := label.new(currentbar+year5,ivmed5,text = "Year 5 : " + str.tostring(ivmed5), style = label.style_label_lower_right, textcolor = medlinecol, color = transpcol, xloc = xloc.bar_time)






//HIGH Lines
var line linehigh1 = na
var line linehigh2 = na
var line linehigh3 = na
var line linehigh4 = na
var line linehigh5 = na
var line linehigh6 = na
var line linehigh7 = na
var line linehigh8 = na
var line linehigh9 = na

var label highlabel1 = na
var label highlabel2 = na
var label highlabel3 = na
var label highlabel4 = na
var label highlabel5 = na


line.delete(linehigh1)
line.delete(linehigh2)
line.delete(linehigh3)
line.delete(linehigh4)
line.delete(linehigh5)
line.delete(linehigh6)
line.delete(linehigh7)
line.delete(linehigh8)
line.delete(linehigh9)

label.delete(highlabel1)
label.delete(highlabel2)
label.delete(highlabel3)
label.delete(highlabel4)
label.delete(highlabel5)


linehigh1 := line.new(currentbar,ivhigh1,currentbar+year1,ivhigh1,color = highlinecol, xloc = xloc.bar_time)
highlabel1 := label.new(currentbar+year1,ivhigh1,text = "HIGH ASSUMPTION - Year 1 : " + str.tostring(ivhigh1), style = label.style_label_lower_right, textcolor = highlinecol, color = transpcol, xloc = xloc.bar_time)

linehigh2 := line.new(currentbar+year1,ivhigh1,currentbar+year1,ivhigh2,color = highlinecol, xloc = xloc.bar_time)
linehigh3 := line.new(currentbar+year1,ivhigh2,currentbar+year2,ivhigh2,color = highlinecol, xloc = xloc.bar_time)
highlabel2 := label.new(currentbar+year2,ivhigh2,text = "Year 2 : " + str.tostring(ivhigh2), style = label.style_label_lower_right, textcolor = highlinecol, color = transpcol, xloc = xloc.bar_time)


linehigh4 := line.new(currentbar+year2,ivhigh2,currentbar+year2,ivhigh3,color = highlinecol, xloc = xloc.bar_time)
linehigh5 := line.new(currentbar+year2,ivhigh3,currentbar+year3,ivhigh3,color = highlinecol, xloc = xloc.bar_time)
highlabel3 := label.new(currentbar+year3,ivhigh3,text = "Year 3 : " + str.tostring(ivhigh3), style = label.style_label_lower_right, textcolor = highlinecol, color = transpcol, xloc = xloc.bar_time)


linehigh6 := line.new(currentbar+year3,ivhigh3,currentbar+year3,ivhigh4,color = highlinecol, xloc = xloc.bar_time)
linehigh7 := line.new(currentbar+year3,ivhigh4,currentbar+year4,ivhigh4,color = highlinecol, xloc = xloc.bar_time)
highlabel4 := label.new(currentbar+year4,ivhigh4,text = "Year 4 : " + str.tostring(ivhigh4), style = label.style_label_lower_right, textcolor = highlinecol, color = transpcol, xloc = xloc.bar_time)


linehigh8 := line.new(currentbar+year4,ivhigh4,currentbar+year4,ivhigh5,color = highlinecol, xloc = xloc.bar_time)
linehigh9 := line.new(currentbar+year4,ivhigh5,currentbar+year5,ivhigh5,color = highlinecol, xloc = xloc.bar_time)
highlabel5 := label.new(currentbar+year5,ivhigh5,text = "Year 5 : " + str.tostring(ivhigh5), style = label.style_label_lower_right, textcolor = highlinecol, color = transpcol, xloc = xloc.bar_time)





////////////////TABLES

var financialTable = table.new(position = position.top_right, columns = 10, rows = 18, border_width = 1, border_color = color.aqua, frame_color = color.aqua, frame_width = 1)
var financialTable1 = table.new(position = position.top_center, columns = 10, rows = 18, border_width = 1, border_color = color.aqua, frame_color = color.aqua, frame_width = 1)
// plot(close)
// bgcolor1 = color.new(color.black,60)
// bgcolor2 = color.new(color.blue,85)
// textcol = color.rgb(255,255,255)
// textsize1 = size.large


//headinng
table.cell(table_id = financialTable1, column = 1, row = 1, text = "EPS : " + str.tostring(EPS), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)

// column 1
table.cell(table_id = financialTable, column = 1, row = 1, text = "Low Assumption", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 1, row = 2, text = "EPS Growth Per Year (" + str.tostring(epsgrowthlow*100) + " %)", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 1, row = 3, text = "Intrinsic Value", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
 
table.cell(table_id = financialTable, column = 1, row = 4, text = " ", bgcolor=bgcolor2, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 1, row = 5, text = "Medium Assumption", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 1, row = 6, text = "EPS Growth Per Year (" + str.tostring(epsgrowthmed*100) + " %)", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 1, row = 7, text = "Intrinsic Value", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 1, row = 8, text = " ", bgcolor=bgcolor2, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 1, row = 9, text = "High Assumption", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 1, row = 10, text = "EPS Growth Per Year (" + str.tostring(epsgrowthhigh*100) + " %)", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 1, row = 11, text = "Intrinsic Value", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)

// column 2
table.cell(table_id = financialTable, column = 2, row = 1, text = "Year 1", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 2, row = 2, text = str.tostring(EPS), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 2, row = 3, text = str.tostring(ivlow1), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
 
table.cell(table_id = financialTable, column = 2, row = 4, text = " ", bgcolor=bgcolor2, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 2, row = 5, text = "Year 1", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 2, row = 6, text = str.tostring(EPS), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 2, row = 7, text = str.tostring(ivmed1), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 2, row = 8, text = " ", bgcolor=bgcolor2, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 2, row = 9, text = "Year 1", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 2, row = 10, text = str.tostring(EPS), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 2, row = 11, text = str.tostring(ivhigh1), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)

// column 3
table.cell(table_id = financialTable, column = 3, row = 1, text = "Year 2", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 3, row = 2, text = str.tostring(epslow2), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 3, row = 3, text = str.tostring(ivlow2), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
 
table.cell(table_id = financialTable, column = 3, row = 4, text = " ", bgcolor=bgcolor2, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 3, row = 5, text = "Year 2", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 3, row = 6, text = str.tostring(epsmed2), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 3, row = 7, text = str.tostring(ivmed2), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 3, row = 8, text = " ", bgcolor=bgcolor2, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 3, row = 9, text = "Year 2", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 3, row = 10, text = str.tostring(epshigh2), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 3, row = 11, text = str.tostring(ivhigh2), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)

// column 4
table.cell(table_id = financialTable, column = 4, row = 1, text = "Year 3", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 4, row = 2, text = str.tostring(epslow3), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 4, row = 3, text = str.tostring(ivlow3), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
 
table.cell(table_id = financialTable, column = 4, row = 4, text = " ", bgcolor=bgcolor2, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 4, row = 5, text = "Year 3", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 4, row = 6, text = str.tostring(epsmed3), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 4, row = 7, text = str.tostring(ivmed3), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 4, row = 8, text = " ", bgcolor=bgcolor2, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 4, row = 9, text = "Year 3", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 4, row = 10, text = str.tostring(epshigh3), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 4, row = 11, text = str.tostring(ivhigh3), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)

// column 5
table.cell(table_id = financialTable, column = 5, row = 1, text = "Year 4", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 5, row = 2, text = str.tostring(epslow4), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 5, row = 3, text = str.tostring(ivlow4), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
 
table.cell(table_id = financialTable, column = 5, row = 4, text = " ", bgcolor=bgcolor2, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 5, row = 5, text = "Year 4", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 5, row = 6, text = str.tostring(epsmed4), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 5, row = 7, text = str.tostring(ivmed4), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 5, row = 8, text = " ", bgcolor=bgcolor2, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 5, row = 9, text = "Year 4", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 5, row = 10, text = str.tostring(epshigh4), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 5, row = 11, text = str.tostring(ivlow4), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)

// column 6
table.cell(table_id = financialTable, column = 6, row = 1, text = "Year 5", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 6, row = 2, text = str.tostring(epslow5), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 6, row = 3, text = str.tostring(ivlow5), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
 
table.cell(table_id = financialTable, column = 6, row = 4, text = " ", bgcolor=bgcolor2, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 6, row = 5, text = "Year 5", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 6, row = 6, text = str.tostring(epsmed5), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 6, row = 7, text = str.tostring(ivmed5), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 6, row = 8, text = " ", bgcolor=bgcolor2, text_color=textcol, text_size = textsize1)

table.cell(table_id = financialTable, column = 6, row = 9, text = "Year 5", bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 6, row = 10, text = str.tostring(epshigh5), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)
table.cell(table_id = financialTable, column = 6, row = 11, text = str.tostring(ivhigh5), bgcolor=bgcolor1, text_color=textcol, text_size = textsize1)


// alertcondition(ta.cross(close,ivlow1),"")




