[RS]Power Correlation Oscillator (DOLLAR) V0

Dollar version.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?
study(title='[RS]Power Correlation Oscillator (DOLLAR) V0', shorttitle='PCO(USD)', overlay=false)

s00 = security('EURUSD', period, close<close[1])
s01 = security('GBPUSD', period, close<close[1])
s02 = security('USDCHF', period, close>close[1])
s03 = security('AUDUSD', period, close<close[1])
s04 = security('NZDUSD', period, close<close[1])
s05 = security('USDJPY', period, close>close[1])
s06 = security('USDTRY', period, close>close[1])
s07 = security('USDNOK', period, close>close[1])
s08 = security('USDCAD', period, close>close[1])
s09 = security('USDSEK', period, close>close[1])

power = s00 + s01 + s02 + s03 + s04 + s05 + s06 + s07 + s08 + s09
avg_power = sma(power, input(15))
smooth_power = ema(avg_power, input(10))

hline(0, color=gray)
hline(5, color=gray)
hline(10, color=gray)
plot(title='Power', series=power, style=columns, color=power>=5?lime:red, transp=85, histbase=5)
plot(title='Average', series=avg_power, color=gray)
plot(title='Smooth', series=smooth_power, color=black)