Portfolio_Tracking_TR
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © @volkankocabas_

//@version=5
indicator("Portföy Takip", shorttitle="Portföy Takip", overlay = true)

//Tables On/Off
dataTableOn = input.bool(true, title="Tablo Aç/Kapa", group="Info Table")

//Table Positions
bright = position.bottom_right
bleft = position.bottom_left
bcenter = position.bottom_center
tright = position.top_right
tleft = position.top_left
tcenter = position.top_center
mright = position.middle_right
mleft = position.middle_left
mcenter = position.middle_center
tablePosition = input.string(tright, title="Tablo Yeri", options=[bright, bleft, bcenter, tright, tleft, tcenter, mright, mleft, mcenter], group="Info Table")

//Ticker #1
ticker1On = input.bool(true, title="Aç/Kapa", group="Hisse #1")
ticker1 = input.symbol("BIST_DLY:GARAN", title="Ticker", group="Hisse #1")
ticker1OrderSize = input.float(100, title="# Hisse Sayısı", group="Hisse #1")
ticker1EntryPrice = input.float( 1,title="Maliyet", group="Hisse #1")
ticker1Price = request.security(ticker1, "", close, barmerge.gaps_off, ignore_invalid_symbol=true)
ticker1PriceClose = request.security(ticker1, "D", close[1], barmerge.gaps_off, ignore_invalid_symbol=true)
ticker1Pnl = ticker1Price > ticker1EntryPrice ? ((ticker1Price - ticker1EntryPrice) / ticker1EntryPrice) : ((ticker1EntryPrice - ticker1Price) / ticker1EntryPrice)
ticker1PnlText = ticker1Price > ticker1EntryPrice ? str.tostring(ticker1Pnl*100, format.percent) : "-" +str.tostring(ticker1Pnl*100, format.percent)
ticker1Value = ticker1Price * ticker1OrderSize
ticker1ValueText = str.tostring(ticker1Value) + " TL"
if not ticker1On
    ticker1OrderSize := 0.0
    ticker1Value := 0.0

//Ticker #2
ticker2On = input.bool(true, title="Aç/Kapa", group="Hisse #2")
ticker2 = input.symbol("BIST_DLY:EREGL", title="Ticker", group="Hisse #2")
ticker2OrderSize = input.float(100, title="# Hisse Sayısı", group="Hisse #2")
ticker2EntryPrice = input.float(1, title="Maliyet", group="Hisse #2")
ticker2Price = request.security(ticker2, "", close, barmerge.gaps_off, ignore_invalid_symbol=true)
ticker2PriceClose = request.security(ticker2, "D", close[1], barmerge.gaps_off, ignore_invalid_symbol=true)
ticker2Pnl = ticker2Price > ticker2EntryPrice ? ((ticker2Price - ticker2EntryPrice) / ticker2EntryPrice) : ((ticker2EntryPrice - ticker2Price) / ticker2EntryPrice)
ticker2PnlText = ticker2Price > ticker2EntryPrice ? str.tostring(ticker2Pnl*100, format.percent) : "-" +str.tostring(ticker2Pnl*100, format.percent)
ticker2Value = ticker2Price * ticker2OrderSize
ticker2ValueText = str.tostring(ticker2Value) + " TL"
if not ticker2On
    ticker2OrderSize := 0.0
    ticker2Value := 0.0

//Ticker #3
ticker3On = input.bool(true, title="Aç/Kapa", group="Hisse #3")
ticker3 = input.symbol("BIST_DLY:PETKM", title="Ticker", group="Hisse #3")
ticker3OrderSize = input.float(100, title="# Hisse Sayısı", group="Hisse #3")
ticker3EntryPrice = input.float(1, title="Maliyet", group="Hisse #3")
ticker3Price = request.security(ticker3, "", close, barmerge.gaps_off, ignore_invalid_symbol=true)
ticker3PriceClose = request.security(ticker3, "D", close[1], barmerge.gaps_off, ignore_invalid_symbol=true)
ticker3Pnl = ticker3Price > ticker3EntryPrice ? ((ticker3Price - ticker3EntryPrice) / ticker3EntryPrice) : ((ticker3EntryPrice - ticker3Price) / ticker3EntryPrice)
ticker3PnlText = ticker3Price > ticker3EntryPrice ? str.tostring(ticker3Pnl*100, format.percent) : "-" +str.tostring(ticker3Pnl*100, format.percent)
ticker3Value = ticker3Price * ticker3OrderSize
ticker3ValueText = str.tostring(ticker3Value) + " TL"
if not ticker3On
    ticker3OrderSize := 0.0
    ticker3Value := 0.0

//Ticker #4
ticker4On = input.bool(true, title="Aç/Kapa", group="Hisse #4")
ticker4 = input.symbol("BIST_DLY:KRDMD", title="Ticker", group="Hisse #4")
ticker4OrderSize = input.float(100, title="# Hisse Sayısı", group="Hisse #4")
ticker4EntryPrice = input.float(1, title="Maliyet", group="Hisse #4")
ticker4Price = request.security(ticker4, "", close, barmerge.gaps_off, ignore_invalid_symbol=true)
ticker4PriceClose = request.security(ticker4, "D", close[1], barmerge.gaps_off, ignore_invalid_symbol=true)
ticker4Pnl = ticker4Price > ticker4EntryPrice ? ((ticker4Price - ticker4EntryPrice) / ticker4EntryPrice) : ((ticker4EntryPrice - ticker4Price) / ticker4EntryPrice)
ticker4PnlText = ticker4Price > ticker4EntryPrice ? str.tostring(ticker4Pnl*100, format.percent) : "-" +str.tostring(ticker4Pnl*100, format.percent)
ticker4Value = ticker4Price * ticker4OrderSize
ticker4ValueText = str.tostring(ticker4Value) + " TL"
if not ticker4On
    ticker4OrderSize := 0.0
    ticker4Value := 0.0

//Ticker #5
ticker5On = input.bool(true, title="Aç/Kapa", group="Hisse #5")
ticker5 = input.symbol("BIST_DLY:KOZAL", title="Ticker", group="Hisse #5")
ticker5OrderSize = input.float(100, title="# Hisse Sayısı", group="Hisse #5")
ticker5EntryPrice = input.float(1, title="Maliyet", group="Hisse #5")
ticker5Price = request.security(ticker5, "", close, barmerge.gaps_off, ignore_invalid_symbol=true)
ticker5PriceClose = request.security(ticker5, "D", close[1], barmerge.gaps_off, ignore_invalid_symbol=true)
ticker5Pnl = ticker5Price > ticker5EntryPrice ? ((ticker5Price - ticker5EntryPrice) / ticker5EntryPrice) : ((ticker5EntryPrice - ticker5Price) / ticker5EntryPrice)
ticker5PnlText = ticker5Price > ticker5EntryPrice ? str.tostring(ticker5Pnl*100, format.percent) : "-" +str.tostring(ticker5Pnl*100, format.percent)
ticker5Value = ticker5Price * ticker5OrderSize
ticker5ValueText = str.tostring(ticker5Value) + " TL"
if not ticker5On
    ticker5OrderSize := 0.0
    ticker5Value := 0.0

//Ticker #6
ticker6On = input.bool(true, title="Aç/Kapa", group="Hisse #6")
ticker6 = input.symbol("BIST_DLY:SISE", title="Ticker", group="Hisse #6")
ticker6OrderSize = input.float(100, title="# Hisse Sayısı", group="Hisse #6")
ticker6EntryPrice = input.float(1, title="Maliyet", group="Hisse #6")
ticker6Price = request.security(ticker6, "", close, barmerge.gaps_off, ignore_invalid_symbol=true)
ticker6PriceClose = request.security(ticker6, "D", close[1], barmerge.gaps_off, ignore_invalid_symbol=true)
ticker6Pnl = ticker6Price > ticker6EntryPrice ? ((ticker6Price - ticker6EntryPrice) / ticker6EntryPrice) : ((ticker6EntryPrice - ticker6Price) / ticker6EntryPrice)
ticker6PnlText = ticker6Price > ticker6EntryPrice ? str.tostring(ticker6Pnl*100, format.percent) : "-" +str.tostring(ticker6Pnl*100, format.percent)
ticker6Value = ticker6Price * ticker6OrderSize
ticker6ValueText = str.tostring(ticker6Value) + " TL"
if not ticker6On
    ticker6OrderSize := 0.0
    ticker6Value := 0.0

//Ticker #7
ticker7On = input.bool(true, title="Aç/Kapa", group="Hisse #7")
ticker7 = input.symbol("BIST_DLY:TUPRS", title="Ticker", group="Hisse #7")
ticker7OrderSize = input.float(100, title="# Hisse Sayısı", group="Hisse #7")
ticker7EntryPrice = input.float(1, title="Maliyet", group="Hisse #7")
ticker7Price = request.security(ticker7, "", close, barmerge.gaps_off, ignore_invalid_symbol=true)
ticker7PriceClose = request.security(ticker7, "D", close[1], barmerge.gaps_off, ignore_invalid_symbol=true)
ticker7Pnl = ticker7Price > ticker7EntryPrice ? ((ticker7Price - ticker7EntryPrice) / ticker7EntryPrice) : ((ticker7EntryPrice - ticker7Price) / ticker7EntryPrice)
ticker7PnlText = ticker7Price > ticker7EntryPrice ? str.tostring(ticker7Pnl*100, format.percent) : "-" +str.tostring(ticker7Pnl*100, format.percent)
ticker7Value = ticker7Price * ticker7OrderSize
ticker7ValueText = str.tostring(ticker7Value) + " TL"
if not ticker7On
    ticker7OrderSize := 0.0
    ticker7Value := 0.0

//Ticker #8
ticker8On = input.bool(true, title="Aç/Kapa", group="Hisse #8")
ticker8 = input.symbol("BIST_DLY:THYAO", title="Ticker", group="Hisse #8")
ticker8OrderSize = input.float(100, title="# Hisse Sayısı", group="Hisse #8")
ticker8EntryPrice = input.float(1, title="Maliyet", group="Hisse #8")
ticker8Price = request.security(ticker8, "", close, barmerge.gaps_off, ignore_invalid_symbol=true)
ticker8PriceClose = request.security(ticker8, "D", close[1], barmerge.gaps_off, ignore_invalid_symbol=true)
ticker8Pnl = ticker8Price > ticker8EntryPrice ? ((ticker8Price - ticker8EntryPrice) / ticker8EntryPrice) : ((ticker8EntryPrice - ticker8Price) / ticker8EntryPrice)
ticker8PnlText = ticker8Price > ticker8EntryPrice ? str.tostring(ticker8Pnl*100, format.percent) : "-" +str.tostring(ticker8Pnl*100, format.percent)
ticker8Value = ticker8Price * ticker8OrderSize
ticker8ValueText = str.tostring(ticker8Value) + " TL"
if not ticker8On
    ticker8OrderSize := 0.0
    ticker8Value := 0.0

//Ticker #9
ticker9On = input.bool(true, title="Aç/Kapa", group="Hisse #9")
ticker9 = input.symbol("BIST_DLY:FROTO", title="Ticker", group="Hisse #9")
ticker9OrderSize = input.float(100, title="# Hisse Sayısı", group="Hisse #9")
ticker9EntryPrice = input.float(1, title="Maliyet", group="Hisse #9")
ticker9Price = request.security(ticker9, "", close, barmerge.gaps_off, ignore_invalid_symbol=true)
ticker9PriceClose = request.security(ticker9, "D", close[1], barmerge.gaps_off, ignore_invalid_symbol=true)
ticker9Pnl = ticker9Price > ticker9EntryPrice ? ((ticker9Price - ticker9EntryPrice) / ticker9EntryPrice) : ((ticker9EntryPrice - ticker9Price) / ticker9EntryPrice)
ticker9PnlText = ticker9Price > ticker9EntryPrice ? str.tostring(ticker9Pnl*100, format.percent) : "-" +str.tostring(ticker9Pnl*100, format.percent)
ticker9Value = ticker9Price * ticker9OrderSize
ticker9ValueText = str.tostring(ticker9Value) + " TL"
if not ticker9On
    ticker9OrderSize := 0.0
    ticker9Value := 0.0

//Ticker #10
ticker10On = input.bool(true, title="Aç/Kapa", group="Hisse #10")
ticker10 = input.symbol("BIST_DLY:AKBNK", title="Ticker", group="Hisse #10")
ticker10OrderSize = input.float(100, title="# Hisse Sayısı", group="Hisse #10")
ticker10EntryPrice = input.float(1, title="Maliyet", group="Hisse #10")
ticker10Price = request.security(ticker10, "", close, barmerge.gaps_off, ignore_invalid_symbol=true)
ticker10PriceClose = request.security(ticker10, "D", close[1], barmerge.gaps_off, ignore_invalid_symbol=true)
ticker10Pnl = ticker10Price > ticker10EntryPrice ? ((ticker10Price - ticker10EntryPrice) / ticker10EntryPrice) : ((ticker10EntryPrice - ticker10Price) / ticker10EntryPrice)
ticker10PnlText = ticker10Price > ticker10EntryPrice ? str.tostring(ticker10Pnl*100, format.percent) : "-" +str.tostring(ticker10Pnl*100, format.percent)
ticker10Value = ticker10Price * ticker10OrderSize
ticker10ValueText = str.tostring(ticker10Value) + " TL"
if not ticker10On
    ticker10OrderSize := 0.0
    ticker10Value := 0.0

//Ticker #11
ticker11On = input.bool(true, title="Aç/Kapa", group="Hisse #11")
ticker11 = input.symbol("BIST_DLY:KCHOL", title="Ticker", group="PHisse #11")
ticker11OrderSize = input.float(100, title="# Hisse Sayısı", group="Hisse #11")
ticker11EntryPrice = input.float(1, title="Maliyet", group="Hisse #11")
ticker11Price = request.security(ticker11, "", close, barmerge.gaps_off, ignore_invalid_symbol=true)
ticker11PriceClose = request.security(ticker11, "D", close[1], barmerge.gaps_off, ignore_invalid_symbol=true)
ticker11Pnl = ticker11Price > ticker11EntryPrice ? ((ticker11Price - ticker11EntryPrice) / ticker11EntryPrice) : ((ticker11EntryPrice - ticker11Price) / ticker11EntryPrice)
ticker11PnlText = ticker11Price > ticker11EntryPrice ? str.tostring(ticker11Pnl*100, format.percent) : "-" +str.tostring(ticker11Pnl*100, format.percent)
ticker11Value = ticker11Price * ticker11OrderSize
ticker11ValueText = str.tostring(ticker11Value) + " TL"
if not ticker11On
    ticker11OrderSize := 0.0
    ticker11Value := 0.0

//Ticker #12
ticker12On = input.bool(true, title="Aç/Kapa", group="Hisse #12")
ticker12 = input.symbol("BIST_DLY:DOHOL", title="Ticker", group="Hisse #12")
ticker12OrderSize = input.float(100, title="# Hisse Sayısı", group="Hisse #12")
ticker12EntryPrice = input.float(1, title="Maliyet", group="Hisse #12")
ticker12Price = request.security(ticker12, "", close, barmerge.gaps_off, ignore_invalid_symbol=true)
ticker12PriceClose = request.security(ticker12, "D", close[1], barmerge.gaps_off, ignore_invalid_symbol=true)
ticker12Pnl = ticker12Price > ticker12EntryPrice ? ((ticker12Price - ticker12EntryPrice) / ticker12EntryPrice) : ((ticker12EntryPrice - ticker12Price) / ticker12EntryPrice)
ticker12PnlText = ticker12Price > ticker12EntryPrice ? str.tostring(ticker12Pnl*100, format.percent) : "-" +str.tostring(ticker12Pnl*100, format.percent)
ticker12Value = ticker12Price * ticker12OrderSize
ticker12ValueText = str.tostring(ticker12Value) + " TL"
if not ticker12On
    ticker12OrderSize := 0.0
    ticker12Value := 0.0

//Change Background Color Of Cells For Positive/Negative Percentages
ticker1Color = color.maroon
ticker2Color = color.maroon
ticker3Color = color.maroon
ticker4Color = color.maroon
ticker5Color = color.maroon
ticker6Color = color.maroon
ticker7Color = color.maroon
ticker8Color = color.maroon
ticker9Color = color.maroon
ticker10Color = color.maroon
ticker11Color = color.maroon
ticker12Color = color.maroon

ticker1ValueColor = color.maroon
ticker2ValueColor = color.blue
ticker3ValueColor = color.blue
ticker4ValueColor = color.blue
ticker5ValueColor = color.blue
ticker6ValueColor = color.blue
ticker7ValueColor = color.blue
ticker8ValueColor = color.blue
ticker9ValueColor = color.blue
ticker10ValueColor = color.blue
ticker11ValueColor = color.blue
ticker12ValueColor = color.blue

if ticker1Price > ticker1EntryPrice
    ticker1Color := color.green
    ticker1ValueColor := color.green
else if ticker1Price < ticker1EntryPrice
    ticker1Color := color.red
    ticker1ValueColor := color.red

if ticker2Price > ticker2EntryPrice
    ticker2Color := color.green
    ticker2ValueColor := color.green
else if ticker2Price < ticker2EntryPrice
    ticker2Color := color.red
    ticker2ValueColor := color.red

