// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © goodgains
//@version=5
indicator("CPL", overlay = true)
// @keywords: cpl, cross-symbol-price, request-security, exchange-prefix, remote-symbol, price-line, dotted-line, horizontal-level, last-bar-label, symbol-root-label, overlay-price, external-quote, line-extension, bar-index-line, close-label, price-marker, ticker-label, eth-perp, show-prefix, bitget
show_prefix = input.bool(false, title = 'Show Prefix')
exchange_prefix = input.string('BITGET', title = 'Exchange Prefix')
request_symbol = exchange_prefix + ":" + 'ETHUSDTPERP'
last_price = request.security(request_symbol, "", close)
if barstate.islast
line = line.new(bar_index+5, last_price, bar_index + 10, last_price, xloc = xloc.bar_index, extend = extend.right, color = color.white, style = line.style_dotted, width = 1)
line.delete(line[1])
if show_prefix
label1 = label.new(bar_index + 10, close, text=syminfo.root, style=label.style_label_center, color = color.white)
label.delete(label1[1])