Price Converter WAVAX to USDT.e
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// Ondery .

//@version=4
study(title="Price Converter WAVAX to USDT.e", shorttitle="WAVAX to USDT.e", overlay=false, precision=4)
//
symO = security(syminfo.tickerid,"",open)
symH = security(syminfo.tickerid,"",high)
symL = security(syminfo.tickerid,"",low)
symC = security(syminfo.tickerid,"",close)


pWAVAXUsdtE = security("PANGOLIN:WAVAXUSDT.e","",close)

choice = input(title="Type", defval="CandleStick", options=["CandleStick", "Line"])

linecolor = open < close ? color.green : color.red
linecolor2 = open < close ? color.blue : color.maroon


CPO = if (syminfo.currency == 'WAVAX' or syminfo.currency == 'AVAX')
    symO * pWAVAXUsdtE

CPH = if (syminfo.currency == 'WAVAX' or syminfo.currency == 'AVAX')
    symH * pWAVAXUsdtE

CPL = if (syminfo.currency == 'WAVAX' or syminfo.currency == 'AVAX')
    symL * pWAVAXUsdtE

CPC = if (syminfo.currency == 'WAVAX' or syminfo.currency == 'AVAX')
    symC * pWAVAXUsdtE

	
plotcandle(choice == "CandleStick" ? CPO:na, choice == "CandleStick" ? CPH:na, choice == "CandleStick" ? CPL:na, choice == "CandleStick" ? CPC:na, title='Candles', color = open < close ? color.green : color.red, wickcolor=color.black)
plot(choice == "Line" ? CPC:na, title="Price", color=#3F812F, linewidth=2, transp=40)