if ticker3Price > ticker3EntryPrice
    ticker3Color := color.green
    ticker3ValueColor := color.green
else if ticker3Price < ticker3EntryPrice
    ticker3Color := color.red
    ticker3ValueColor := color.red

if ticker4Price > ticker4EntryPrice
    ticker4Color := color.green
    ticker4ValueColor := color.green
else if ticker4Price < ticker4EntryPrice
    ticker4Color := color.red
    ticker4ValueColor := color.red

if ticker5Price > ticker5EntryPrice
    ticker5Color := color.green
    ticker5ValueColor := color.green
else if ticker5Price < ticker5EntryPrice
    ticker5Color := color.red
    ticker5ValueColor := color.red

if ticker6Price > ticker6EntryPrice
    ticker6Color := color.green
    ticker6ValueColor := color.green
else if ticker6Price < ticker6EntryPrice
    ticker6Color := color.red
    ticker6ValueColor := color.red

if ticker7Price > ticker7EntryPrice
    ticker7Color := color.green
    ticker7ValueColor := color.green
else if ticker7Price < ticker7EntryPrice
    ticker7Color := color.red
    ticker7ValueColor := color.red

if ticker8Price > ticker8EntryPrice
    ticker8Color := color.green
    ticker8ValueColor := color.green
else if ticker8Price < ticker8EntryPrice
    ticker8Color := color.red
    ticker8ValueColor := color.red

if ticker9Price > ticker9EntryPrice
    ticker9Color := color.green
    ticker9ValueColor := color.green
else if ticker9Price < ticker9EntryPrice
    ticker9Color := color.red
    ticker9ValueColor := color.red

if ticker10Price > ticker10EntryPrice
    ticker10Color := color.green
    ticker10ValueColor := color.green
else if ticker10Price < ticker10EntryPrice
    ticker10Color := color.red
    ticker10ValueColor := color.red

if ticker11Price > ticker11EntryPrice
    ticker11Color := color.green
    ticker11ValueColor := color.green
else if ticker11Price < ticker11EntryPrice
    ticker11Color := color.red
    ticker11ValueColor := color.red

if ticker12Price > ticker12EntryPrice
    ticker12Color := color.green
    ticker12ValueColor := color.green
else if ticker12Price < ticker12EntryPrice
    ticker12Color := color.red
    ticker12ValueColor := color.red

//Calculate Portfolio Percentages
ticker1PortfolioPercent = ticker1Value / (ticker1Value + ticker2Value + ticker3Value + ticker4Value + ticker4Value + ticker5Value + ticker6Value + ticker7Value + ticker8Value + ticker9Value + ticker10Value + ticker11Value + ticker12Value)
ticker2PortfolioPercent = ticker2Value / (ticker1Value + ticker2Value + ticker3Value + ticker4Value + ticker4Value + ticker5Value + ticker6Value + ticker7Value + ticker8Value + ticker9Value + ticker10Value + ticker11Value + ticker12Value)
ticker3PortfolioPercent = ticker3Value / (ticker1Value + ticker2Value + ticker3Value + ticker4Value + ticker4Value + ticker5Value + ticker6Value + ticker7Value + ticker8Value + ticker9Value + ticker10Value + ticker11Value + ticker12Value)
ticker4PortfolioPercent = ticker4Value / (ticker1Value + ticker2Value + ticker3Value + ticker4Value + ticker4Value + ticker5Value + ticker6Value + ticker7Value + ticker8Value + ticker9Value + ticker10Value + ticker11Value + ticker12Value)
ticker5PortfolioPercent = ticker5Value / (ticker1Value + ticker2Value + ticker3Value + ticker4Value + ticker4Value + ticker5Value + ticker6Value + ticker7Value + ticker8Value + ticker9Value + ticker10Value + ticker11Value + ticker12Value)
ticker6PortfolioPercent = ticker6Value / (ticker1Value + ticker2Value + ticker3Value + ticker4Value + ticker4Value + ticker5Value + ticker6Value + ticker7Value + ticker8Value + ticker9Value + ticker10Value + ticker11Value + ticker12Value)
ticker7PortfolioPercent = ticker7Value / (ticker1Value + ticker2Value + ticker3Value + ticker4Value + ticker4Value + ticker5Value + ticker6Value + ticker7Value + ticker8Value + ticker9Value + ticker10Value + ticker11Value + ticker12Value)
ticker8PortfolioPercent = ticker8Value / (ticker1Value + ticker2Value + ticker3Value + ticker4Value + ticker4Value + ticker5Value + ticker6Value + ticker7Value + ticker8Value + ticker9Value + ticker10Value + ticker11Value + ticker12Value)
ticker9PortfolioPercent = ticker9Value / (ticker1Value + ticker2Value + ticker3Value + ticker4Value + ticker4Value + ticker5Value + ticker6Value + ticker7Value + ticker8Value + ticker9Value + ticker10Value + ticker11Value + ticker12Value)
ticker10PortfolioPercent = ticker10Value / (ticker1Value + ticker2Value + ticker3Value + ticker4Value + ticker4Value + ticker5Value + ticker6Value + ticker7Value + ticker8Value + ticker9Value + ticker10Value + ticker11Value + ticker12Value)
ticker11PortfolioPercent = ticker11Value / (ticker1Value + ticker2Value + ticker3Value + ticker4Value + ticker4Value + ticker5Value + ticker6Value + ticker7Value + ticker8Value + ticker9Value + ticker10Value + ticker11Value + ticker12Value)
ticker12PortfolioPercent = ticker12Value / (ticker1Value + ticker2Value + ticker3Value + ticker4Value + ticker4Value + ticker5Value + ticker6Value + ticker7Value + ticker8Value + ticker9Value + ticker10Value + ticker11Value + ticker12Value)

ticker1PortfolioPercentText = str.tostring(ticker1PortfolioPercent*100, format.percent)
ticker2PortfolioPercentText = str.tostring(ticker2PortfolioPercent*100, format.percent)
ticker3PortfolioPercentText = str.tostring(ticker3PortfolioPercent*100, format.percent)
ticker4PortfolioPercentText = str.tostring(ticker4PortfolioPercent*100, format.percent)
ticker5PortfolioPercentText = str.tostring(ticker5PortfolioPercent*100, format.percent)
ticker6PortfolioPercentText = str.tostring(ticker6PortfolioPercent*100, format.percent)
ticker7PortfolioPercentText = str.tostring(ticker7PortfolioPercent*100, format.percent)
ticker8PortfolioPercentText = str.tostring(ticker8PortfolioPercent*100, format.percent)
ticker9PortfolioPercentText = str.tostring(ticker9PortfolioPercent*100, format.percent)
ticker10PortfolioPercentText = str.tostring(ticker10PortfolioPercent*100, format.percent)
ticker11PortfolioPercentText = str.tostring(ticker11PortfolioPercent*100, format.percent)
ticker12PortfolioPercentText = str.tostring(ticker12PortfolioPercent*100, format.percent)

//Today % Gain Calculations
ticker1TodayGain = ticker1Price >= ticker1PriceClose ? ((ticker1Price - ticker1PriceClose) / ticker1PriceClose) * 100 : ((ticker1PriceClose - ticker1Price) / ticker1PriceClose) * -100
ticker1TodayGainText = str.tostring(ticker1TodayGain, "#.##") + "%"
ticker1TodayGainColor = ticker1Price > ticker1PriceClose ? color.green : ticker1Price < ticker1PriceClose ? color.red : color.blue

ticker2TodayGain = ticker2Price >= ticker2PriceClose ? ((ticker2Price - ticker2PriceClose) / ticker2PriceClose) * 100 : ((ticker2PriceClose - ticker2Price) / ticker2PriceClose) * -100
ticker2TodayGainText = str.tostring(ticker2TodayGain, "#.##") + "%"
ticker2TodayGainColor = ticker2Price > ticker2PriceClose ? color.green : ticker2Price < ticker2PriceClose ? color.red : color.blue

ticker3TodayGain = ticker3Price >= ticker3PriceClose ? ((ticker3Price - ticker3PriceClose) / ticker3PriceClose) * 100 : ((ticker3PriceClose - ticker3Price) / ticker3PriceClose) * -100
ticker3TodayGainText = str.tostring(ticker3TodayGain, "#.##") + "%"
ticker3TodayGainColor = ticker3Price > ticker3PriceClose ? color.green : ticker3Price < ticker3PriceClose ? color.red : color.blue

ticker4TodayGain = ticker4Price >= ticker4PriceClose ? ((ticker4Price - ticker4PriceClose) / ticker4PriceClose) * 100 : ((ticker4PriceClose - ticker4Price) / ticker4PriceClose) * -100
ticker4TodayGainText = str.tostring(ticker4TodayGain, "#.##") + "%"
ticker4TodayGainColor = ticker4Price > ticker4PriceClose ? color.green : ticker4Price < ticker4PriceClose ? color.red : color.blue

ticker5TodayGain = ticker5Price >= ticker5PriceClose ? ((ticker5Price - ticker5PriceClose) / ticker5PriceClose) * 100 : ((ticker5PriceClose - ticker5Price) / ticker5PriceClose) * -100
ticker5TodayGainText = str.tostring(ticker5TodayGain, "#.##") + "%"
ticker5TodayGainColor = ticker5Price > ticker5PriceClose ? color.green : ticker5Price < ticker5PriceClose ? color.red : color.blue

ticker6TodayGain = ticker6Price >= ticker6PriceClose ? ((ticker6Price - ticker6PriceClose) / ticker6PriceClose) * 100 : ((ticker6PriceClose - ticker6Price) / ticker6PriceClose) * -100
ticker6TodayGainText = str.tostring(ticker6TodayGain, "#.##") + "%"
ticker6TodayGainColor = ticker6Price > ticker6PriceClose ? color.green : ticker6Price < ticker6PriceClose ? color.red : color.blue

ticker7TodayGain = ticker7Price >= ticker7PriceClose ? ((ticker7Price - ticker7PriceClose) / ticker7PriceClose) * 100 : ((ticker7PriceClose - ticker7Price) / ticker7PriceClose) * -100
ticker7TodayGainText = str.tostring(ticker7TodayGain, "#.##") + "%"
ticker7TodayGainColor = ticker7Price > ticker7PriceClose ? color.green : ticker7Price < ticker7PriceClose ? color.red : color.blue

ticker8TodayGain = ticker8Price >= ticker8PriceClose ? ((ticker8Price - ticker8PriceClose) / ticker8PriceClose) * 100 : ((ticker8PriceClose - ticker8Price) / ticker8PriceClose) * -100
ticker8TodayGainText = str.tostring(ticker8TodayGain, "#.##") + "%"
ticker8TodayGainColor = ticker8Price > ticker8PriceClose ? color.green : ticker8Price < ticker8PriceClose ? color.red : color.blue

ticker9TodayGain = ticker9Price >= ticker9PriceClose ? ((ticker9Price - ticker9PriceClose) / ticker9PriceClose) * 100 : ((ticker9PriceClose - ticker9Price) / ticker9PriceClose) * -100
ticker9TodayGainText = str.tostring(ticker9TodayGain, "#.##") + "%"
ticker9TodayGainColor = ticker9Price > ticker9PriceClose ? color.green : ticker9Price < ticker9PriceClose ? color.red : color.blue

