SPX Fair Value Bands WSHOSHO
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © dharmatech

//@version=5
indicator("SPX Fair Value Bands WSHOSHO", overlay = true)

wshosho = request.security("WSHOSHO",   "D", close)
rrp     = request.security("RRPONTSYD", "D", close)
tga     = request.security("WTREGEN",   "D", close)

nl = wshosho - rrp - tga

spx_fv = nl / 1000 / 1000 / 1000 - 1700

upper = spx_fv + 300
lower = spx_fv - 200

plot(series=upper,  title = 'Upper Band', color = color.red)
plot(series=spx_fv, title = 'Fair Value', color = color.orange)
plot(series=lower,  title = 'Lower Band', color = color.green)
