LankouSpreads ema 13 FTX
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © lankou

//@version=5
indicator('LankouSpreads ema 13 FTX', overlay=false)

//detects binacne / ftx

// mid = ""
// if (syminfo.prefix == "FTX")
    // mid := ""
// if (syminfo.prefix == "BINANCE")
    // mid := "USDT"

ema_period = input(defval=13, title="EMA")

// PERP from FTX
the_string_perp = "FTX:" + str.replace_all(syminfo.ticker, "USDT", "") + "PERP"

symOpen = request.security(the_string_perp, timeframe.period, open)
col = color.rgb(255, 255, 255)
if ta.ema(symOpen, 13) > ta.ema(open, ema_period)
    col := color.rgb(50, 195, 220)
else
    col := color.rgb(185, 50, 100)

//plot(ta.ema(symOpen - open, 13), color=col, style=plot.style_area)
plot(ta.ema(symOpen - open, ema_period), color=col, style=plot.style_columns)


