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.
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.
//@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)