Kimchi Premium Indicator with Selectable Symbols
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © chanu_lev10k

//@version=4
study("Kimchi Premium Indicator with Selectable Symbols", overlay=false)

sym_krw = input(title="Select BTCKRW Market", type=input.symbol, defval="UPBIT:BTCKRW")
sym_usd = input(title="Select BTCUSD Market", type=input.symbol, defval="BYBIT:BTCUSD")
res = input(title="Resolution", type=input.resolution, defval="")

usdkrw = security("FX_IDC:USDKRW", res, close)
btckrw = security(sym_krw, res, close)
btcusd = security(sym_usd, res, close)

btcusd_to_krw = btcusd * usdkrw
kp = ((btckrw / btcusd_to_krw) - 1) * 100

plot(kp, style=plot.style_line, color=kp > 0 ? color.red : color.blue)
hline(0, title="zero line")