Recessions [TXMC]
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TXMC

//@version=5
indicator("Recessions [TXMC]", overlay=true)

src = request.quandl("FRED/USRECD")         // Recession data from Federal Reserve
bool = src == 1 ? true : false              // if value is 1, call True (means there is a recession)

// Band color
color band = input.color(color.new(#fe4a49,70), title="Recession Band")

// Plot
bgcolor(bool ? band : na)