Bu indikatör, bir hisseye ait aşağıdaki değerleri bir tablo ile gösterir:
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Niteya
//@version=5
// Bu indikatör sadece eğitim amaçlı olarak verilmiştir. Yatırım kararlarınızda kullanmayınız.
indicator(title='Niteya Dollar-Based Pricing', shorttitle='Niteya DBP', overlay=true)
cur_exchange = "USDTRY"
bar_number = last_bar_index+1
[close_ticker_cur, close_ticker_high_cur] = request.security(syminfo.tickerid, "D", [close, ta.highest(close, bar_number)], currency=syminfo.currency)
[close_ticker_usd, close_ticker_high_usd] = request.security(syminfo.tickerid, "D", [close, ta.highest(close, bar_number)], currency="USD")
usd_cur = request.security(cur_exchange, "D", close) // Dollar exchange rate
if barstate.islast
if (str.substring(cur_exchange, 3)==syminfo.currency)
var table price_table = table.new(position.top_right, columns=6, rows=2, bgcolor=color.new(#E0E0E0, 40), border_width=1, border_color=color.white)
row = 0
string header2 = '', header3 = '', header4 = '', header5 = '', header6 = ''
string tip1 = '', tip2 = '', tip3 = '', tip4 = '', tip5 = '', tip6 = ''
if (cur_exchange=="USDTRY")
tip1 := 'Hisse'
tip2 := 'Geçmiş en yüksek fiyat (TL)'
tip3 := 'Geçmiş en yüksek fiyat (USD)'
tip4 := 'Kapanış fiyatı'
tip5 := 'Tahmini fiyat (USD dayalı TL)'
tip6 := 'Artış oranı (%)'
header2 := 'GEYF (TL)'
header3 := 'GEYF (USD)'
header4 := 'KF (TL)'
header5 := 'TF (TL)'
header6 := 'Artış (%)'
table.cell(price_table, 0, row, tip1, text_color=color.rgb(236, 236, 236), bgcolor=color.rgb(60, 60, 60), tooltip=tip1)
table.cell(price_table, 1, row, header2, text_color=color.rgb(236, 236, 236), bgcolor=color.rgb(60, 60, 60), tooltip=tip2)
table.cell(price_table, 2, row, header3, text_color=color.rgb(236, 236, 236), bgcolor=color.rgb(60, 60, 60), tooltip=tip3)
table.cell(price_table, 3, row, header4, text_color=color.rgb(236, 236, 236), bgcolor=color.rgb(60, 60, 60), tooltip=tip4)
table.cell(price_table, 4, row, header5, text_color=color.rgb(236, 236, 236), bgcolor=color.rgb(60, 60, 60), tooltip=tip5)
table.cell(price_table, 5, row, header6, text_color=color.rgb(236, 236, 236), bgcolor=color.rgb(60, 60, 60), tooltip=tip6)
row += 1
table.cell(price_table, 0, row, str.substring(syminfo.tickerid, str.pos(syminfo.tickerid, ":")+1), text_color=color.blue, text_halign=text.align_left)
table.cell(price_table, 1, row, str.tostring(close_ticker_high_cur, "#.###"), text_color=color.black, text_halign=text.align_right)
table.cell(price_table, 2, row, str.tostring(close_ticker_high_usd, "#.###"), text_color=color.green, text_halign=text.align_right)
table.cell(price_table, 3, row, str.tostring(close_ticker_cur, "#.###"), text_color=color.fuchsia, text_halign=text.align_right)
table.cell(price_table, 4, row, str.tostring(close_ticker_high_usd * usd_cur, "#.###"), text_color=color.orange, text_halign=text.align_right)
table.cell(price_table, 5, row, str.tostring(((100*close_ticker_high_usd*usd_cur)/close_ticker_cur)-100, "#.###"), text_color=color.orange, text_halign=text.align_right)
Yukarıdaki indikatörle ile ilgili bir uygulama aşağıda grafikte gösterilmektedir: