FxLowe

Renminbi Peg Band

Simple script to draw the upper and lower bands based on the % tolerance the PBOC has set around their reference rate.

Right now, reference rate and % tolerance are input variables that must be input/updated manually. Hopefully one day Tradingview allows the automatic update to be scripted.

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.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
//@version=2
//FxLowe - CNY Peg Bands.

study(title = "CNY Peg Band", overlay = true)
ReferenceRate = input(title="Reference Rate", type=float, defval=6.5233)
TolerancePercent = input(title="Percentage Tolerance", type=float, defval=2.1)

band = ReferenceRate * (TolerancePercent/100)

plot(ReferenceRate+band, title="Upper Bound", color=orange, editable=true)
plot(ReferenceRate-band, title="Lower Bound", color=orange, editable=true)