ticker10TodayGain = ticker10Price >= ticker10PriceClose ? ((ticker10Price - ticker10PriceClose) / ticker10PriceClose) * 100 : ((ticker10PriceClose - ticker10Price) / ticker10PriceClose) * -100
ticker10TodayGainText = str.tostring(ticker10TodayGain, "#.##") + "%"
ticker10TodayGainColor = ticker10Price > ticker10PriceClose ? color.green : ticker10Price < ticker10PriceClose ? color.red : color.blue

ticker11TodayGain = ticker11Price >= ticker11PriceClose ? ((ticker11Price - ticker11PriceClose) / ticker11PriceClose) * 100 : ((ticker11PriceClose - ticker11Price) / ticker11PriceClose) * -100
ticker11TodayGainText = str.tostring(ticker11TodayGain, "#.##") + "%"
ticker11TodayGainColor = ticker11Price > ticker11PriceClose ? color.green : ticker11Price < ticker11PriceClose ? color.red : color.blue

ticker12TodayGain = ticker12Price >= ticker12PriceClose ? ((ticker12Price - ticker12PriceClose) / ticker12PriceClose) * 100 : ((ticker12PriceClose - ticker12Price) / ticker12PriceClose) * -100
ticker12TodayGainText = str.tostring(ticker12TodayGain, "#.##") + "%"
ticker12TodayGainColor = ticker12Price > ticker12PriceClose ? color.green : ticker12Price < ticker12PriceClose ? color.red : color.blue

//Overall Portfolio Calculations
startingCapital = (ticker1OrderSize * ticker1EntryPrice) + (ticker2OrderSize * ticker2EntryPrice) + (ticker3OrderSize * ticker3EntryPrice) + (ticker4OrderSize * ticker4EntryPrice) + (ticker5OrderSize * ticker5EntryPrice) + (ticker6OrderSize * ticker6EntryPrice) + (ticker7OrderSize * ticker7EntryPrice) + (ticker8OrderSize * ticker8EntryPrice) + (ticker9OrderSize * ticker9EntryPrice) + (ticker10OrderSize * ticker10EntryPrice) + (ticker11OrderSize * ticker11EntryPrice) + (ticker12OrderSize * ticker12EntryPrice)
startingCapitalText = str.tostring(startingCapital, "#.##") +" TL"

currentCapital = ticker1Value + ticker2Value + ticker3Value + ticker4Value + ticker5Value + ticker6Value + ticker7Value + ticker8Value + ticker9Value + ticker10Value + ticker11Value + ticker12Value
currentCapitalText = str.tostring(currentCapital, "#.##") + " TL"
currentCapitalColor = currentCapital > startingCapital ? color.green : currentCapital < startingCapital ? color.red : color.blue

overallProfitDollars = currentCapital >= startingCapital ? currentCapital - startingCapital : startingCapital - currentCapital
overallProfitDollarsText = currentCapital >= startingCapital ? str.tostring(overallProfitDollars, "#.##") + " TL" : str.tostring(overallProfitDollars, "#.##") + " -TL"
overallProfitDollarsColor = currentCapital > startingCapital ? color.green : currentCapital < startingCapital ? color.red : color.blue

overallProfitPercent = currentCapital >= startingCapital ? ((currentCapital - startingCapital) / startingCapital) * 100 : ((startingCapital - currentCapital) / startingCapital) * 100
overallProfitPercentText = currentCapital >= startingCapital ? str.tostring(overallProfitPercent, "#.##") + "%" : "-" + str.tostring(overallProfitPercent, "#.##") + "%"
overallProfitPercentColor = currentCapital > startingCapital ? color.green : currentCapital < startingCapital ? color.red : color.blue

overallGainToday = (((ticker1Price - ticker1PriceClose) * ticker1OrderSize) - (ticker1PriceClose * ticker1OrderSize)) + (((ticker2Price - ticker2PriceClose) * ticker2OrderSize) - (ticker2PriceClose * ticker2OrderSize)) + (((ticker3Price - ticker3PriceClose) * ticker3OrderSize) - (ticker3PriceClose * ticker3OrderSize)) + (((ticker4Price - ticker4PriceClose) * ticker4OrderSize) - (ticker4PriceClose * ticker4OrderSize)) + (((ticker5Price - ticker5PriceClose) * ticker5OrderSize) - (ticker5PriceClose * ticker5OrderSize)) + (((ticker6Price - ticker6PriceClose) * ticker6OrderSize) - (ticker6PriceClose * ticker6OrderSize)) + (((ticker7Price - ticker7PriceClose) * ticker7OrderSize) - (ticker7PriceClose * ticker7OrderSize)) + (((ticker8Price - ticker8PriceClose) * ticker8OrderSize) - (ticker8PriceClose * ticker8OrderSize)) + (((ticker9Price - ticker9PriceClose) * ticker9OrderSize) - (ticker9PriceClose * ticker9OrderSize)) + (((ticker10Price - ticker10PriceClose) * ticker10OrderSize) - (ticker10PriceClose * ticker10OrderSize)) + (((ticker11Price - ticker11PriceClose) * ticker11OrderSize) - (ticker11PriceClose * ticker11OrderSize)) + (((ticker12Price - ticker12PriceClose) * ticker12OrderSize) - (ticker12PriceClose * ticker12OrderSize))

