I am trying to create a list selection for symbols. The sets are working, but the exchangeList is not. I want to be able to select the exchange first, and then the sets from that list.
Here is the code that I am using:
exchangeList = input.string("COINBASE", title="Exchange", options=["BINANCE", "COINBASE", "KUCOIN"])
setList = input.string("Set 1", title="Coin Sets", options=["Set 1", "Set 2", "Set 3"])
//Coinbase
string s01 = setList == "Set 1" ? f_ticker('COINBASE:00USD'): setList == "Set 2" ? f_ticker('COINBASE:AMPUSD'): f_ticker('COINBASE:ETHBTC')
//BINANCE
string s01 = setList == "Set 1" ? f_ticker('BINANCE:ETHUSDT'): setList == "Set 2" ? f_ticker('BINANCE:LTCUSDT'): f_ticker('BINANCE:ADAUSDT')
//KUCOIN
string s01 = setList == "Set 1" ? f_ticker('KUCOIN:MATICUSDT'): setList == "Set 2" ? f_ticker('KUCOIN:ETCUSDT'): f_ticker('KUCOIN:SOLUSDT')
I tried the following code and it didn't work:
//KUCOIN
string s01 = exchangeList == "KUCOIN" ? "Coinbase" : setList == "Set 1" ? f_ticker('COINBASE:00USD'): setList == "Set 2" ? f_ticker('COINBASE:AMPUSD'): f_ticker('COINBASE:ETHBTC')
I also tried this:
if exchangeList == "Coinbase"
string s01 = setList == "Set 1" ? f_ticker('COINBASE:00USD'): setList == "Set 2" ? f_ticker('COINBASE:AMPUSD'): setList == "Set 3" ? f_ticker('COINBASE:AXLUSD'): f_ticker('COINBASE:UNIBTC')
each list starts with string s01 and there are 15 total so I am not sure how to make this happen.
This may not be perfect but it is working: