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

//@version=5
indicator("PBoC Liquidity Injections [tedtalksmacro]", overlay = false, format = format.price)

// Calculate Chinese Liquidity
chinarrpclose = request.security("CNLIVRR * FX_IDC:CNYUSD", "D", close, currency = currency.USD)
chinamlfclose = request.security("CNLIVMLF * FX_IDC:CNYUSD", "D", close, currency = currency.USD)

totalliquidity = chinamlfclose + chinarrpclose

// plot liquidity
plot(totalliquidity / 1000000000, style = plot.style_columns, linewidth=2, color= color.rgb(4, 4, 4), title = 'Total Injections [bn USD]')
plot(chinamlfclose / 1000000000, style = plot.style_columns, linewidth=2, color= color.rgb(60, 79, 126), title = 'MLF Injections [bn USD]')
plot(chinarrpclose / 1000000000, style = plot.style_columns, linewidth=2, color= color.rgb(255, 165, 0), title = 'Reverse Repo [bn USD]')