overallValueYesterday = (ticker1PriceClose * ticker1OrderSize) + (ticker2PriceClose * ticker2OrderSize) + (ticker3PriceClose * ticker3OrderSize) + (ticker4PriceClose * ticker4OrderSize) + (ticker5PriceClose * ticker5OrderSize) + (ticker6PriceClose * ticker6OrderSize) + (ticker7PriceClose * ticker7OrderSize) + (ticker8PriceClose * ticker8OrderSize) + (ticker9PriceClose * ticker9OrderSize) + (ticker10PriceClose * ticker10OrderSize) + (ticker11PriceClose * ticker11OrderSize) + (ticker12PriceClose * ticker12OrderSize)
overallProfitTodayNumber = ((currentCapital - overallValueYesterday) / overallValueYesterday) * 100
overallProfitTodayText = str.tostring(overallProfitTodayNumber, "#.##") + "%"
overallProfitTodayColor = overallProfitTodayNumber > 0 ? color.green : overallProfitTodayNumber < 0 ? color.red : color.blue
//maliyet
maliyet1=str.tostring(ticker1EntryPrice)
maliyet2=str.tostring(ticker2EntryPrice)
maliyet3=str.tostring(ticker3EntryPrice)
maliyet4=str.tostring(ticker4EntryPrice)
maliyet5=str.tostring(ticker5EntryPrice)
maliyet6=str.tostring(ticker6EntryPrice)
maliyet7=str.tostring(ticker7EntryPrice)
maliyet8=str.tostring(ticker8EntryPrice)
maliyet9=str.tostring(ticker9EntryPrice)
maliyet10=str.tostring(ticker10EntryPrice)
maliyet11=str.tostring(ticker11EntryPrice)
maliyet12=str.tostring(ticker12EntryPrice)

//Hisse adedi
hisse1=str.tostring(ticker1OrderSize)
hisse2=str.tostring(ticker2OrderSize)
hisse3=str.tostring(ticker3OrderSize)
hisse4=str.tostring(ticker4OrderSize)
hisse5=str.tostring(ticker5OrderSize)
hisse6=str.tostring(ticker6OrderSize)
hisse7=str.tostring(ticker7OrderSize)
hisse8=str.tostring(ticker8OrderSize)
hisse9=str.tostring(ticker9OrderSize)
hisse10=str.tostring(ticker10OrderSize)
hisse11=str.tostring(ticker11OrderSize)
hisse12=str.tostring(ticker12OrderSize)
//Plot Data To Table
dataTable = table.new(tablePosition, columns=10, rows=20, bgcolor=color.blue, frame_color=color.white, frame_width=1, border_color=color.white, border_width=1)
if dataTableOn and barstate.islast
    table.cell(table_id=dataTable, column=0, row=0, text="Hisse Adı", height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.navy)
    table.cell(table_id=dataTable, column=1, row=0, text="Hisse Adedi", height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.navy)
    table.cell(table_id=dataTable, column=2, row=0, text="Maliyet", height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.navy)
    table.cell(table_id=dataTable, column=3+2, row=0, text="K/Z %", height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.navy)
    table.cell(table_id=dataTable, column=2+2, row=0, text="K/Z TL", height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.navy)
    table.cell(table_id=dataTable, column=1+2, row=0, text="Ağırlık", height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.navy)
    table.cell(table_id=dataTable, column=4+2, row=0, text="Bugün", height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.navy)    
    table.cell(table_id=dataTable, column=0, row=1, text=ticker1On ? ticker1 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=3+2, row=1, text=ticker1On ? ticker1PnlText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker1Color)
    table.cell(table_id=dataTable, column=2+2, row=1, text=ticker1On ? ticker1ValueText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker1ValueColor)
    table.cell(table_id=dataTable, column=1+2, row=1, text=ticker1On ? ticker1PortfolioPercentText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=4+2, row=1, text=ticker1On ? ticker1TodayGainText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker1TodayGainColor)
    table.cell(table_id=dataTable, column=0, row=2, text=ticker2On ? ticker2 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=3+2, row=2, text=ticker2On ? ticker2PnlText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker2Color)
    table.cell(table_id=dataTable, column=2+2, row=2, text=ticker2On ? ticker2ValueText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker2ValueColor)
    table.cell(table_id=dataTable, column=1+2, row=2, text=ticker2On ? ticker2PortfolioPercentText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=4+2, row=2, text=ticker2On ? ticker2TodayGainText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker2TodayGainColor)
    table.cell(table_id=dataTable, column=0, row=3, text=ticker3On ? ticker3 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=3+2, row=3, text=ticker3On ? ticker3PnlText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker3Color)
    table.cell(table_id=dataTable, column=2+2, row=3, text=ticker3On ? ticker3ValueText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker3ValueColor)
    table.cell(table_id=dataTable, column=1+2, row=3, text=ticker3On ? ticker3PortfolioPercentText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=4+2, row=3, text=ticker3On ? ticker3TodayGainText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker3TodayGainColor)
    table.cell(table_id=dataTable, column=0, row=4, text=ticker4On ? ticker4 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=3+2, row=4, text=ticker4On ? ticker4PnlText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker4Color)
    table.cell(table_id=dataTable, column=2+2, row=4, text=ticker4On ? ticker4ValueText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker4ValueColor)
    table.cell(table_id=dataTable, column=1+2, row=4, text=ticker4On ? ticker4PortfolioPercentText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=4+2, row=4, text=ticker4On ? ticker4TodayGainText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker4TodayGainColor)
    table.cell(table_id=dataTable, column=0, row=5, text=ticker5On ? ticker5 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=3+2, row=5, text=ticker5On ? ticker5PnlText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker5Color)
    table.cell(table_id=dataTable, column=2+2, row=5, text=ticker5On ? ticker5ValueText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker5ValueColor)
    table.cell(table_id=dataTable, column=1+2, row=5, text=ticker5On ? ticker5PortfolioPercentText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=4+2, row=5, text=ticker5On ? ticker5TodayGainText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker5TodayGainColor)
    table.cell(table_id=dataTable, column=0, row=6, text=ticker6On ? ticker6 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=3+2, row=6, text=ticker6On ? ticker6PnlText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker6Color)
    table.cell(table_id=dataTable, column=2+2, row=6, text=ticker6On ? ticker6ValueText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker6ValueColor)
    table.cell(table_id=dataTable, column=1+2, row=6, text=ticker6On ? ticker6PortfolioPercentText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=4+2, row=6, text=ticker6On ? ticker6TodayGainText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker6TodayGainColor)
    table.cell(table_id=dataTable, column=0, row=7, text=ticker7On ? ticker7 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=3+2, row=7, text=ticker7On ? ticker7PnlText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker7Color)
    table.cell(table_id=dataTable, column=2+2, row=7, text=ticker7On ? ticker7ValueText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker7ValueColor)
    table.cell(table_id=dataTable, column=1+2, row=7, text=ticker7On ? ticker7PortfolioPercentText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=4+2, row=7, text=ticker7On ? ticker7TodayGainText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker7TodayGainColor)
    table.cell(table_id=dataTable, column=0, row=8, text=ticker8On ? ticker8 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=3+2, row=8, text=ticker8On ? ticker8PnlText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker8Color)
    table.cell(table_id=dataTable, column=2+2, row=8, text=ticker8On ? ticker8ValueText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker8ValueColor)
    table.cell(table_id=dataTable, column=1+2, row=8, text=ticker8On ? ticker8PortfolioPercentText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=4+2, row=8, text=ticker8On ? ticker8TodayGainText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker8TodayGainColor)
    table.cell(table_id=dataTable, column=0, row=9, text=ticker9On ? ticker9 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=3+2, row=9, text=ticker9On ? ticker9PnlText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker9Color)
    table.cell(table_id=dataTable, column=2+2, row=9, text=ticker9On ? ticker9ValueText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker9ValueColor)
    table.cell(table_id=dataTable, column=1+2, row=9, text=ticker9On ? ticker9PortfolioPercentText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=4+2, row=9, text=ticker9On ? ticker9TodayGainText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker9TodayGainColor)
    table.cell(table_id=dataTable, column=0, row=10, text=ticker10On ? ticker10 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=3+2, row=10, text=ticker10On ? ticker10PnlText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker10Color)
    table.cell(table_id=dataTable, column=2+2, row=10, text=ticker10On ? ticker10ValueText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker10ValueColor)
    table.cell(table_id=dataTable, column=1+2, row=10, text=ticker10On ? ticker10PortfolioPercentText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=4+2, row=10, text=ticker10On ? ticker10TodayGainText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker10TodayGainColor)
    table.cell(table_id=dataTable, column=0, row=11, text=ticker11On ? ticker11 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=3+2, row=11, text=ticker11On ? ticker11PnlText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker11Color)
    table.cell(table_id=dataTable, column=2+2, row=11, text=ticker11On ? ticker11ValueText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker11ValueColor)
    table.cell(table_id=dataTable, column=1+2, row=11, text=ticker11On ? ticker11PortfolioPercentText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=4+2, row=11, text=ticker11On ? ticker11TodayGainText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker11TodayGainColor)
    table.cell(table_id=dataTable, column=0, row=12, text=ticker12On ? ticker12 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=3+2, row=12, text=ticker12On ? ticker12PnlText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker12Color)
    table.cell(table_id=dataTable, column=2+2, row=12, text=ticker12On ? ticker12ValueText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker12ValueColor)
    table.cell(table_id=dataTable, column=1+2, row=12, text=ticker12On ? ticker12PortfolioPercentText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=4+2, row=12, text=ticker12On ? ticker12TodayGainText : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=ticker12TodayGainColor)
    table.cell(table_id=dataTable, column=2, row=13, text="Toplam Yatırım", height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.navy)
    table.cell(table_id=dataTable, column=2, row=14, text=startingCapitalText, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center)
    table.cell(table_id=dataTable, column=1+2, row=13, text="Toplam Tutar", height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.navy)
    table.cell(table_id=dataTable, column=1+2, row=14, text=currentCapitalText, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=currentCapitalColor)
    table.cell(table_id=dataTable, column=2+2, row=13, text="Toplam K/Z TL", height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.navy)
    table.cell(table_id=dataTable, column=2+2, row=14, text=overallProfitDollarsText, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=overallProfitDollarsColor)
    table.cell(table_id=dataTable, column=3+2, row=13, text="Ort. K/Z %", height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.navy)
    table.cell(table_id=dataTable, column=3+2, row=14, text=overallProfitPercentText, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=overallProfitPercentColor)
    table.cell(table_id=dataTable, column=4+2, row=13, text="Bugün", height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.navy)
    table.cell(table_id=dataTable, column=4+2, row=14, text=overallProfitTodayText, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=overallProfitTodayColor)
    table.cell(table_id=dataTable, column=2, row=1, text=ticker1On ? maliyet1 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=2, row=2, text=ticker2On ? maliyet2 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=2, row=3, text=ticker3On ? maliyet3 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=2, row=4, text=ticker4On ? maliyet4 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=2, row=5, text=ticker5On ? maliyet5 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=2, row=6, text=ticker6On ? maliyet6 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=2, row=7, text=ticker7On ? maliyet7 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=2, row=8, text=ticker8On ? maliyet8 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=2, row=9, text=ticker9On ? maliyet9 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=2, row=10, text=ticker10On ? maliyet10 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=2, row=11, text=ticker11On ? maliyet11 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=2, row=12, text=ticker12On ? maliyet12 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=1, row=1, text=ticker1On ? hisse1 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=1, row=2, text=ticker2On ? hisse2 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=1, row=3, text=ticker3On ? hisse3 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=1, row=4, text=ticker4On ? hisse4 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=1, row=5, text=ticker5On ? hisse5 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=1, row=6, text=ticker6On ? hisse6 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=1, row=7, text=ticker7On ? hisse7 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=1, row=8, text=ticker8On ? hisse8 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=1, row=9, text=ticker9On ? hisse9 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=1, row=10, text=ticker10On ? hisse10 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=1, row=11, text=ticker11On ? hisse11 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)
    table.cell(table_id=dataTable, column=1, row=12, text=ticker12On ? hisse12 : na, height=0, text_color=color.white, text_halign=text.align_left, text_valign=text.align_center, bgcolor=color.blue)